diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 1a103e8..b9473a4 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -4,14 +4,25 @@ { "name": "kernel", "defines": [ - "DEBUG" + "DEBUG", + "true=1", // https://github.com/microsoft/vscode-cpptools/issues/10696 + "false=0" // https://github.com/microsoft/vscode-cpptools/issues/10696 ], "includePath": [ "src/lib" ], "intelliSenseMode": "linux-gcc-x64", "compilerPath": "/usr/bin/x86_64-elf-gcc", - "cStandard": "c23" + "cStandard": "c23", + "compilerArgs": [ + "-m64", + "-ffreestanding", + "-nostdinc", + "-nostdlib", + "-Wall", + "-Wextra", + "-Wshadow" + ] } ] } \ No newline at end of file diff --git a/linker.ld b/linker.ld index ae37e27..1c416ea 100644 --- a/linker.ld +++ b/linker.ld @@ -3,29 +3,28 @@ ENTRY(_start) SECTIONS { . = 2M; - kernel_start = .; - .text BLOCK(4K) : ALIGN(4K) + .text : { *(.multiboot) *(.text) } - .rodata BLOCK(4K) : ALIGN(4K) + .rodata : { *(.rodata) } - .data BLOCK(4K) : ALIGN(4K) + .data : { *(.data) } - .bss BLOCK(4K) : ALIGN(4K) + .bss : { *(COMMON) *(.bss) } kernel_end = .; -} +} \ No newline at end of file diff --git a/makefile b/makefile index 000c568..27634e3 100644 --- a/makefile +++ b/makefile @@ -8,7 +8,7 @@ LDFLAGS = -g ASFLAGS = -g -F dwarf # Do not modify -CFLAGS += -m64 -ffreestanding -nostdinc -nostdlib -fno-builtin -Wall -Wextra -Wshadow -std=c23 -I src/lib +CFLAGS += -m64 -ffreestanding -nostdinc -nostdlib -Wall -Wextra -Wshadow -std=c23 -I src/lib LDFLAGS += ASFLAGS += -f elf64