Diff markup
001 OBJCOPY=objcopy 001 OBJCOPY=objcopy
002 002
003 all: sos_qemu.img 003 all: sos_qemu.img
004 004
005 -include ../.mkvars 005 -include ../.mkvars
006 006
007 # The image is the simple concatenation of the 007 # The image is the simple concatenation of the boot sector and the kernel
008 # It may be use in bochs or on a real floppy, 008 # It may be use in bochs or on a real floppy, but NOT in qemu (see below)
009 sos_bsect.img: bsect.bin sos.bin 009 sos_bsect.img: bsect.bin sos.bin
010 cat $^ > $@ 010 cat $^ > $@
011 @echo "[31mYou can use the $@ image i 011 @echo "[31mYou can use the $@ image in bochs or on a real floppy (NOT qemu)[m"
012 012
013 013
014 014
015 015
016 sos_qemu.img: sos_bsect.img 016 sos_qemu.img: sos_bsect.img
017 017
018 cat $< /dev/zero | dd of=$@ bs=1k coun 018 cat $< /dev/zero | dd of=$@ bs=1k count=1440
019 @echo "[31mYou can use the $@ image i 019 @echo "[31mYou can use the $@ image in qemu, bochs, or on a real floppy[m"
020 020
021 021
022 bsect.bin: sos_bsect.elf 022 bsect.bin: sos_bsect.elf
023 $(OBJCOPY) -v -O binary -j .bootsect $ 023 $(OBJCOPY) -v -O binary -j .bootsect $< $@
024 024
025 025
026 sos.bin: sos_bsect.elf 026 sos.bin: sos_bsect.elf
027 $(OBJCOPY) -v -O binary -R .bootsect $ 027 $(OBJCOPY) -v -O binary -R .bootsect $< $@
028 028
029 029
030 030
031 031
032 sos_bsect.elf: bootsect.o compile_kernel 032 sos_bsect.elf: bootsect.o compile_kernel
033 $(LD) --warn-common -T ./sos_bsect.lds 033 $(LD) --warn-common -T ./sos_bsect.lds -o $@ \
034 bootsect.o $(wildcard ../hwcor 034 bootsect.o $(wildcard ../hwcore/*.o ../drivers/*.o ../sos/*.o)
035 035
036 compile_kernel: 036 compile_kernel:
037 $(MAKE) -C .. 037 $(MAKE) -C ..
038 038
039 clean: 039 clean:
040 $(RM) *.img *.elf *.bin *~ *.o *.out 040 $(RM) *.img *.elf *.bin *~ *.o *.out