The main output file is now called out/bios.bin (instead of out/rom.bin).
Use ld to build final elf file and call the result out/bios.bin.elf
Make sure to long jump from external 32bit entry point.
CFLAGS16 = $(CFLAGS16INC) -g
TABLETMP=$(addprefix $(OUT), $(patsubst %.c,%.16.s,$(TABLESRC)))
-all: $(OUT) $(OUT)rom.bin $(TABLETMP)
+all: $(OUT) $(OUT)bios.bin $(TABLETMP)
# Run with "make V=1" to see the actual compile commands
ifdef V
@echo " Linking $@"
$(Q)ld -T $(OUT)rombios32.lds $< -o $@
-$(OUT)rom.bin: $(OUT)rom16.bin $(OUT)rom32.bin $(OUT)rom16.offset.auto.h $(OUT)rom32.offset.auto.h
+$(OUT)bios.bin: $(OUT)rom16.bin $(OUT)rom32.bin $(OUT)rom16.offset.auto.h $(OUT)rom32.offset.auto.h
@echo " Building $@"
$(Q)./tools/buildrom.py
compiled using standard gnu tools (eg, gas and gcc).
To build, one should be able to run "make" in the main directory. The
-resulting file "out/rom.bin" contains the processed bios image.
+resulting file "out/bios.bin" contains the processed bios image.
The build requires gcc v4.1 or later. Some buggy versions of gcc have
issues with the '-combine' compiler option - in particular, recent
To test the bios under bochs, one will need to instruct bochs to use
the new bios image. Use the 'romimage' option - for example:
-bochs -q 'floppya: 1_44=myfdimage.img' 'romimage: file=out/rom.bin'
+bochs -q 'floppya: 1_44=myfdimage.img' 'romimage: file=out/bios.bin'
To test under qemu, one will need to create a directory with all the
bios images and then overwrite the main bios image. For example:
cp /usr/share/qemu/*.bin mybiosdir/
-cp out/rom.bin mybiosdir/bios.bin
+cp out/bios.bin mybiosdir/
Once this is setup, one can instruct qemu to use the newly created
directory for rom images. For example:
"lidtl " __stringify(0xf0000 | OFFSET_pmode_IDT_info) "\n"
"lgdtl " __stringify(0xf0000 | OFFSET_rombios32_gdt_48) "\n"
"movl $" __stringify(CONFIG_STACK_OFFSET) ", %esp\n"
- "jmp _start\n"
+ "ljmp $0x10, $_start\n"
);
ROM32='out/rom32.bin'
OFFSETS16='out/rom16.offset.auto.h'
OFFSETS32='out/rom32.offset.auto.h'
-OUT='out/rom.bin'
+OUT='out/bios.bin'
def align(v, a):
return (v + a - 1) // a * a
# Build elf file with 32bit entry point
os.system(
- "objcopy -I binary -O elf32-i386 -B i386"
- " --change-addresses 0xf0000 --set-start %s %s %s" %(
- int(o32['OFFSET_post32'], 16) - 0xf0000, OUT, OUT+".o"))
+ "ld -melf_i386 -e %s -Ttext 0xf0000 -b binary %s -o %s" % (
+ int(o32['OFFSET_post32'], 16), OUT, OUT+".elf"))
if __name__ == '__main__':
main()