diff options
| author | Carlos Maiolino <[email protected]> | 2025-07-20 13:53:24 +0200 |
|---|---|---|
| committer | Carlos Maiolino <[email protected]> | 2025-07-20 13:53:24 +0200 |
| commit | 49776b17697afb8f9b4f7c5689d16a44633aed48 (patch) | |
| tree | ad480cf7960f9ccd648493052cfac34bf09ca5df /src | |
| parent | 636230619806eaefd1ada0183a011c7d05bf7aca (diff) | |
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 <[email protected]>
Diffstat (limited to 'src')
| -rw-r--r-- | src/kernel.asm | 2 | ||||
| -rw-r--r-- | src/linker.ld | 13 |
2 files changed, 11 insertions, 4 deletions
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) + } } |
