From 6752b7704499f9af64c36eceb705071543b2b5f0 Mon Sep 17 00:00:00 2001 From: Pradosh Date: Sun, 28 Jun 2026 15:40:06 +0530 Subject: [PATCH] Fix kernel warning and memory safety issues --- source/compile_commands.json | 486 +++++++++--------- source/includes/acpi.h | 4 +- source/includes/ahci.h | 4 +- source/includes/algorithms/hashing.h | 2 +- source/includes/cc-asm.h | 10 +- source/includes/cpuid2.h | 19 +- source/includes/drivers/pc-speaker.h | 2 +- source/includes/drivers/rtl8139.h | 2 +- source/includes/drivers/serial.h | 4 +- source/includes/filesystems/fat16.h | 2 +- source/includes/filesystems/vfs.h | 2 +- source/includes/gdt.h | 2 +- source/includes/graphics.h | 4 +- source/includes/hal.h | 186 +++---- source/includes/heap.h | 2 +- source/includes/idt.h | 4 +- source/includes/keyboard.h | 8 +- source/includes/math/fpu.h | 2 +- source/includes/meltdown.h | 3 +- source/includes/memory.h | 2 +- source/includes/opengl/glcontext.h | 6 +- source/includes/pci.h | 2 +- source/includes/ps2-mouse.h | 4 +- source/includes/rtc.h | 6 +- source/includes/sse.h | 4 +- source/includes/strings.h | 4 +- source/includes/tss.h | 4 +- source/includes/versions.h | 2 +- source/kernel/C/acpi.c | 21 +- source/kernel/C/ahci.c | 38 +- source/kernel/C/algorithms/hashing.c | 2 +- source/kernel/C/cc-asm.c | 10 +- source/kernel/C/cpuid.c | 20 +- source/kernel/C/debugger.c | 26 +- source/kernel/C/disk/gpt.c | 6 +- source/kernel/C/disk/mbr.c | 5 +- source/kernel/C/gdt.c | 13 +- source/kernel/C/hal.c | 332 ++++++------ source/kernel/C/heap.c | 2 +- source/kernel/C/interrupts/idt.c | 20 +- .../kernel/C/interrupts/syscalls-x86_64.asm | 2 + source/kernel/C/kernel.c | 4 +- source/kernel/C/math/fpu.c | 2 +- source/kernel/C/memory.c | 4 +- source/kernel/C/nvme.c | 23 +- source/kernel/C/opengl/glcontext.c | 6 +- source/kernel/C/paging.c | 4 +- source/kernel/C/pci.c | 4 +- source/kernel/C/pit.c | 2 +- source/kernel/C/rtc.c | 6 +- source/kernel/C/shell/commands/fwfetch.c | 2 +- source/kernel/C/shell/sh.c | 6 +- source/kernel/C/sse.c | 4 +- source/kernel/C/tss.c | 16 +- source/kernel/C/user-input/keyboard.c | 8 +- source/kernel/C/user-input/ps2-mouse.c | 14 +- 56 files changed, 712 insertions(+), 672 deletions(-) diff --git a/source/compile_commands.json b/source/compile_commands.json index 9298136..9cffbab 100644 --- a/source/compile_commands.json +++ b/source/compile_commands.json @@ -1,407 +1,407 @@ [ { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/ringbuffer.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/ringbuffer.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/misc/versions.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/misc/versions.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/fb.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/fb.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/disk/mbr.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/disk/mbr.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/opengl/glmat.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/opengl/glmat.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/disk/gpt.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/disk/gpt.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/opengl/glcontext.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/opengl/glcontext.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/multitasking.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/multitasking.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/opengl/glbackend.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/opengl/glbackend.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/meltdown.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/meltdown.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/executables/fwde.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/executables/fwde.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/sse.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/sse.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/executables/elf.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/executables/elf.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/debugger.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/debugger.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/syscalls.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/syscalls.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/nvme.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/nvme.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/hal.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/hal.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/ahci.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/ahci.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/fdlfcn.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/fdlfcn.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/acpi.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/acpi.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/userland.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/userland.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/gdt.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/gdt.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/archive/tarball.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/archive/tarball.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/cpuid.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/cpuid.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/user-input/keyboard.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/user-input/keyboard.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/hal.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/hal.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/user-input/ps2-mouse.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/user-input/ps2-mouse.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/tss.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/tss.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/user-input/tty.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/user-input/tty.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/image/targa.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/image/targa.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/logger.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/logger.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/pit.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/pit.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/rtc.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/rtc.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/stream.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/stream.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/gdt.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/gdt.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/executables/fwde.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/executables/fwde.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/sort.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/sort.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/executables/elf.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/executables/elf.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/acpi-shutdown.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/acpi-shutdown.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/pci.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/pci.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/strings.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/strings.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/linkedlist.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/linkedlist.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/heap.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/heap.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/flanterm/flanterm.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/flanterm/flanterm.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/meltdown.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/meltdown.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/shell/sh.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/shell/sh.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/cpuid.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/cpuid.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/shell/commands/whoami.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/shell/commands/whoami.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/paging.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/paging.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/shell/commands/ls.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/shell/commands/ls.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/interrupts/isr.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/interrupts/isr.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/shell/commands/cd.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/shell/commands/cd.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/interrupts/idt.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/interrupts/idt.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/shell/commands/mv.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/shell/commands/mv.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/acpi.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/acpi.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/shell/commands/fwfetch.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/shell/commands/fwfetch.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/ahci.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/ahci.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/shell/commands/clear.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/shell/commands/clear.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/memory.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/memory.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/shell/commands/mkdir.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/shell/commands/mkdir.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/image/targa.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/image/targa.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/shell/commands/rm.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/shell/commands/rm.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/kernel.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/kernel.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/shell/commands/echo.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/shell/commands/echo.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/cc-asm.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/cc-asm.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/shell/commands/exec.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/shell/commands/exec.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/linkedlist.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/linkedlist.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/shell/commands/lspci.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/shell/commands/lspci.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/filesystems/vfs.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/filesystems/vfs.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/shell/commands/umount.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/shell/commands/umount.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/filesystems/layers/dev.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/filesystems/layers/dev.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/shell/commands/cat.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/shell/commands/cat.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/filesystems/layers/proc.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/filesystems/layers/proc.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/shell/commands/tasks.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/shell/commands/tasks.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/filesystems/fwrfs.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/filesystems/fwrfs.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/shell/commands/lsblk.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/shell/commands/lsblk.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/filesystems/iso9660.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/filesystems/iso9660.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/shell/commands/pwd.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/shell/commands/pwd.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/filesystems/fat16.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/filesystems/fat16.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/shell/commands/mount.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/shell/commands/mount.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/filesystems/fat32.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/filesystems/fat32.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/shell/commands/touch.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/shell/commands/touch.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/shell/login.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/shell/login.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/shell/commands/shutdown.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/shell/commands/shutdown.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/shell/sh.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/shell/sh.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/shell/login.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/shell/login.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/shell/commands/ls.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/shell/commands/ls.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/paging.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/paging.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/shell/commands/fwfetch.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/shell/commands/fwfetch.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/syscalls.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/syscalls.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/shell/commands/umount.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/shell/commands/umount.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/heap.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/heap.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/shell/commands/echo.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/shell/commands/echo.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/opengl/glbackend.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/opengl/glbackend.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/shell/commands/mkdir.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/shell/commands/mkdir.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/opengl/glcontext.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/opengl/glcontext.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/shell/commands/cd.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/shell/commands/cd.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/opengl/glmat.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/opengl/glmat.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/shell/commands/touch.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/shell/commands/touch.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/fdlfcn.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/fdlfcn.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/shell/commands/clear.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/shell/commands/clear.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/archive/tarball.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/archive/tarball.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/shell/commands/rm.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/shell/commands/rm.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/math/fpu.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/math/fpu.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/shell/commands/mv.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/shell/commands/mv.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/rtc.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/rtc.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/shell/commands/cat.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/shell/commands/cat.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/kernel.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/kernel.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/shell/commands/exec.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/shell/commands/exec.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/sort.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/sort.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/shell/commands/lspci.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/shell/commands/lspci.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/acpi-shutdown.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/acpi-shutdown.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/shell/commands/tasks.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/shell/commands/tasks.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/pci_id.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/pci_id.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/shell/commands/shutdown.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/shell/commands/shutdown.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/strings.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/strings.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/shell/commands/lsblk.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/shell/commands/lsblk.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/filesystems/vfs.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/filesystems/vfs.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/shell/commands/mount.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/shell/commands/mount.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/filesystems/fat32.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/filesystems/fat32.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/shell/commands/whoami.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/shell/commands/whoami.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/filesystems/fwrfs.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/filesystems/fwrfs.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/shell/commands/pwd.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/shell/commands/pwd.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/filesystems/iso9660.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/filesystems/iso9660.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/nvme.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/nvme.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/filesystems/layers/dev.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/filesystems/layers/dev.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/disk/gpt.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/disk/gpt.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/filesystems/layers/proc.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/filesystems/layers/proc.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/disk/mbr.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/disk/mbr.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/filesystems/fat16.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/filesystems/fat16.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/flanterm/flanterm.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/flanterm/flanterm.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/memory.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/memory.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/sse.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/sse.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/interrupts/idt.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/interrupts/idt.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/secure-boot.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/secure-boot.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/interrupts/isr.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/interrupts/isr.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/pci.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/pci.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/secure-boot.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/secure-boot.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/stream.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/stream.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/userland.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/userland.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/algorithms/hashing.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/algorithms/hashing.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/algorithms/hashing.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/algorithms/hashing.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/multitasking.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/multitasking.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/cc-asm.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/cc-asm.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/debugger.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/debugger.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/logger.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/logger.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/tss.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/tss.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/ringbuffer.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/ringbuffer.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/pci_id.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/pci_id.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/user-input/tty.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/user-input/tty.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/math/fpu.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/math/fpu.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/user-input/ps2-mouse.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/user-input/ps2-mouse.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/misc/versions.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/misc/versions.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/user-input/keyboard.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/user-input/keyboard.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/kernel/C/pit.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/kernel/C/pit.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/kernel/C/fb.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/kernel/C/fb.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/drivers/serial.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/drivers/serial.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/drivers/audio/pc-speaker.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/drivers/audio/pc-speaker.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/drivers/networking/ethernet/RTL/8139.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/drivers/networking/ethernet/RTL/8139.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/drivers/serial.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/drivers/serial.c -o /dev/null" }, { - "directory": "/home/pradosh/osdev/source", - "file": "/home/pradosh/osdev/source/drivers/audio/pc-speaker.c", - "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /home/pradosh/osdev/source/drivers/audio/pc-speaker.c -o /dev/null" + "directory": "/workspace/osdev/source", + "file": "/workspace/osdev/source/drivers/networking/ethernet/RTL/8139.c", + "command": "clang -std=gnu11 -ffreestanding -w -fno-common -fno-stack-protector -fno-stack-check -fno-lto -fno-builtin -fno-omit-frame-pointer -Og -g -fPIE -I includes -I src -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-red-zone -mno-sse -mno-sse2 -MMD -MP -c /workspace/osdev/source/drivers/networking/ethernet/RTL/8139.c -o /dev/null" } ] diff --git a/source/includes/acpi.h b/source/includes/acpi.h index b31d99e..8ae6629 100755 --- a/source/includes/acpi.h +++ b/source/includes/acpi.h @@ -14,7 +14,7 @@ #include #include -extern char* oem_name; +extern const char* oem_name; extern bool virtualized; @@ -43,7 +43,7 @@ struct acpi_gas { * @brief Initializes and iterates through all ACPI tables * */ -void acpi_init(); +void acpi_init(void); /** * @brief Searches for an STD Header in the ACPI Tables diff --git a/source/includes/ahci.h b/source/includes/ahci.h index eb9dbcd..f7fe857 100755 --- a/source/includes/ahci.h +++ b/source/includes/ahci.h @@ -92,7 +92,7 @@ typedef struct { void* fis; } ahci_port_mem_t; -static ahci_port_mem_t port_mem[32]; +extern ahci_port_mem_t port_mem[32]; /** @@ -281,5 +281,7 @@ general_partition_t* search_general_partition(cstring partition_name); mount_entry_t* add_mount(const char* mount_point, const char* part_name, partition_fs_type_t type, void* fs_ptr); mount_entry_t* find_mount_by_point(const char* mount_point); +int remove_mount(const char* mount_point); +void list_all_mounts(void); #endif // AHCI_H diff --git a/source/includes/algorithms/hashing.h b/source/includes/algorithms/hashing.h index b85d0d3..e0d504b 100755 --- a/source/includes/algorithms/hashing.h +++ b/source/includes/algorithms/hashing.h @@ -19,7 +19,7 @@ * @brief Verifies if the hash is working (not really initializing anything) * */ -void init_hashing(); +void init_hashing(void); /** * @brief The function to hash an string (const char *) diff --git a/source/includes/cc-asm.h b/source/includes/cc-asm.h index 940f3d7..72b573e 100755 --- a/source/includes/cc-asm.h +++ b/source/includes/cc-asm.h @@ -14,29 +14,29 @@ * @brief Halt and catch fire function. * */ -void hcf(); +void hcf(void); /** * @brief The clear interrupts command for all architectures. * */ -void clear_interrupts(); +void clear_interrupts(void); /** * @brief The set interrupts command for various architectures. * */ -void set_interrupts(); +void set_interrupts(void); /** * @brief It uses while loops instead of assembly's halt, * Good for Userland * */ -void high_level_halt(); +void high_level_halt(void); /** * @brief Halt and catch fire function but doesn't print any text. * */ -void hcf2(); \ No newline at end of file +void hcf2(void); \ No newline at end of file diff --git a/source/includes/cpuid2.h b/source/includes/cpuid2.h index a787ac0..4868c12 100755 --- a/source/includes/cpuid2.h +++ b/source/includes/cpuid2.h @@ -21,7 +21,7 @@ * @param where An integer array to store the result, with at least 4 elements. * @return The value of the EAX register after executing CPUID. */ -static inline int cpuid_string(int code, int where[4]); +int cpuid_string(int code, int where[4]); /** * @brief Returns a string representing the CPU type. @@ -31,7 +31,7 @@ static inline int cpuid_string(int code, int where[4]); * * @return A constant string representing the CPU type. */ -cstring cpu_string(); +cstring cpu_string(void); /** * @brief Executes the CPUID instruction and retrieves values of the specified registers. @@ -45,38 +45,39 @@ cstring cpu_string(); * @param ecx Pointer to store the value of ECX register. * @param edx Pointer to store the value of EDX register. */ -inline void cpuid(int32 reg, int32 *eax, int32 *ebx, int32 *ecx, int32 *edx); +void cpuid(int32 reg, int32 *eax, int32 *ebx, int32 *ecx, int32 *edx); /** * @brief Retrieve the CPU vendor string. * * @return The CPU vendor string. */ -cstring get_cpu_vendor(); +cstring get_cpu_vendor(void); /** * @brief Retrieve the CPU name. * * @return The CPU name. */ -cstring get_cpu_name(); +cstring get_cpu_name(void); /** * @brief Print CPU information, including the vendor and CPU string. */ -void print_cpu_info(); +void print_cpu_info(void); /** * @brief Retrieve and print L1 cache information. */ -void print_L1_cache_info(); +void print_L1_cache_info(void); /** * @brief Retrieve and print L2 cache information. */ -void print_L2_cache_info(); +void print_L2_cache_info(void); /** * @brief Retrieve and print L3 cache information. */ -void print_L3_cache_info(); \ No newline at end of file +void print_L3_cache_info(void); +bool is_kvm_supported(void); diff --git a/source/includes/drivers/pc-speaker.h b/source/includes/drivers/pc-speaker.h index 07fdfb6..58b6357 100755 --- a/source/includes/drivers/pc-speaker.h +++ b/source/includes/drivers/pc-speaker.h @@ -22,7 +22,7 @@ void play_sound(int32 frequency); * @brief Mutes the PC Speaker temporaily * */ -void mute(); +void mute(void); /** * @brief Does a BEEP in PC Speaker diff --git a/source/includes/drivers/rtl8139.h b/source/includes/drivers/rtl8139.h index 9276e0b..b88baa7 100755 --- a/source/includes/drivers/rtl8139.h +++ b/source/includes/drivers/rtl8139.h @@ -56,7 +56,7 @@ extern struct rtl8139* RTL8139; * * @param nic */ -void read_mac_address(); +void read_mac_address(void); /** * @brief Initialize RTL8139 NIC diff --git a/source/includes/drivers/serial.h b/source/includes/drivers/serial.h index 71454cf..8845dca 100755 --- a/source/includes/drivers/serial.h +++ b/source/includes/drivers/serial.h @@ -37,7 +37,7 @@ extern int select; * @brief Finds the working serial COM port in the OS ranging from 1-8 * */ -void probe_serial(); +void probe_serial(void); /** * @brief Initialize serial at a specific port @@ -52,7 +52,7 @@ int init_serial(int port); * * @return int status code */ -int transmit_status(); +int transmit_status(void); /** * @brief Put a character to a serial COM diff --git a/source/includes/filesystems/fat16.h b/source/includes/filesystems/fat16.h index b6d638a..d33da85 100644 --- a/source/includes/filesystems/fat16.h +++ b/source/includes/filesystems/fat16.h @@ -80,7 +80,7 @@ typedef struct { uint16_t cluster; } fat16_file_t; -// partition_fs_type_t detect_fat_type_enum(const int8* buf); +partition_fs_type_t detect_fat_type_enum(const int8* buf); int fat16_mount(int portno, uint32_t partition_lba, fat16_fs_t* fs) ; uint16_t fat16_read_fat_fs(fat16_fs_t* fs, uint16_t cluster); int fat16_list_root(fat16_fs_t* fs); diff --git a/source/includes/filesystems/vfs.h b/source/includes/filesystems/vfs.h index 9be9d4c..250039e 100644 --- a/source/includes/filesystems/vfs.h +++ b/source/includes/filesystems/vfs.h @@ -132,7 +132,7 @@ int vfs_unlink(const char* path); * @brief Get the current working directory * @return Pointer to CWD string */ -const char* vfs_getcwd(); +const char* vfs_getcwd(void); const char* vfs_basename(const char* path); int vfs_normalize_path(const char* in, char* out, size_t out_sz); diff --git a/source/includes/gdt.h b/source/includes/gdt.h index 96859fc..e8a53c2 100644 --- a/source/includes/gdt.h +++ b/source/includes/gdt.h @@ -41,5 +41,5 @@ extern struct gdt_ptr gdtp; * @brief Set the up GDT for the entire OS. * */ -void setup_gdt(); +void setup_gdt(void); #endif \ No newline at end of file diff --git a/source/includes/graphics.h b/source/includes/graphics.h index dfdc986..ec587d2 100755 --- a/source/includes/graphics.h +++ b/source/includes/graphics.h @@ -35,7 +35,6 @@ // #define orange_color "\x1b[38;5;172m" -extern string last_filename; extern string last_filename; // for warn, info, err, done extern string last_print_file; extern string last_print_func; @@ -145,6 +144,7 @@ void printf_internal(cstring file, cstring func, int64 line, cstring format, ... * @param ... */ void printfnoln_internal(cstring file, cstring func, int64 line, cstring format, ...); +void eprintf_internal(cstring file, cstring func, int64 line, cstring format, ...); /** * @brief Core printf implementation used internally by both printf_internal and printfnoln_internal. @@ -166,7 +166,7 @@ void printfnoln_internal(cstring file, cstring func, int64 line, cstring format, */ void vprintf_internal(stream_t stream, cstring file, cstring func, int64 line, bool newline, cstring format, va_list argp); -/** +/* * @brief Formats a string into a buffer using a va_list. * * @param buf destination buffer. diff --git a/source/includes/hal.h b/source/includes/hal.h index d933f88..8e270c2 100755 --- a/source/includes/hal.h +++ b/source/includes/hal.h @@ -1,92 +1,94 @@ -/** - * @file hal.h - * @author Pradosh (pradoshgame@gmail.com) - * @brief Header file for Hardware Abstraction Layer -> Source from GoGX OS - * @version v1.0 - * @date 2022-08-03 - * - * @copyright Copyright Pradosh (c) 2022 - * - */ - -#include -#include - -#define pic1_command 0x20 -#define pic1_data 0x21 -#define pic2_command 0xA0 -#define pic2_data 0xA1 - -/** - * @brief Initializes HAL by remapping the PIC interrupts to avoid conflicts - * - */ -void init_hardware_abstraction_layer(); - -/** - * @brief Output a byte to the specified I/O port. - * - * This function sends a byte to the specified I/O port using inline assembly. - * - * @param port The 16-bit I/O port number. - * @param value The 8-bit value to be sent to the port. - */ -void outb(int16 port, int8 value); - -/** - * @brief Read a byte from the specified I/O port. - * - * This function reads a byte from the specified I/O port using inline assembly. - * - * @param port The 16-bit I/O port number. - * @return The 8-bit value read from the port. - */ -int8 inb(int16 port); - -/** - * @brief Output a 16-bit value to the specified I/O port. - * - * This function sends a 16-bit value to the specified I/O port using inline assembly. - * - * @param portNumber The 16-bit I/O port number. - * @param data The 16-bit value to be sent to the port. - */ -void outw(int16 portNumber, int16 data); - -/** - * @brief Read a 16-bit value from the specified I/O port. - * - * This function reads a 16-bit value from the specified I/O port using inline assembly. - * - * @param portNumber The 16-bit I/O port number. - * @return The 16-bit value read from the port. - */ -int16 inw(int16 portNumber); - -/** - * @brief Read a 32-bit value from the specified I/O port. - * - * This function reads a 32-bit value from the specified I/O port using inline assembly. - * - * @param portNumber The 16-bit I/O port number. - * @return The 32-bit value read from the port. - */ -int32 inl(int16 portNumber); - -/** - * @brief Output a 32-bit value to the specified I/O port. - * - * This function sends a 32-bit value to the specified I/O port using inline assembly. - * - * @param portNumber The 16-bit I/O port number. - * @param data The 32-bit value to be sent to the port. - */ -void outl(int16 portNumber, int32 data); - -/** - * @brief Perform an I/O wait operation. - * - * This function performs an I/O wait operation using inline assembly. - * It is used to add a small delay in I/O operations. - */ -void io_wait(); \ No newline at end of file +/** + * @file hal.h + * @author Pradosh (pradoshgame@gmail.com) + * @brief Header file for Hardware Abstraction Layer -> Source from GoGX OS + * @version v1.0 + * @date 2022-08-03 + * + * @copyright Copyright Pradosh (c) 2022 + * + */ + +#include +#include + +#define pic1_command 0x20 +#define pic1_data 0x21 +#define pic2_command 0xA0 +#define pic2_data 0xA1 + +/** + * @brief Initializes HAL by remapping the PIC interrupts to avoid conflicts + * + */ +void init_hardware_abstraction_layer(void); + +/** + * @brief Output a byte to the specified I/O port. + * + * This function sends a byte to the specified I/O port using inline assembly. + * + * @param port The 16-bit I/O port number. + * @param value The 8-bit value to be sent to the port. + */ +void outb(int16 port, int8 value); + +/** + * @brief Read a byte from the specified I/O port. + * + * This function reads a byte from the specified I/O port using inline assembly. + * + * @param port The 16-bit I/O port number. + * @return The 8-bit value read from the port. + */ +int8 inb(int16 port); + +/** + * @brief Output a 16-bit value to the specified I/O port. + * + * This function sends a 16-bit value to the specified I/O port using inline assembly. + * + * @param portNumber The 16-bit I/O port number. + * @param data The 16-bit value to be sent to the port. + */ +void outw(int16 portNumber, int16 data); + +/** + * @brief Read a 16-bit value from the specified I/O port. + * + * This function reads a 16-bit value from the specified I/O port using inline assembly. + * + * @param portNumber The 16-bit I/O port number. + * @return The 16-bit value read from the port. + */ +int16 inw(int16 portNumber); + +/** + * @brief Read a 32-bit value from the specified I/O port. + * + * This function reads a 32-bit value from the specified I/O port using inline assembly. + * + * @param portNumber The 16-bit I/O port number. + * @return The 32-bit value read from the port. + */ +int32 inl(int16 portNumber); + +/** + * @brief Output a 32-bit value to the specified I/O port. + * + * This function sends a 32-bit value to the specified I/O port using inline assembly. + * + * @param portNumber The 16-bit I/O port number. + * @param data The 32-bit value to be sent to the port. + */ +void outl(int16 portNumber, int32 data); + +/** + * @brief Perform an I/O wait operation. + * + * This function performs an I/O wait operation using inline assembly. + * It is used to add a small delay in I/O operations. + */ +void io_wait(void); +void io_wait_us(uint32_t usec); +void io_wait_ms(uint32_t msec); diff --git a/source/includes/heap.h b/source/includes/heap.h index a987431..a806490 100755 --- a/source/includes/heap.h +++ b/source/includes/heap.h @@ -45,7 +45,7 @@ extern void mm_constrict(uint64_t removal_size); * @brief Prints out heap information. * */ -extern void mm_print_out(); +extern void mm_print_out(void); /** * @brief The main memory alloc function. diff --git a/source/includes/idt.h b/source/includes/idt.h index c03b269..1409a0c 100755 --- a/source/includes/idt.h +++ b/source/includes/idt.h @@ -53,9 +53,9 @@ extern void syscall_entry(void); * @brief Tells the CPU to use the syscall instruction. * */ -void init_syscall(); +void init_syscall(void); -void initIdt(); +void initIdt(void); void setIdtEntry(IDTEntry *target, uint64_t offset, uint16_t selector, uint8_t ist, uint8_t type_attributes); #endif \ No newline at end of file diff --git a/source/includes/keyboard.h b/source/includes/keyboard.h index 1ba23fd..a22a3b1 100755 --- a/source/includes/keyboard.h +++ b/source/includes/keyboard.h @@ -47,7 +47,7 @@ char scancode_to_char(int scancode, bool uppercase); * @brief Initalizes the RingBuffer to store the characters. * */ -void keyboard_init(); +void keyboard_init(void); /** * @brief This is a function that is ran even when the sleep() function is called @@ -58,21 +58,21 @@ void process_keyboard(InterruptFrame* frame); /** * @brief Gets the current modifiers (like lshift, rshift, etc.) */ -uint8_t getmodifiers(); +uint8_t getmodifiers(void); /** * @brief Gets the last pressed char. * * @return [uint8_t] Last scancode */ -uint8_t getc(); +uint8_t getc(void); /** * @brief Non-blocking getc from keyboard buffer * * @return int Character if available, 0 if no input */ -int getc_nonblock(); +int getc_nonblock(void); /** * @brief Clears pending keyboard input so stale keypresses are discarded. diff --git a/source/includes/math/fpu.h b/source/includes/math/fpu.h index 0ef8f16..3d7cc87 100755 --- a/source/includes/math/fpu.h +++ b/source/includes/math/fpu.h @@ -22,4 +22,4 @@ void set_fpu_cw(const uint16_t cw); * @brief Enables the Floating point arithmetic unit for x86-64 * */ -void enable_fpu(); \ No newline at end of file +void enable_fpu(void); \ No newline at end of file diff --git a/source/includes/meltdown.h b/source/includes/meltdown.h index 66a2bbb..75c5f72 100755 --- a/source/includes/meltdown.h +++ b/source/includes/meltdown.h @@ -15,7 +15,8 @@ #include #include -extern struct InterruptFrame; +struct InterruptFrame; +void interrupt_frame_dump(struct InterruptFrame* frame); /** * @brief The Meltdown (Panic) Screen diff --git a/source/includes/memory.h b/source/includes/memory.h index c286a5f..5f196f7 100755 --- a/source/includes/memory.h +++ b/source/includes/memory.h @@ -119,6 +119,6 @@ void analyze_memory_map(struct memory_context* memory, struct limine_memmap_requ * * @return uint64_t value of CR2. */ -uint64_t getCR2(); +uint64_t getCR2(void); #endif // MEMORY_H \ No newline at end of file diff --git a/source/includes/opengl/glcontext.h b/source/includes/opengl/glcontext.h index 0aab508..406dfac 100755 --- a/source/includes/opengl/glcontext.h +++ b/source/includes/opengl/glcontext.h @@ -32,7 +32,7 @@ struct GLContext * * @returns The current active "OpenGL" context */ -GLAPI struct GLContext* glCreateContext(); +GLAPI struct GLContext* glCreateContext(void); /** * @brief Initializes an "OpenGL" context @@ -53,14 +53,14 @@ GLAPI struct GLContext* glCreateContextCustom(uint32_t* buffer, uint32_t width, * * @returns The current "OpenGL" context */ -GLAPI struct GLContext* glGetCurrentContext(); +GLAPI struct GLContext* glGetCurrentContext(void); /** * @brief Checks if the current context (if existent) is initialized * * @returns `true` if the context is initialized, otherwise `false` */ -GLAPI bool glContextInitialized(); +GLAPI bool glContextInitialized(void); /** * @brief Destroys a given "OpenGL" context diff --git a/source/includes/pci.h b/source/includes/pci.h index 7c02357..50bc25f 100755 --- a/source/includes/pci.h +++ b/source/includes/pci.h @@ -100,7 +100,7 @@ int8 getProgIF(int16 bus, int16 device, int16 function); * @brief Scans (Probes) PCI Devices * */ -void probe_pci(); +void probe_pci(void); /** * @brief Function to read a 32-bit value from the PCI configuration space diff --git a/source/includes/ps2-mouse.h b/source/includes/ps2-mouse.h index 17c36c4..117b9d4 100755 --- a/source/includes/ps2-mouse.h +++ b/source/includes/ps2-mouse.h @@ -69,7 +69,7 @@ void SetMouseButtonHandler(MouseButtonHandler handler); * * @returns The mouse position */ -ivec2 GetMousePosition(); +ivec2 GetMousePosition(void); /** * @brief Get the last mouse position @@ -78,7 +78,7 @@ ivec2 GetMousePosition(); * * @returns The last mouse position */ -ivec2 GetLastMousePosition(); +ivec2 GetLastMousePosition(void); /** * @brief Handles the mouse's diff --git a/source/includes/rtc.h b/source/includes/rtc.h index a0213de..133af27 100644 --- a/source/includes/rtc.h +++ b/source/includes/rtc.h @@ -48,7 +48,7 @@ int8 read_rtc_register(int8 reg); * @brief Wait till RTC is responding. * */ -void wait_rtc_update(); +void wait_rtc_update(void); /** * @brief Reads from a register without tick glitch (more stable) @@ -62,7 +62,7 @@ int8 rtc_read_stable(int8 reg); * @brief Initializes the main RTC for use. * */ -void init_rtc(); +void init_rtc(void); /** * @brief Updated the given variable with system time. @@ -80,7 +80,7 @@ void update_system_time(int8 *second, int8 *minute, int8 *hour, int8 *day, int8 * @brief Displays time in an neat format. * */ -void display_time(); +void display_time(void); /** * @brief Pauses the OS for set seconds. Use PIT for accuracy. diff --git a/source/includes/sse.h b/source/includes/sse.h index 8602d08..3d2ee85 100755 --- a/source/includes/sse.h +++ b/source/includes/sse.h @@ -21,12 +21,12 @@ extern char fxsave_region[512] __attribute__((aligned(16))); * @brief Loads the SEE fully with fxsave * */ -void load_complete_sse(); +void load_complete_sse(void); /** * @brief Checks if CPU is compatible with SSE * */ -void check_sse(); +void check_sse(void); #endif \ No newline at end of file diff --git a/source/includes/strings.h b/source/includes/strings.h index ceab97f..6d813cc 100755 --- a/source/includes/strings.h +++ b/source/includes/strings.h @@ -137,7 +137,6 @@ string strcat(string dest, cstring src); */ void remove_last_char(string str); -/** /** * @brief Converts a string to a long integer. * @@ -191,4 +190,5 @@ int isspace(char c); char* trim_inplace(char* s); -char* strrchr(const char* s, int c); \ No newline at end of file +char* strrchr(const char* s, int c); +char* strdup(const char* str); diff --git a/source/includes/tss.h b/source/includes/tss.h index 3fad36f..4c6e740 100644 --- a/source/includes/tss.h +++ b/source/includes/tss.h @@ -65,12 +65,12 @@ extern uint64_t kernel_stack_top; * @brief Initialize TSS. * */ -void kernel_tss_init(); +void kernel_tss_init(void); /** * @brief Load the TSS. * */ -void tss_load(); +void tss_load(void); #endif diff --git a/source/includes/versions.h b/source/includes/versions.h index cde19f2..a6900f8 100755 --- a/source/includes/versions.h +++ b/source/includes/versions.h @@ -23,7 +23,7 @@ extern cstring versions; */ extern cstring date; -static void frost_compilation_information(){ +static inline void frost_compilation_information(void){ print(yellow_color); print(versions); print(orange_color); diff --git a/source/kernel/C/acpi.c b/source/kernel/C/acpi.c index ece994f..4b99ebb 100755 --- a/source/kernel/C/acpi.c +++ b/source/kernel/C/acpi.c @@ -4,9 +4,9 @@ * @brief The full ACPI Source * @version 0.1 * @date 2023-10-29 - * + * * @copyright Copyright (C) 2019-2023 mintsuki and contributors. - * + * */ #include @@ -71,7 +71,7 @@ struct fadt { static bool use_xsdt; static struct rsdt *rsdt; -char* oem_name = ""; +const char* oem_name = ""; bool virtualized = false; @@ -79,7 +79,7 @@ static volatile struct limine_rsdp_request rsdp_req = { LIMINE_RSDP_REQUEST, 0, NULL }; -void acpi_init() +void acpi_init(void) { struct rsdp *rsdp = rsdp_req.response->address; info("Found RSDP address!", __FILE__); @@ -135,20 +135,21 @@ void acpi_reboot(uintptr_t hhdm_offset) { struct fadt *fadt = (struct fadt *)((uintptr_t)acpi_find_sdt("FACP", 0) + hhdm_offset); if (!fadt) goto fallback; - struct acpi_gas *reg = &fadt->reset_reg; + struct acpi_gas reg; + memcpy(®, (const void*)&fadt->reset_reg, sizeof(reg)); - if (reg->address && reg->address_space == 1) { - printf("ACPI reset: space=%d addr=0x%x value=0x%x", reg->address_space, reg->address, fadt->reset_value); - if (reg->address > 0xFFFF) + if (reg.address && reg.address_space == 1) { + printf("ACPI reset: space=%d addr=0x%x value=0x%x", reg.address_space, reg.address, fadt->reset_value); + if (reg.address > 0xFFFF) printf("Invalid I/O port! Will not work."); - outb((uint16_t)reg->address, fadt->reset_value); + outb((uint16_t)reg.address, fadt->reset_value); } fallback: outb(0xCF9, 0x02); outb(0xCF9, 0x06); - + // Keyboard controller reset for (int i = 0; i < 100000; i++) if (!(inb(0x64) & 0x02)) break; diff --git a/source/kernel/C/ahci.c b/source/kernel/C/ahci.c index daf0708..fad18b0 100755 --- a/source/kernel/C/ahci.c +++ b/source/kernel/C/ahci.c @@ -14,7 +14,11 @@ #include #include #include +#include +#include +#include +ahci_port_mem_t port_mem[32]; ahci_hba_mem_t* global_ahci_ctrl; ahci_disk_info_t ahci_disks[32]; general_partition_t ahci_partitions[MAX_PARTITIONS]; @@ -212,9 +216,9 @@ void handle_satapi_disk(int portno) { add_general_partition( PART_TABLE_MBR, 0, - total_sectors_512 > 0 ? (int64_t)(total_sectors_512 - 1) : 0, - (int64_t)total_sectors_512, - ahci_disks[portno].logical_device, + total_sectors_512 > 0 ? (int64)(total_sectors_512 - 1U) : (int64)0, + (int64)total_sectors_512, + (int64)ahci_disks[portno].logical_device, false, FS_ISO9660, part_name, @@ -334,7 +338,7 @@ general_partition_t* search_general_partition(cstring partition_name) { if (!partition_name) return NULL; - for (size_t i = 0; i < general_partition_count; i++) { + for (int i = 0; i < general_partition_count; i++) { if (strcmp(ahci_partitions[i].name, partition_name) == 0) { return &ahci_partitions[i]; } @@ -425,7 +429,7 @@ mount_entry_t* find_mount_by_point(const char* mount_point) return NULL; // not found } -void list_all_mounts() +void list_all_mounts(void) { if(mounted_partition_count == 0){ printf("no mounted partitions."); @@ -443,10 +447,10 @@ void ahci_init_port(int portno) { ahci_port_t* port = &global_ahci_ctrl->ports[portno]; ahci_port_mem_t* mem = &port_mem[portno]; - port->cmd &= ~AHCI_PORT_CMD_ST; + port->cmd &= (uint32_t)~AHCI_PORT_CMD_ST; while (port->cmd & AHCI_PORT_CMD_CR); - port->cmd &= ~AHCI_PORT_CMD_FRE; + port->cmd &= (uint32_t)~AHCI_PORT_CMD_FRE; while (port->cmd & AHCI_PORT_CMD_FR); mem->cmd_list = kmalloc_aligned(1024, 1024); @@ -472,7 +476,7 @@ void ahci_init_port(int portno) { port->cmd |= AHCI_PORT_CMD_FRE | AHCI_PORT_CMD_ST; } -static int ahci_wait_slot0_ready(ahci_port_t* port) +static int __attribute__((unused)) ahci_wait_slot0_ready(ahci_port_t* port) { uint32_t spins = 1000000; while (spins--) { @@ -519,7 +523,7 @@ static int ahci_read_sector_raw(int portno, uint64_t lba, void* buffer, uint32_t tbl->prdt[0].dba = (uint32_t)(uintptr_t)dma_buf; tbl->prdt[0].dbau = 0; - tbl->prdt[0].dbc = (count * 512 - 1) | (1 << 31); + tbl->prdt[0].dbc = (count * 512 - 1) | (1U << 31); uint8_t* cfis = tbl->cfis; cfis[0] = 0x27; @@ -599,7 +603,7 @@ static int ahci_write_sector_raw(int portno, uint64_t lba, void* buffer, uint32_ tbl->prdt[0].dba = (uint32_t)(uintptr_t)dma_buf; tbl->prdt[0].dbau = 0; - tbl->prdt[0].dbc = (count * 512 - 1) | (1 << 31); + tbl->prdt[0].dbc = (count * 512 - 1) | (1U << 31); uint8_t* cfis = tbl->cfis; cfis[0] = 0x27; @@ -642,6 +646,7 @@ static int ahci_write_sector_raw(int portno, uint64_t lba, void* buffer, uint32_ int ahci_identify(int portno, void* buffer) { int rc = 0; + void* dma_buf = NULL; ahci_port_t* port = &global_ahci_ctrl->ports[portno]; ahci_port_mem_t* mem = &port_mem[portno]; @@ -666,7 +671,7 @@ int ahci_identify(int portno, void* buffer) memset(tbl->cfis, 0, 64); memset(tbl->prdt, 0, sizeof(tbl->prdt)); - void* dma_buf = kmalloc_aligned(512, 4096); + dma_buf = kmalloc_aligned(512, 4096); if (!dma_buf) { rc = -10; goto out; @@ -674,7 +679,7 @@ int ahci_identify(int portno, void* buffer) tbl->prdt[0].dba = (uint32_t)(uintptr_t)dma_buf; tbl->prdt[0].dbau = 0; - tbl->prdt[0].dbc = (512 - 1) | (1 << 31); + tbl->prdt[0].dbc = (512 - 1) | (1U << 31); uint8_t* cfis = tbl->cfis; cfis[0] = 0x27; @@ -697,8 +702,11 @@ int ahci_identify(int portno, void* buffer) port->is = 0xFFFFFFFF; out: - memcpy(buffer, dma_buf, 512); - kfree(dma_buf); + if (dma_buf) { + if (rc == 0) + memcpy(buffer, dma_buf, 512); + kfree(dma_buf); + } ahci_unlock_port_io(portno); return rc; } @@ -748,7 +756,7 @@ static int ahci_issue_packet_command( tbl->prdt[0].dba = (uint32_t)(uintptr_t)dma_buf; tbl->prdt[0].dbau = 0; - tbl->prdt[0].dbc = (byte_count - 1) | (1 << 31); + tbl->prdt[0].dbc = (byte_count - 1) | (1U << 31); memcpy(tbl->acmd, packet, 12); uint8_t* cfis = tbl->cfis; diff --git a/source/kernel/C/algorithms/hashing.c b/source/kernel/C/algorithms/hashing.c index fb46ba0..5190ad8 100755 --- a/source/kernel/C/algorithms/hashing.c +++ b/source/kernel/C/algorithms/hashing.c @@ -10,7 +10,7 @@ */ #include -void init_hashing(){ +void init_hashing(void){ string data = "PradoshGame"; int64 hash = hash_string(data); diff --git a/source/kernel/C/cc-asm.c b/source/kernel/C/cc-asm.c index af2b4a3..0db746b 100755 --- a/source/kernel/C/cc-asm.c +++ b/source/kernel/C/cc-asm.c @@ -14,7 +14,7 @@ * @brief Halt and catch fire function. * */ -void hcf() { +void hcf(void) { for (;;) { #if defined (__x86_64__) // info("x86_64: Halt Initalized.", __FILE__); @@ -33,7 +33,7 @@ void hcf() { * @brief Halt and catch fire function but doesn't print any text. * */ -void hcf2() { +void hcf2(void) { for (;;) { #if defined (__x86_64__) asm volatile ("hlt"); @@ -49,7 +49,7 @@ void hcf2() { * @brief The clear interrupts command for all architectures. * */ -void clear_interrupts() { +void clear_interrupts(void) { #if defined(__x86_64__) info("x86_64: Cleared interrupts.", __FILE__); asm volatile ("cli"); @@ -66,7 +66,7 @@ void clear_interrupts() { * @brief The set interrupts command for various architectures. * */ -void set_interrupts() { +void set_interrupts(void) { #if defined(__x86_64__) info("x86_64: Set interrupts.", __FILE__); asm volatile ("sti"); @@ -84,7 +84,7 @@ void set_interrupts() { * @brief It uses while loops instead of assembly's halt. * */ -void high_level_halt(){ +void high_level_halt(void){ while(1){ asm volatile ("pause"); } diff --git a/source/kernel/C/cpuid.c b/source/kernel/C/cpuid.c index 3c9ab96..58860fd 100755 --- a/source/kernel/C/cpuid.c +++ b/source/kernel/C/cpuid.c @@ -10,7 +10,7 @@ * @param where An integer array to store the result, with at least 4 elements. * @return The value of the EAX register after executing CPUID. */ -static inline int cpuid_string(int code, int where[4]) { +int cpuid_string(int code, int where[4]) { #if defined (__x86_64__) __asm__ volatile ("cpuid":"=a"(*where),"=b"(*(where+0)), "=d"(*(where+1)),"=c"(*(where+2)):"a"(code)); @@ -26,7 +26,7 @@ static inline int cpuid_string(int code, int where[4]) { * * @return A constant string representing the CPU type. */ -cstring const cpu_string() { +cstring cpu_string(void) { static char s[16] = "BogusProces!"; cpuid_string(0, (int*)(s)); return s; @@ -44,7 +44,7 @@ cstring const cpu_string() { * @param ecx Pointer to store the value of ECX register. * @param edx Pointer to store the value of EDX register. */ -inline void cpuid(int32 reg, int32 *eax, int32 *ebx, int32 *ecx, int32 *edx) { +void cpuid(int32 reg, int32 *eax, int32 *ebx, int32 *ecx, int32 *edx) { #if defined (__x86_64__) __asm__ volatile("cpuid" : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx) @@ -57,7 +57,7 @@ inline void cpuid(int32 reg, int32 *eax, int32 *ebx, int32 *ecx, int32 *edx) { * * @return The CPU vendor string. */ -cstring get_cpu_vendor() { +cstring get_cpu_vendor(void) { static char vendor[128]; cpuid(0x80000002, (int32 *)(vendor + 0), (int32 *)(vendor + 4), (int32 *)(vendor + 8), (int32 *)(vendor + 12)); cpuid(0x80000003, (int32 *)(vendor + 16), (int32 *)(vendor + 20), (int32 *)(vendor + 24), (int32 *)(vendor + 28)); @@ -69,7 +69,7 @@ cstring get_cpu_vendor() { /** * @brief Print CPU information, including the vendor and CPU string. */ -void print_cpu_info() { +void print_cpu_info(void) { printf("CPU Vendor: %s", get_cpu_vendor()); printf("CPU String: %s", cpu_string()); } @@ -77,7 +77,7 @@ void print_cpu_info() { /** * @brief Retrieve and print L1 cache information. */ -void print_L1_cache_info() { +void print_L1_cache_info(void) { int32 eax, ebx, ecx, edx; cpuid(0x80000006, &eax, &ebx, &ecx, &edx); if ((edx & 0xFF) == 0) { @@ -90,7 +90,7 @@ void print_L1_cache_info() { /** * @brief Retrieve and print L2 cache information. */ -void print_L2_cache_info() { +void print_L2_cache_info(void) { int32 eax, ebx, ecx, edx; cpuid(0x80000006, &eax, &ebx, &ecx, &edx); if ((edx & 0xFF) == 0) { @@ -103,7 +103,7 @@ void print_L2_cache_info() { /** * @brief Retrieve and print L3 cache information. */ -void print_L3_cache_info() { +void print_L3_cache_info(void) { int32 eax, ebx, ecx, edx; cpuid(0x80000006, &eax, &ebx, &ecx, &edx); if ((edx & 0xFF) == 0) { @@ -113,7 +113,7 @@ void print_L3_cache_info() { printf("CPU Line Size: %d B, Assoc. Type: %d; Cache Size: %d KB. (L3 INFO)", edx & 0xff, (edx >> 12) & 0x0F, (edx >> 16) & 0xFFFF); } -bool is_kvm_supported(){ +bool is_kvm_supported(void){ int32 eax, ebx, ecx, edx; // Check if CPUID instruction is supported @@ -123,7 +123,7 @@ bool is_kvm_supported(){ // Check if KVM is supported cpuid(1, &eax, &ebx, &ecx, &edx); - if (ecx & (1 << 31)) { + if (ecx & (1U << 31)) { info("KVM is supported!", __FILE__); return yes; } else { diff --git a/source/kernel/C/debugger.c b/source/kernel/C/debugger.c index 1116055..929c93d 100755 --- a/source/kernel/C/debugger.c +++ b/source/kernel/C/debugger.c @@ -13,11 +13,25 @@ #include #include +static char* debug_uint64_to_hex(uint64_t value) +{ + static char buf[19]; + const char* digits = "0123456789ABCDEF"; + buf[0] = '0'; + buf[1] = 'x'; + for (int i = 0; i < 16; ++i) { + unsigned int shift = (unsigned int)(60 - (i * 4)); + buf[i + 2] = digits[(value >> shift) & 0xFULL]; + } + buf[18] = '\0'; + return buf; +} + /** * @brief If there was possibility for the change in port, we can easily change the E9 Port. * */ -int port = 0xE9; +static const int16 debug_port = 0xE9; /** * @brief Puts a character to the address 0xE9 using x86_64 outb @@ -26,7 +40,7 @@ int port = 0xE9; */ void debug_putc(char c){ #if debugger_mode - outb(port, c); + outb(debug_port, (int8)c); #endif } @@ -72,15 +86,15 @@ void debug_printf(cstring format, ...) switch (*format) { case 'u': - debug_print(uint_to_string(va_arg(argp, size_t))); + debug_print(uint_to_string(va_arg(argp, unsigned int))); break; case 'z': - debug_print(uint64_to_hex(va_arg(argp, size_t))); + debug_print(debug_uint64_to_hex(va_arg(argp, uint64_t))); break; case 'x': - debug_print(hex_to_string(va_arg(argp, size_t), 0)); + debug_print(hex_to_string(va_arg(argp, int), false)); break; case 's': @@ -88,7 +102,7 @@ void debug_printf(cstring format, ...) break; case 'c': - debug_putc(va_arg(argp, char)); + debug_putc((char)va_arg(argp, int)); break; } } else { diff --git a/source/kernel/C/disk/gpt.c b/source/kernel/C/disk/gpt.c index 1f09160..4be7694 100644 --- a/source/kernel/C/disk/gpt.c +++ b/source/kernel/C/disk/gpt.c @@ -13,6 +13,8 @@ #include #include #include +#include +#include int gpt_disks_count = 0; gpt_disk_t gpt_disks[10]; @@ -136,11 +138,11 @@ void parse_gpt_partitions(int portno, struct GPT_PartTableHeader* hdr) { start, end, end - start + 1, - portno, + (int64)portno, bootable, fs_type, part_name, - null, + 0, p->PartitionTypeGUID ); diff --git a/source/kernel/C/disk/mbr.c b/source/kernel/C/disk/mbr.c index a9dfd87..9a70710 100644 --- a/source/kernel/C/disk/mbr.c +++ b/source/kernel/C/disk/mbr.c @@ -13,6 +13,9 @@ #include #include #include +#include +#include +#include mbr_disk_t mbr_disks[10]; int mbr_disks_count = 0; @@ -86,7 +89,7 @@ void parse_mbr_partitions(int8* mbr, int portno){ start, end, count, - portno, + (int64)portno, partitions[i].boot_flag == MBR_PART_BOOTABLE, fs_type, part_name, diff --git a/source/kernel/C/gdt.c b/source/kernel/C/gdt.c index b52ebd4..b24ed69 100644 --- a/source/kernel/C/gdt.c +++ b/source/kernel/C/gdt.c @@ -10,16 +10,17 @@ */ #include #include +#include struct gdt_entry gdt[7]; struct gdt_ptr gdtp; static void gdt_set_entry(int i, uint32_t base, uint32_t limit, uint8_t access, uint8_t gran) { - gdt[i].base_low = base & 0xFFFF; - gdt[i].base_middle = (base >> 16) & 0xFF; - gdt[i].base_high = (base >> 24) & 0xFF; - gdt[i].limit_low = limit & 0xFFFF; - gdt[i].granularity = ((limit >> 16) & 0x0F) | (gran & 0xF0); + gdt[i].base_low = (uint16_t)(base & 0xFFFFU); + gdt[i].base_middle = (uint8_t)((base >> 16) & 0xFFU); + gdt[i].base_high = (uint8_t)((base >> 24) & 0xFFU); + gdt[i].limit_low = (int16)(limit & 0xFFFFU); + gdt[i].granularity = (uint8_t)(((limit >> 16) & 0x0FU) | (gran & 0xF0U)); gdt[i].access = access; } @@ -49,7 +50,7 @@ void setup_gdt(void) { /* TSS Setup */ kernel_tss_init(); - gdtp.limit = sizeof(gdt) - 1; + gdtp.limit = (uint16_t)(sizeof(gdt) - 1U); gdtp.base = (uint64_t)&gdt; /* Load GDT, reload data segments, then reload CS with lretq. */ diff --git a/source/kernel/C/hal.c b/source/kernel/C/hal.c index 19db071..d94b3e7 100755 --- a/source/kernel/C/hal.c +++ b/source/kernel/C/hal.c @@ -1,166 +1,166 @@ -/** - * @file hal.c - * @author Pradosh (pradoshgame@gmail.com) and GAMINGNOOB (https://github.com/GAMINGNOOBdev) - * @brief Hardware Abstraction Layer (HAL) -> Source from GoGX OS - * @version v1.0 - * @date 2022-08-03 - * - * @copyright Copyright Pradosh (c) 2022 - * - */ - -#include -#include - -/** - * @brief Initializes HAL by remapping the PIC interrupts to avoid conflicts - * - */ -deprecated_message("Do not use this! this crashes the OS, this is for a future use.") -void init_hardware_abstraction_layer() { - clear_interrupts(); - - outb(pic1_command, 0x11); - outb(pic2_command, 0x11); - outb(pic1_data, 0x20); - outb(pic2_data, 0x28); - outb(pic1_data, 0x04); - outb(pic2_data, 0x02); - outb(pic1_data, 0x01); - outb(pic2_data, 0x01); - outb(pic1_data, 0x00); - outb(pic2_data, 0x00); - - set_interrupts(); -} - -/** - * @brief Output a byte to the specified I/O port. - * - * This function sends a byte to the specified I/O port using inline assembly. - * - * @param port The 16-bit I/O port number. - * @param value The 8-bit value to be sent to the port. - */ -void outb(int16 port, int8 value){ - #if defined (__x86_64__) - __asm__ volatile ("outb %0, %1" : : "a"(value), "Nd"(port)); - #endif -} - -/** - * @brief Read a byte from the specified I/O port. - * - * This function reads a byte from the specified I/O port using inline assembly. - * - * @param port The 16-bit I/O port number. - * @return The 8-bit value read from the port. - */ -int8 inb(int16 port){ - #if defined (__x86_64__) - int8 returnVal; - __asm__ volatile ("inb %1, %0" : "=a"(returnVal) : "Nd"(port)); - return returnVal; - #endif - - return 0; -} - -/** - * @brief Output a 16-bit value to the specified I/O port. - * - * This function sends a 16-bit value to the specified I/O port using inline assembly. - * - * @param portNumber The 16-bit I/O port number. - * @param data The 16-bit value to be sent to the port. - */ -void outw(int16 portNumber, int16 data) { - #if defined (__x86_64__) - __asm__ volatile("outw %0, %1" : : "a"(data), "Nd"(portNumber)); - #endif -} - -/** - * @brief Perform an I/O wait operation. - * - * This function performs an I/O wait operation using inline assembly. - * It is used to add a small delay in I/O operations. - */ -void io_wait(){ - #if defined (__x86_64__) - __asm__ volatile ("outb %%al, $0x80" : : "a"(0)); - #endif -} - -/** - * @brief Read a 16-bit value from the specified I/O port. - * - * This function reads a 16-bit value from the specified I/O port using inline assembly. - * - * @param portNumber The 16-bit I/O port number. - * @return The 16-bit value read from the port. - */ -int16 inw(int16 portNumber) { - #if defined (__x86_64__) - int16 data; - __asm__ volatile("inw %1, %0" : "=a"(data) : "Nd"(portNumber)); - return data; - #endif - - return 0; -} - -/** - * @brief Read a 32-bit value from the specified I/O port. - * - * This function reads a 32-bit value from the specified I/O port using inline assembly. - * - * @param portNumber The 16-bit I/O port number. - * @return The 32-bit value read from the port. - */ -int32 inl(int16 portNumber) { - #if defined (__x86_64__) - int32 data; - __asm__ volatile("inl %1, %0" : "=a"(data) : "Nd"(portNumber)); - return data; - #endif - - return 0; -} - -/** - * @brief Output a 32-bit value to the specified I/O port. - * - * This function sends a 32-bit value to the specified I/O port using inline assembly. - * - * @param portNumber The 16-bit I/O port number. - * @param data The 32-bit value to be sent to the port. - */ -void outl(int16 portNumber, int32 data) { - #if defined (__x86_64__) - __asm__ volatile("outl %0, %1" : : "a"(data), "Nd"(portNumber)); - #endif -} - -/** - * @brief Wait approximately the given number of microseconds using io_wait() - * - * @param usec Number of microseconds to wait - */ -void io_wait_us(uint32_t usec) -{ - // io_wait() is roughly ~1µs per call on modern CPUs - for (uint32_t i = 0; i < usec; i++) - io_wait(); -} - -/** - * @brief Wait approximately the given number of milliseconds using io_wait() - * - * @param msec Number of milliseconds to wait - */ -void io_wait_ms(uint32_t msec) -{ - for (uint32_t i = 0; i < msec; i++) - io_wait_us(1000); -} \ No newline at end of file +/** + * @file hal.c + * @author Pradosh (pradoshgame@gmail.com) and GAMINGNOOB (https://github.com/GAMINGNOOBdev) + * @brief Hardware Abstraction Layer (HAL) -> Source from GoGX OS + * @version v1.0 + * @date 2022-08-03 + * + * @copyright Copyright Pradosh (c) 2022 + * + */ + +#include +#include + +/** + * @brief Initializes HAL by remapping the PIC interrupts to avoid conflicts + * + */ +deprecated_message("Do not use this! this crashes the OS, this is for a future use.") +void init_hardware_abstraction_layer(void) { + clear_interrupts(); + + outb(pic1_command, 0x11); + outb(pic2_command, 0x11); + outb(pic1_data, 0x20); + outb(pic2_data, 0x28); + outb(pic1_data, 0x04); + outb(pic2_data, 0x02); + outb(pic1_data, 0x01); + outb(pic2_data, 0x01); + outb(pic1_data, 0x00); + outb(pic2_data, 0x00); + + set_interrupts(); +} + +/** + * @brief Output a byte to the specified I/O port. + * + * This function sends a byte to the specified I/O port using inline assembly. + * + * @param port The 16-bit I/O port number. + * @param value The 8-bit value to be sent to the port. + */ +void outb(int16 port, int8 value){ + #if defined (__x86_64__) + __asm__ volatile ("outb %0, %1" : : "a"(value), "Nd"(port)); + #endif +} + +/** + * @brief Read a byte from the specified I/O port. + * + * This function reads a byte from the specified I/O port using inline assembly. + * + * @param port The 16-bit I/O port number. + * @return The 8-bit value read from the port. + */ +int8 inb(int16 port){ + #if defined (__x86_64__) + int8 returnVal; + __asm__ volatile ("inb %1, %0" : "=a"(returnVal) : "Nd"(port)); + return returnVal; + #endif + + return 0; +} + +/** + * @brief Output a 16-bit value to the specified I/O port. + * + * This function sends a 16-bit value to the specified I/O port using inline assembly. + * + * @param portNumber The 16-bit I/O port number. + * @param data The 16-bit value to be sent to the port. + */ +void outw(int16 portNumber, int16 data) { + #if defined (__x86_64__) + __asm__ volatile("outw %0, %1" : : "a"(data), "Nd"(portNumber)); + #endif +} + +/** + * @brief Perform an I/O wait operation. + * + * This function performs an I/O wait operation using inline assembly. + * It is used to add a small delay in I/O operations. + */ +void io_wait(void){ + #if defined (__x86_64__) + __asm__ volatile ("outb %%al, $0x80" : : "a"(0)); + #endif +} + +/** + * @brief Read a 16-bit value from the specified I/O port. + * + * This function reads a 16-bit value from the specified I/O port using inline assembly. + * + * @param portNumber The 16-bit I/O port number. + * @return The 16-bit value read from the port. + */ +int16 inw(int16 portNumber) { + #if defined (__x86_64__) + int16 data; + __asm__ volatile("inw %1, %0" : "=a"(data) : "Nd"(portNumber)); + return data; + #endif + + return 0; +} + +/** + * @brief Read a 32-bit value from the specified I/O port. + * + * This function reads a 32-bit value from the specified I/O port using inline assembly. + * + * @param portNumber The 16-bit I/O port number. + * @return The 32-bit value read from the port. + */ +int32 inl(int16 portNumber) { + #if defined (__x86_64__) + int32 data; + __asm__ volatile("inl %1, %0" : "=a"(data) : "Nd"(portNumber)); + return data; + #endif + + return 0; +} + +/** + * @brief Output a 32-bit value to the specified I/O port. + * + * This function sends a 32-bit value to the specified I/O port using inline assembly. + * + * @param portNumber The 16-bit I/O port number. + * @param data The 32-bit value to be sent to the port. + */ +void outl(int16 portNumber, int32 data) { + #if defined (__x86_64__) + __asm__ volatile("outl %0, %1" : : "a"(data), "Nd"(portNumber)); + #endif +} + +/** + * @brief Wait approximately the given number of microseconds using io_wait() + * + * @param usec Number of microseconds to wait + */ +void io_wait_us(uint32_t usec) +{ + // io_wait() is roughly ~1µs per call on modern CPUs + for (uint32_t i = 0; i < usec; i++) + io_wait(); +} + +/** + * @brief Wait approximately the given number of milliseconds using io_wait() + * + * @param msec Number of milliseconds to wait + */ +void io_wait_ms(uint32_t msec) +{ + for (uint32_t i = 0; i < msec; i++) + io_wait_us(1000); +} diff --git a/source/kernel/C/heap.c b/source/kernel/C/heap.c index 9b49bda..098cc2a 100755 --- a/source/kernel/C/heap.c +++ b/source/kernel/C/heap.c @@ -203,7 +203,7 @@ void* kmalloc_aligned(size_t size, size_t align) return (void*)aligned; } -void mm_print_out() +void mm_print_out(void) { printf("%sMemory used :%s %u KiB", yellow_color, reset_color, memory_used/(1 KiB)); printf("%sMemory free :%s %u KiB", yellow_color, reset_color, (heap_end - last_alloc)/(1 KiB)); diff --git a/source/kernel/C/interrupts/idt.c b/source/kernel/C/interrupts/idt.c index 88cb570..dd2d15f 100755 --- a/source/kernel/C/interrupts/idt.c +++ b/source/kernel/C/interrupts/idt.c @@ -4,9 +4,9 @@ * @brief Interrupt descriptor table code. * @version 0.1 * @date 2025-02-03 - * + * * @copyright Copyright Pradosh (c) 2025 - * + * */ #include @@ -23,13 +23,13 @@ extern void* irq_stub_table[]; IDTEntry idt_entries[256]; -IDTPointer idt_ptr = (IDTPointer) +IDTPointer idt_ptr = (IDTPointer) { (uint16_t)sizeof(idt_entries) - 1, (uintptr_t)&idt_entries[0] }; -void setIdtEntry(IDTEntry *target, uint64_t offset, uint16_t selector, uint8_t ist, uint8_t type_attributes) +void setIdtEntry(IDTEntry *target, uint64_t offset, uint16_t selector, uint8_t ist, uint8_t type_attributes) { target->offset_1 = offset & 0xFFFF; target->selector = selector; @@ -44,7 +44,7 @@ void setIdtEntry(IDTEntry *target, uint64_t offset, uint16_t selector, uint8_t i * @brief Small utility function for remapping the programmable interrupt controller * @author GAMINGNOOBdev */ -void remap_pic() { +void remap_pic(void) { uint8_t read_master, read_slave; read_master = inb(0x21); @@ -66,7 +66,7 @@ void remap_pic() { outb(0xa1, read_slave); } -void init_syscall() +void init_syscall(void) { wrmsr64(IA32_EFER, rdmsr64(IA32_EFER) | EFER_SCE); @@ -79,7 +79,7 @@ void init_syscall() wrmsr64(IA32_FMASK, 0); } -void initIdt() +void initIdt(void) { info("Started initialization!", __FILE__); @@ -91,12 +91,12 @@ void initIdt() registerInterruptHandler(0x31, process_IFL); registerInterruptHandler(0x80, int80_handler); - for (uint8_t i = 0; i < 32; i++) + for (uint8_t i = 0; i < 32; i++) { setIdtEntry(&idt_entries[i], (uint64_t)isr_stub_table[i], 0x08, 0, 0x8E); } - for (uint8_t i = 32; i < 255; i++) + for (uint8_t i = 32; i < 255; i++) { setIdtEntry(&idt_entries[i], (uint64_t)irq_stub_table[i-32], 0x08, 0, 0x8E); } @@ -113,4 +113,4 @@ void initIdt() init_syscall(); done("Successfully initialized!", __FILE__); -} \ No newline at end of file +} diff --git a/source/kernel/C/interrupts/syscalls-x86_64.asm b/source/kernel/C/interrupts/syscalls-x86_64.asm index eccb050..339cd77 100644 --- a/source/kernel/C/interrupts/syscalls-x86_64.asm +++ b/source/kernel/C/interrupts/syscalls-x86_64.asm @@ -81,3 +81,5 @@ syscall_entry: ; Return to user swapgs iretq + +section .note.GNU-stack noalloc noexec nowrite progbits diff --git a/source/kernel/C/kernel.c b/source/kernel/C/kernel.c index 45d3b7f..2656753 100755 --- a/source/kernel/C/kernel.c +++ b/source/kernel/C/kernel.c @@ -264,12 +264,12 @@ void main(void) { // enter_userland_at((uint64_t)entry); } -void shutdown(){ +void shutdown(void){ info("shutdown has been called", __FILE__); acpi_shutdown_hack(hhdm_request.response->offset, acpi_find_sdt); } -void reboot(){ +void reboot(void){ info("reboot has been called", __FILE__); acpi_reboot(hhdm_request.response->offset); } diff --git a/source/kernel/C/math/fpu.c b/source/kernel/C/math/fpu.c index e669670..62572bf 100755 --- a/source/kernel/C/math/fpu.c +++ b/source/kernel/C/math/fpu.c @@ -25,7 +25,7 @@ void set_fpu_cw(const uint16_t cw) { * @brief Enables the Floating point arithmetic unit for x86-64 * */ -void enable_fpu() { +void enable_fpu(void) { info("Enabling floating-point arithmetic unit!", __FILE__); size_t cr4; asm volatile ("mov %%cr4, %0" : "=r"(cr4)); diff --git a/source/kernel/C/memory.c b/source/kernel/C/memory.c index 3ebb097..5cefa38 100755 --- a/source/kernel/C/memory.c +++ b/source/kernel/C/memory.c @@ -83,7 +83,7 @@ void memory_dump(const void* start, const void* end) { } } -void registers_dump(){ +void registers_dump(void){ unsigned long long rax_value, rbx_value, rcx_value, rdx_value, rsi_value, rdi_value, rbp_value, rsp_value, r8_value, r9_value, r10_value, r11_value, r12_value, r13_value, r14_value, r15_value; @@ -222,7 +222,7 @@ void analyze_memory_map(struct memory_context* memory, struct limine_memmap_requ } } -uint64_t getCR2() +uint64_t getCR2(void) { uint64_t val; __asm__ volatile ( "mov %%cr2, %0" : "=r"(val) ); diff --git a/source/kernel/C/nvme.c b/source/kernel/C/nvme.c index 2824083..5439f4d 100644 --- a/source/kernel/C/nvme.c +++ b/source/kernel/C/nvme.c @@ -10,6 +10,9 @@ #include #include #include +#include +#include +#include #define NVME_CC_EN (1U << 0) #define NVME_CC_CSS_NVM (0U << 4) @@ -32,13 +35,13 @@ int nvme_namespace_count = 0; static inline volatile uint32_t* nvme_sq_doorbell(nvme_controller_t* ctrl, uint16_t qid) { - uintptr_t base = (uintptr_t)ctrl->regs + 0x1000 + (2 * qid) * ctrl->doorbell_stride; + uintptr_t base = (uintptr_t)ctrl->regs + 0x1000 + (uint32_t)(2U * (uint32_t)qid) * ctrl->doorbell_stride; return (volatile uint32_t*)base; } static inline volatile uint32_t* nvme_cq_doorbell(nvme_controller_t* ctrl, uint16_t qid) { - uintptr_t base = (uintptr_t)ctrl->regs + 0x1000 + (2 * qid + 1) * ctrl->doorbell_stride; + uintptr_t base = (uintptr_t)ctrl->regs + 0x1000 + (uint32_t)((2U * (uint32_t)qid) + 1U) * ctrl->doorbell_stride; return (volatile uint32_t*)base; } @@ -60,7 +63,7 @@ static int nvme_submit_and_wait(nvme_controller_t* ctrl, nvme_queue_t* q, nvme_c cmd->cid = cid; q->sq[q->sq_tail] = *cmd; - q->sq_tail = (q->sq_tail + 1) % q->depth; + q->sq_tail = (uint16_t)((q->sq_tail + 1U) % q->depth); *nvme_sq_doorbell(ctrl, q->qid) = q->sq_tail; for (int spin = 0; spin < 1000000; spin++) { @@ -113,7 +116,7 @@ static int nvme_create_io_queues(nvme_controller_t* ctrl) memset(&cmd, 0, sizeof(cmd)); cmd.opcode = NVME_ADMIN_OP_CREATE_IO_CQ; cmd.prp1 = (uint64_t)(uintptr_t)ctrl->ioq.cq; - cmd.cdw10 = ((ctrl->ioq.depth - 1) << 16) | ctrl->ioq.qid; + cmd.cdw10 = (((uint32_t)ctrl->ioq.depth - 1U) << 16) | (uint32_t)ctrl->ioq.qid; cmd.cdw11 = 0x1; // phase = 1 if (nvme_submit_and_wait(ctrl, &ctrl->adminq, &cmd) != 0) return -3; @@ -122,8 +125,8 @@ static int nvme_create_io_queues(nvme_controller_t* ctrl) memset(&cmd, 0, sizeof(cmd)); cmd.opcode = NVME_ADMIN_OP_CREATE_IO_SQ; cmd.prp1 = (uint64_t)(uintptr_t)ctrl->ioq.sq; - cmd.cdw10 = ((ctrl->ioq.depth - 1) << 16) | ctrl->ioq.qid; - cmd.cdw11 = (ctrl->ioq.qid << 16) | 0x1; // CQID + PC=1 + cmd.cdw10 = (((uint32_t)ctrl->ioq.depth - 1U) << 16) | (uint32_t)ctrl->ioq.qid; + cmd.cdw11 = ((uint32_t)ctrl->ioq.qid << 16) | 0x1U; // CQID + PC=1 if (nvme_submit_and_wait(ctrl, &ctrl->adminq, &cmd) != 0) return -4; @@ -169,7 +172,7 @@ static int nvme_init_controller(nvme_controller_t* ctrl) ctrl->adminq.cq_head = 0; ctrl->adminq.phase = 1; - ctrl->regs->aqa = ((ctrl->adminq.depth - 1) << 16) | (ctrl->adminq.depth - 1); + ctrl->regs->aqa = (((uint32_t)ctrl->adminq.depth - 1U) << 16) | ((uint32_t)ctrl->adminq.depth - 1U); ctrl->regs->asq = (uint64_t)(uintptr_t)ctrl->adminq.sq; ctrl->regs->acq = (uint64_t)(uintptr_t)ctrl->adminq.cq; @@ -241,7 +244,7 @@ static int nvme_read_write_one(nvme_namespace_t* ns, uint64_t lba, void* buffer, memset(&cmd, 0, sizeof(cmd)); cmd.opcode = is_write ? NVME_NVM_OP_WRITE : NVME_NVM_OP_READ; cmd.nsid = ns->nsid; - cmd.prp1 = fast_virt_to_phys((uint64_t)io_buffer); + cmd.prp1 = fast_virt_to_phys(io_buffer); cmd.cdw10 = (uint32_t)lba; cmd.cdw11 = (uint32_t)(lba >> 32); cmd.cdw12 = 0; @@ -330,7 +333,7 @@ void probe_nvme(uint8_t bus, uint8_t slot, uint8_t function) command |= 0x00000006U; /* bus master + memory space */ pci_config_write_dword(bus, slot, function, 0x04, command); - uint64_t bar = (uint32_t)(pci_config_read_dword(bus, slot, function, 0x10) & ~0xF); + uint64_t bar = (uint32_t)(pci_config_read_dword(bus, slot, function, 0x10) & ~0xFU); uint32_t upper = pci_config_read_dword(bus, slot, function, 0x14); if (upper && upper != 0xFFFFFFFFU) bar |= ((uint64_t)upper << 32); @@ -342,7 +345,7 @@ void probe_nvme(uint8_t bus, uint8_t slot, uint8_t function) memset(ctrl, 0, sizeof(*ctrl)); ctrl->regs = (nvme_regs_t*)(uintptr_t)bar; - ctrl->controller_id = i; + ctrl->controller_id = (uint32_t)i; if (nvme_init_controller(ctrl) != 0) { printf("[NVMe] init failure: CAP=0x%X:%X CC=0x%X CSTS=0x%X", diff --git a/source/kernel/C/opengl/glcontext.c b/source/kernel/C/opengl/glcontext.c index 251a0e3..9ae1ac7 100755 --- a/source/kernel/C/opengl/glcontext.c +++ b/source/kernel/C/opengl/glcontext.c @@ -5,7 +5,7 @@ struct GLContext g_gl_context; extern struct limine_framebuffer *framebuffer; -struct GLContext* glCreateContext() +struct GLContext* glCreateContext(void) { if (g_gl_context.Initialized) return &g_gl_context; @@ -31,13 +31,13 @@ struct GLContext* glCreateContextCustom(uint32_t* buffer, uint32_t width, uint32 return &g_gl_context; } -struct GLContext* glGetCurrentContext() +struct GLContext* glGetCurrentContext(void) { if (g_gl_context.Initialized) return &g_gl_context; } -bool glContextInitialized() +bool glContextInitialized(void) { return g_gl_context.Initialized && g_gl_context.ColorBuffer != NULL; } diff --git a/source/kernel/C/paging.c b/source/kernel/C/paging.c index 2f431b2..5f62d5c 100755 --- a/source/kernel/C/paging.c +++ b/source/kernel/C/paging.c @@ -30,7 +30,7 @@ static inline uint64_t *phys_to_virt_ptr(uint64_t phys_addr) { return (uint64_t *)(phys_addr + hhdm_offset); } -uintptr_t allocate_page() { +uintptr_t allocate_page(void) { if(!memmap){ error("Limine failed to give the memory map", __FILE__); hcf2(); @@ -58,7 +58,7 @@ uintptr_t allocate_pages(size_t count) { return base; } -static inline uint64_t get_kernel_pml4() { +static inline uint64_t get_kernel_pml4(void) { uint64_t cr3; asm volatile("mov %%cr3, %0" : "=r"(cr3)); return cr3; diff --git a/source/kernel/C/pci.c b/source/kernel/C/pci.c index 370fd95..56a43fa 100755 --- a/source/kernel/C/pci.c +++ b/source/kernel/C/pci.c @@ -161,7 +161,7 @@ pci_location_t pciLocations[MAX_PCI_DEVICES]; * @brief Scans (Probes) PCI Devices * */ -void probe_pci(){ +void probe_pci(void){ info("Probe has been started!", __FILE__); int i = 0; for(int32 bus = 0; bus < 256; bus++) @@ -251,7 +251,7 @@ void probe_pci(){ printf("Display Adapter : %s", display_adapter_name); } -void print_lspci() { +void print_lspci(void) { for (int i = 0; i < total_devices; i++) { printf("%02d:%2x.%d " yellow_color "%s " green_color "%s " red_color "%s" reset_color " (rev %02x)", pciLocations[i].bus, diff --git a/source/kernel/C/pit.c b/source/kernel/C/pit.c index aeca0b9..d20ec07 100755 --- a/source/kernel/C/pit.c +++ b/source/kernel/C/pit.c @@ -21,7 +21,7 @@ void process_pit(InterruptFrame* frame) { outb(0x20, 0x20); // Notify the PIC that we've handled the interrupt } -void init_pit() { +void init_pit(void) { uint32_t divisor = 1193180 / pit_freq; // PIT operates at 1193180 Hz outb(0x43, 0x36); // Command byte: Channel 0, lobyte/hibyte, mode 3 (square wave generator) diff --git a/source/kernel/C/rtc.c b/source/kernel/C/rtc.c index 010f721..e013130 100755 --- a/source/kernel/C/rtc.c +++ b/source/kernel/C/rtc.c @@ -22,7 +22,7 @@ int8 read_rtc_register(int8 reg) { } // Wait until RTC is not updating -void wait_rtc_update() { +void wait_rtc_update(void) { while (read_rtc_register(0x0A) & 0x80); } @@ -36,7 +36,7 @@ int8 rtc_read_stable(int8 reg) { return val; } -void init_rtc() { +void init_rtc(void) { info("Initializing RTC", __FILE__); // Enable periodic interrupts if desired, not strictly necessary int8 prev = read_rtc_register(0x0B); @@ -83,7 +83,7 @@ void update_system_time(int8 *second, int8 *minute, int8 *hour, int8 *day, int8 *year = yr; } -void display_time() { +void display_time(void) { int8 sec, min, hr, day, mon; int16 yr; update_system_time(&sec, &min, &hr, &day, &mon, &yr); diff --git a/source/kernel/C/shell/commands/fwfetch.c b/source/kernel/C/shell/commands/fwfetch.c index 327a1ec..bd77a1b 100644 --- a/source/kernel/C/shell/commands/fwfetch.c +++ b/source/kernel/C/shell/commands/fwfetch.c @@ -13,7 +13,7 @@ #include #include -void fwfetch(){ +void fwfetch(void){ print(blue_color); printf("OS : %s", OS_NAME); printf("CPU : %s", get_cpu_vendor()); diff --git a/source/kernel/C/shell/sh.c b/source/kernel/C/shell/sh.c index 31864cc..29ba4e6 100644 --- a/source/kernel/C/shell/sh.c +++ b/source/kernel/C/shell/sh.c @@ -86,7 +86,7 @@ void push_command_to_list(command_list* lst, const char* value, size_t length) bool running = true; -void welcome_message(){ +void welcome_message(void){ printf(blue_color " ______ _ _ _____ _ _ _ "); printf(blue_color "| ____| | | | |/ ____| | | | |"); printf(blue_color "| |__ _ __ ___ ___| |_ ___ __| | (___ | |__ ___| | |"); @@ -111,7 +111,7 @@ void welcome_message(){ extern int64* wm_addr; -void start_window_manager(){ +void start_window_manager(void){ void* file_addr = wm_addr; fdlfcn_handle* handle = fdlopen(file_addr, FDL_IMMEDIATE); int(*startfunction)(void); @@ -153,7 +153,7 @@ int show_prompt(int argc, char** argv){ return 0; } -void ksh_exec(){ +void ksh_exec(void){ int failed_attempts = 0; while(true){ diff --git a/source/kernel/C/sse.c b/source/kernel/C/sse.c index 094e6e1..fcb26dd 100755 --- a/source/kernel/C/sse.c +++ b/source/kernel/C/sse.c @@ -18,7 +18,7 @@ char fxsave_region[512] __attribute__((aligned(16))); * @brief Loads the SEE fully with fxsave * */ -void load_complete_sse(){ +void load_complete_sse(void){ #if defined (__x86_64__) asm volatile ( "mov %%cr0, %%rax\n" @@ -41,7 +41,7 @@ void load_complete_sse(){ * @brief Checks if CPU is compatible with SSE * */ -void check_sse(){ +void check_sse(void){ #if defined (__x86_64__) int eax = 0x1; int ebx, ecx, edx; diff --git a/source/kernel/C/tss.c b/source/kernel/C/tss.c index 6370623..bbda22d 100644 --- a/source/kernel/C/tss.c +++ b/source/kernel/C/tss.c @@ -31,22 +31,22 @@ void kernel_tss_init(void) { struct tss_descriptor *desc = (struct tss_descriptor *)&gdt[5]; uint64_t base = (uint64_t)&tss; - uint32_t limit = sizeof(struct tss_entry) - 1; + uint32_t limit = (uint32_t)(sizeof(struct tss_entry) - 1U); - desc->limit_low = limit & 0xFFFF; - desc->base_low = base & 0xFFFF; - desc->base_mid = (base >> 16) & 0xFF; + desc->limit_low = (uint16_t)(limit & 0xFFFFU); + desc->base_low = (uint16_t)(base & 0xFFFFU); + desc->base_mid = (uint8_t)((base >> 16) & 0xFFU); desc->access = 0x89; // Present | Type=9 (available TSS) - desc->gran = (limit >> 16) & 0x0F; - desc->base_high = (base >> 24) & 0xFF; - desc->base_upper = (base >> 32); + desc->gran = (uint8_t)((limit >> 16) & 0x0FU); + desc->base_high = (uint8_t)((base >> 24) & 0xFFU); + desc->base_upper = (uint32_t)(base >> 32); desc->reserved = 0; done("TSS is ready, yet to be deployed", __FILE__); } // Load TSS using ltr instruction -void tss_load() { +void tss_load(void) { asm volatile("ltr %0" :: "r"((int16)0x28)); done("Done loading TSS", __FILE__); } diff --git a/source/kernel/C/user-input/keyboard.c b/source/kernel/C/user-input/keyboard.c index 0a5c6b3..1fe4d63 100755 --- a/source/kernel/C/user-input/keyboard.c +++ b/source/kernel/C/user-input/keyboard.c @@ -67,7 +67,7 @@ char scancode_to_char(int scancode, bool uppercase) { return '\0'; } -void keyboard_init() { +void keyboard_init(void) { rb_init(&kb_rb, kb_storage, KB_BUFFER_SIZE, sizeof(uint8_t)); } @@ -92,13 +92,13 @@ void process_keyboard(InterruptFrame* frame) outb(0x20, 0x20); } -uint8_t getmodifiers() +uint8_t getmodifiers(void) { return modifiers; } extern volatile int pit_ticks; -uint8_t getc() +uint8_t getc(void) { uint8_t sc; static uint64_t last_tick = 0; @@ -117,7 +117,7 @@ uint8_t getc() } } -int getc_nonblock() { +int getc_nonblock(void) { uint8_t sc; if (rb_pop(&kb_rb, &sc) == 0) { diff --git a/source/kernel/C/user-input/ps2-mouse.c b/source/kernel/C/user-input/ps2-mouse.c index fdb3546..cf79076 100755 --- a/source/kernel/C/user-input/ps2-mouse.c +++ b/source/kernel/C/user-input/ps2-mouse.c @@ -11,7 +11,7 @@ extern int64 fb_width; extern int64 fb_height; -void ps2_mouse_wait(){ +void ps2_mouse_wait(void){ int64 timeout = 100000; while (timeout--){ if ((inb(0x64) & 0b10) == 0){ @@ -20,7 +20,7 @@ void ps2_mouse_wait(){ } } -void ps2_mouse_wait_input(){ +void ps2_mouse_wait_input(void){ int64 timeout = 100000; while (timeout--){ if (inb(0x64) & 0b1){ @@ -36,7 +36,7 @@ void ps2_mouse_write(int8 value){ outb(0x60, value); } -int8 ps2_mouse_read(){ +int8 ps2_mouse_read(void){ ps2_mouse_wait_input(); return inb(0x60); } @@ -113,17 +113,17 @@ void SetMouseButtonHandler(MouseButtonHandler handler) mButtonHandler = handler; } -ivec2 GetMousePosition() +ivec2 GetMousePosition(void) { return current_mouse_position; } -ivec2 GetLastMousePosition() +ivec2 GetLastMousePosition(void) { return previous_mouse_position; } -void process_mouse_packet(){ +void process_mouse_packet(void){ if (!isMousePacketReady) return; @@ -213,7 +213,7 @@ void handle_click(int64 type, ivec2 position){ } } -void init_ps2_mouse(){ +void init_ps2_mouse(void){ outb(0x64, 0xA8); //enabling the auxiliary device - mouse ps2_mouse_wait();