Use linker script to add boot sector magic
This commit is contained in:
3
Makefile
3
Makefile
@@ -23,11 +23,8 @@ LDFLAGS = -mregparmcall -Wl,--gc-sections -Os -nostdlib -flto
|
|||||||
ia16-elf-objcopy -O binary $< $@
|
ia16-elf-objcopy -O binary $< $@
|
||||||
|
|
||||||
bootsectors = fat12boot.bin wozmon.bin
|
bootsectors = fat12boot.bin wozmon.bin
|
||||||
|
|
||||||
$(bootsectors):
|
$(bootsectors):
|
||||||
ia16-elf-objcopy -O binary $< $@
|
ia16-elf-objcopy -O binary $< $@
|
||||||
truncate -s 510 $@
|
|
||||||
printf "\125\252" >> $@
|
|
||||||
|
|
||||||
fat12boot.elf: fat12boot.o fat12.o bootsect.S
|
fat12boot.elf: fat12boot.o fat12.o bootsect.S
|
||||||
fat12boot.elf: LDFLAGS += -T bootsect.ld
|
fat12boot.elf: LDFLAGS += -T bootsect.ld
|
||||||
|
@@ -17,4 +17,9 @@ SECTIONS {
|
|||||||
.data : {
|
.data : {
|
||||||
*(.data)
|
*(.data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
. = 0x7dfe;
|
||||||
|
.magic : {
|
||||||
|
SHORT(0xAA55);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user