diff --git a/ProjectTree b/ProjectTree index ec950f0..cd1f48c 100644 --- a/ProjectTree +++ b/ProjectTree @@ -152,8 +152,9 @@ │   │   ├── strtol.d │   │   └── strtol.o │   ├── grub.log -│   ├── kernel.ld -│   └── qemu.log +│   ├── kaleid32_disasm.asm +│   ├── kaleid64_disasm.asm +│   └── kernel.ld ├── include │   ├── base │   │   ├── assert.h @@ -258,4 +259,4 @@ ├── ProjectTree └── README.md -41 directories, 192 files +41 directories, 193 files diff --git a/boot/loader/mem/structures.inc b/boot/loader/mem/structures.inc index 55ed82c..76f85fa 100644 --- a/boot/loader/mem/structures.inc +++ b/boot/loader/mem/structures.inc @@ -25,6 +25,7 @@ [BITS 32] extern kernelEnd +extern _bss global newKernelEnd global realKernelEnd @@ -32,6 +33,7 @@ global realKernelEnd KERNEL_STACK equ kernelEnd + 4096 * 2 * 1024 ; 8MB of stack newKernelEnd dq 0x0 realKernelEnd dq 0x0 + [section .rodata] ;; GDT WITH DOC ALIGN 4096 @@ -52,7 +54,7 @@ GDT64: dq GDT64 -;; EMPTY PAGE TABLES (identity of the first 1GiB) +;; EMPTY PAGE TABLES (identity of the first 4GiB) [section .bss] ALIGN 4096 PML4_table: diff --git a/build/kernel.ld b/build/kernel.ld index 7500a25..90bd5b7 100644 --- a/build/kernel.ld +++ b/build/kernel.ld @@ -29,14 +29,14 @@ ENTRY(MB_start) /* the name of the entry label */ SECTIONS { . = 0x00100000; /* the code should be loaded at 1 MB */ - .boot ALIGN (0x1000) : /* align at 4 KB */ + .boot ALIGN (0x1000) : { - *(.multiboot) + *(.multiboot) } - .text ALIGN (0x1000) : /* align at 4 KB */ + .text ALIGN (0x1000) : { - *(.text) /* all text sections from all files */ + *(.text) } .data ALIGN (0x1000) : @@ -51,19 +51,19 @@ SECTIONS { *(.eh_frame) } - .bss ALIGN (0x1000) : /* align at 4 KB */ + .rodata ALIGN (0x1000) : { - *(.bss) /* all bss sections from all files */ + *(.rodata) } - .rodata ALIGN (0x1000) : /* align at 4 KB */ + .bss ALIGN (0x1000) : { - *(.rodata) /* all rodata sections from all files */ + *(.bss) } /DISCARD/ : { - *(.comment) + *(.comment) } kernelEnd = .;