diff --git a/platform/x86/asm/start32.s b/platform/x86/asm/start32.s index f9deaec..89acf87 100644 --- a/platform/x86/asm/start32.s +++ b/platform/x86/asm/start32.s @@ -395,7 +395,7 @@ boot_pt1_table: resb 4096 ; reserve 4KB for a page table aka level 1 page table boot_stack_bottom: - resb 4096 + resb 2 * 4096 ; reserve 2 x 4KB pages for the stack boot_stack_top: ; stash a pointer to the boot PML4 table diff --git a/platform/x86/asm/start64.s b/platform/x86/asm/start64.s index cbe1c34..f4b9b6d 100644 --- a/platform/x86/asm/start64.s +++ b/platform/x86/asm/start64.s @@ -111,7 +111,7 @@ tidy_boot_pg_tables: shr rax, 12 and rax, 0x3ff ; turn start address into table index mov rbx, __kernel_ro_end - shr rax, 12 + shr rbx, 12 and rbx, 0x3ff ; turn end address into table index mov rcx, __kernel_ro_start ; this should be page aligned @@ -128,7 +128,7 @@ tidy_boot_pg_tables: shr rax, 12 and rax, 0x3ff ; turn start address into table index mov rbx, __kernel_rw_end - shr rax, 12 + shr rbx, 12 and rbx, 0x3ff ; turn end address into table index mov rcx, __kernel_rw_start ; this should be page aligned diff --git a/platform/x86/linker.ld b/platform/x86/linker.ld index e1fe414..b841038 100644 --- a/platform/x86/linker.ld +++ b/platform/x86/linker.ld @@ -19,7 +19,7 @@ SECTIONS { __kernel_ro_start = ALIGN(0x1000); KEEP(*(.multiboot_head)) /* keep our multiboot header at the start */ - *(.text) + *(.text*) *(.rodata*) __kernel_ro_end = ALIGN(0x1000); }