From f8221e81b9752548d26675111cffca1947c46b68 Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Sat, 21 Dec 2024 22:01:56 +0100 Subject: x86: add small mbr example --- src/arch/x86/mbr/mbr.ld | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/arch/x86/mbr/mbr.ld (limited to 'src/arch/x86/mbr/mbr.ld') diff --git a/src/arch/x86/mbr/mbr.ld b/src/arch/x86/mbr/mbr.ld new file mode 100644 index 0000000..46d8a14 --- /dev/null +++ b/src/arch/x86/mbr/mbr.ld @@ -0,0 +1,11 @@ +OUTPUT_FORMAT(elf32-i386) +OUTPUT_ARCH(i386) + +SECTIONS { + . = 0x7c00; + .boot : { *(.boot) } + _boot_end = .; + /DISCARD/ : { *(.*) } + + ASSERT(_boot_end - 0x7c00 == 512, "boot sector must be exact 512 bytes") +} -- cgit v1.2.3