# Makefile for HOS # Josh Holtrop # Created: 07/09/04 FLOPPY=/dev/fd0 FLOPPY_MOUNT=./mnt_flp FLOPPY_IMAGE=hos.flp GRUB_IMAGE=grub.flp INITRD=hos_initrd INITRD_MOUNT=./mnt_initrd INITRD_SIZE=100 #initrd size in kb # Do not print "Entering directory ..." MAKEFLAGS += --no-print-directory all: make -C kernel make -C rmmod clean: -make -C kernel clean -make -C rmmod clean -rm -f *~ *.out hos.flp \#* hos_initrd hos_initrd.gz parallel.out grub: -mkdir $(FLOPPY_MOUNT) mke2fs $(FLOPPY) mount -t ext2 $(FLOPPY) $(FLOPPY_MOUNT) grub-install --root-directory=$(FLOPPY_MOUNT) fd0 umount $(FLOPPY_MOUNT) -rmdir $(FLOPPY_MOUNT) grub_image: dd if=$(FLOPPY) of=$(GRUB_IMAGE) install: gzip -c $(INITRD) > $(INITRD).gz -mkdir $(FLOPPY_MOUNT) mount -t ext2 $(FLOPPY) $(FLOPPY_MOUNT) cp kernel/kernel.bin $(FLOPPY_MOUNT) cp rmmod/rmmod.bin $(FLOPPY_MOUNT) cp menu.lst $(FLOPPY_MOUNT)/boot/grub cp $(INITRD).gz $(FLOPPY_MOUNT)/$(INITRD).gz umount $(FLOPPY_MOUNT) -rmdir $(FLOPPY_MOUNT) install_img: gzip -c $(INITRD) > $(INITRD).gz -mkdir $(FLOPPY_MOUNT) cp $(GRUB_IMAGE) $(FLOPPY_IMAGE) mount -t ext2 -o loop $(FLOPPY_IMAGE) $(FLOPPY_MOUNT) cp kernel/kernel.bin $(FLOPPY_MOUNT) cp rmmod/rmmod.bin $(FLOPPY_MOUNT) cp menu.lst $(FLOPPY_MOUNT)/boot/grub cp $(INITRD).gz $(FLOPPY_MOUNT)/$(INITRD).gz umount $(FLOPPY_MOUNT) -rmdir $(FLOPPY_MOUNT) initrd: dd if=/dev/zero of=$(INITRD) bs=1024 count=$(INITRD_SIZE) mke2fs -Fv -m0 -r0 -i1024 $(INITRD) -mkdir $(INITRD_MOUNT) mount -t ext2 -o loop $(INITRD) $(INITRD_MOUNT) touch $(INITRD_MOUNT)/hi_there chmod 527 $(INITRD_MOUNT)/hi_there chown josh:users $(INITRD_MOUNT)/hi_there mkdir $(INITRD_MOUNT)/txt cp Makefile $(INITRD_MOUNT)/txt umount $(INITRD_MOUNT) rm -rf $(INITRD_MOUNT)