From d8392002629bc97c05ca82961c7ab3439ed7248e Mon Sep 17 00:00:00 2001 From: Carlos Maiolino Date: Thu, 17 Jul 2025 19:20:28 +0200 Subject: Start writing the kernel and add a linker script Move the code unders [BITS 32] label to its own file to be loaded as a kernel by the boot loader. Add a linker script to link the bootloader and the kernel in a single binary file. Add a build script to make it easier to use the cross compiler Update the Makefile to build everything and pack it into the os.bin Signed-off-by: Carlos Maiolino --- src/linker.ld | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/linker.ld (limited to 'src/linker.ld') diff --git a/src/linker.ld b/src/linker.ld new file mode 100644 index 0000000..9ea0171 --- /dev/null +++ b/src/linker.ld @@ -0,0 +1,27 @@ +ENTRY(_start) +OUTPUT_FORMAT(binary) + +SECTIONS { + . = 1M; + + .text : + { + *(.text) + } + + .rodata : + { + *(.rodata) + } + + .data : + { + *(.data) + } + + .bss : + { + *(COMMON) + *(.bss) + } +} -- cgit v1.2.3