SimpleOS

LXR

Navigation



Site hébergé par : enix

The LXR Cross Referencer for SOS

source navigation ]
diff markup ]
identifier search ]
general search ]
 
 
Article:1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 6.5 ] [ 7 ] [ 7.5 ] [ 8 ] [ 9 ] [ 9.5 ]

001 OBJCOPY=objcopy
002 
003 all: sos_qemu.img
004 
005 -include ../.mkvars
006 
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, but NOT in qemu (see below)
009 sos_bsect.img: bsect.bin sos.bin
010         cat $^ > $@
011         @echo "You can use the $@ image in bochs or on a real floppy (NOT qemu)"
012 
013 # For qemu, the trick is to tell it we have *more* than 1440 sectors (720kB).
014 # Rtherwise the qemu disk geometry will be configured to be that of a 720kB
015 # floppy, while our boot sector assumes it to be 1.44MB
016 sos_qemu.img: sos_bsect.img
017         # Padding with 0s after the bsect/kernel image
018         cat $< /dev/zero | dd of=$@ bs=1k count=1440
019         @echo "You can use the $@ image in qemu, bochs, or on a real floppy"
020 
021 # we extract the boot sector from the main ELF binary
022 bsect.bin: sos_bsect.elf
023         $(OBJCOPY) -v -O binary -j .bootsect $< $@
024 
025 # we extract the kernel code from the main ELF binary
026 sos.bin: sos_bsect.elf
027         $(OBJCOPY) -v -O binary -R .bootsect $< $@
028 
029 # The main ELF binary contains the boot sector and the kernel code
030 # linked together (hence we deal with a SINGLE image that we split
031 # above) because they share some symbol definitions
032 sos_bsect.elf: bootsect.o compile_kernel
033         $(LD) --warn-common -T ./sos_bsect.lds -o $@ \
034                 bootsect.o $(wildcard ../hwcore/*.o ../drivers/*.o ../sos/*.o)
035 
036 compile_kernel:
037         $(MAKE) -C ..
038 
039 clean:
040         $(RM) *.img *.elf *.bin *~ *.o *.out

source navigation ] diff markup ] identifier search ] general search ]