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