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

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