Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PATH := ../local/bin:$(PATH) # DON'T PUT THIS LINE IN ON THE LAB MACHINES!
- run: disk.iso
- qemu-system-i386 -m 64M -serial file:serial.txt disk.iso
- cat serial.txt
- disk.iso: prefix.iso bootp.iso
- rm -f disk.iso
- truncate -s16M disk.iso
- dd if=prefix.iso of=disk.iso count=2048 conv=notrunc
- dd if=bootp.iso of=disk.iso seek=2048 count=14336 conv=notrunc
- # Requires root privleges, use the provided copy in the labs
- prefix.iso:
- sudo ./makePrefix.bash
- archive.tar: initrd/init
- tar cf archive.tar initrd/
- archive.o: archive.tar
- i686-elf-objcopy -I binary -O elf32-i386 -B i386 archive.tar archive.o
- initrd/init: init.c crt0.s
- i686-elf-gcc -g -o initrd/init init.c crt0.s -ffreestanding -O1 -nostdlib -w
- # Use a bash script as shell variables are awkward in make
- bootp.iso: kernel.bin
- sudo ./makeBootp.bash
- kernel.bin: linker.ld boot.o kernel.o serial.o mem.o ints.o tickhandler.o initrd.o archive.o
- i686-elf-gcc -g -T linker.ld -o kernel.bin -ffreestanding -O2 -nostdlib -w boot.o kernel.o serial.o mem.o ints.o tickhandler.o initrd.o archive.o -lgcc
- boot.o: boot.s
- i686-elf-as boot.s -o boot.o
- kernel.o: kernel.c mem.o
- i686-elf-gcc -g -c kernel.c -o kernel.o mem.o -std=gnu99 -ffreestanding -O2 -w
- serial.o: serial.c serial.h
- i686-elf-gcc -g -c serial.c -o serial.o -std=gnu99 -ffreestanding -O2 -w
- mem.o: mem.c mem.h
- i686-elf-gcc -g -c mem.c -o mem.o -std=gnu99 -ffreestanding -O2 -w
- ints.o: ints.c ints.h
- i686-elf-gcc -g -c ints.c -o ints.o serial.o -std=gnu99 -ffreestanding -O2 -w
- tickhandler.o: tickhandler.c tickhandler.h
- i686-elf-gcc -g -c tickhandler.c -o tickhandler.o ints.o -std=gnu99 -ffreestanding -O2 -w
- initrd.o: initrd.c initrd.h
- i686-elf-gcc -g -c initrd.c -o initrd.o -std=gnu99 -ffreestanding -O2 -w
- dbg: disk.iso
- qemu-system-i386 -s -S disk.iso -serial file:serial.txt -monitor stdio
- clean:
- sudo rm -r t/*; rmdir bootploop; rmdir t; rm -f boot.o kernel.o serial.o mem.o ints.o tickhandler.o initrd.o archive.o disk.iso bootp.iso prefix.iso kernel.bin
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement