From 50e3017c5c4614790b1ff9271cc46c05cf2a121e Mon Sep 17 00:00:00 2001 From: Paul Mathieu Date: Mon, 29 Sep 2025 17:45:21 +0200 Subject: [PATCH] Use linker script to add boot sector magic --- Makefile | 3 --- bootsect.ld | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 40d047e..eb21e32 100644 --- a/Makefile +++ b/Makefile @@ -23,11 +23,8 @@ LDFLAGS = -mregparmcall -Wl,--gc-sections -Os -nostdlib -flto ia16-elf-objcopy -O binary $< $@ bootsectors = fat12boot.bin wozmon.bin - $(bootsectors): ia16-elf-objcopy -O binary $< $@ - truncate -s 510 $@ - printf "\125\252" >> $@ fat12boot.elf: fat12boot.o fat12.o bootsect.S fat12boot.elf: LDFLAGS += -T bootsect.ld diff --git a/bootsect.ld b/bootsect.ld index d9546fd..a215f64 100644 --- a/bootsect.ld +++ b/bootsect.ld @@ -17,4 +17,9 @@ SECTIONS { .data : { *(.data) } + + . = 0x7dfe; + .magic : { + SHORT(0xAA55); + } }