From 49776b17697afb8f9b4f7c5689d16a44633aed48 Mon Sep 17 00:00:00 2001 From: Carlos Maiolino Date: Sun, 20 Jul 2025 13:53:24 +0200 Subject: Force alignment of kerne code. It should be aligned to 16-bits IIRC, forcing the kernel.asm to be alined to a 512 byte boundary should suffice Signed-off-by: Carlos Maiolino --- src/kernel.asm | 2 ++ src/linker.ld | 13 +++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/kernel.asm b/src/kernel.asm index 93afff7..6d2779a 100644 --- a/src/kernel.asm +++ b/src/kernel.asm @@ -25,3 +25,5 @@ _start: jmp $ +; Hack to align the source code at 16bytes (because 512 is a multiple of 16) +times 512 - ($ - $$) db 0 diff --git a/src/linker.ld b/src/linker.ld index 9ea0171..2e208af 100644 --- a/src/linker.ld +++ b/src/linker.ld @@ -4,24 +4,29 @@ OUTPUT_FORMAT(binary) SECTIONS { . = 1M; - .text : + .text : ALIGN(4096) { *(.text) } - .rodata : + .rodata : ALIGN(4096) { *(.rodata) } - .data : + .data : ALIGN(4096) { *(.data) } - .bss : + .bss : ALIGN(4096) { *(COMMON) *(.bss) } + + .asm : ALIGN(4096) + { + *(.asm) + } } -- cgit v1.2.3