~vdupras/duskos

ref: 0c986dd34840500ff1f85d44cf5ac3274cbead69 duskos/Makefile -rw-r--r-- 1.3 KiB
0c986dd3Virgil Dupras drv/pc/ich: add PCI fields specific to the ICHn family 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
TARGETS = dusk
BOOTFS_SRC = fs/xcomp/bootlo.fs fs/xcomp/boothi.fs
ALLSRCS = $(shell find fs)
all: $(TARGETS)

fs/init.fs: posix/init.fs fs/xcomp/init.fs
	cat posix/init.fs fs/xcomp/init.fs > $@

posix/boot.fs: $(BOOTFS_SRC)
	cat $(BOOTFS_SRC) > $@

dusk: posix/vm.c posix/boot.fs fs/init.fs
	$(CC) posix/vm.c -Wall -o $@

mbr.bin: dusk buildmbr.fs
	./dusk < buildmbr.fs 2> $@

pc.bin: dusk buildpc.fs
	./dusk < buildpc.fs 2> $@

pc.img: mbr.bin pc.bin $(ALLSRCS)
	dd if=/dev/zero of=$@ bs=1M count=1
	# We need to reserve (-R) enough sectors for MBR + pc.bin
	mformat -M 512 -d 1 -R 48 -i $@ ::
	dd if=mbr.bin of=$@ bs=1 seek=62 conv=notrunc
	dd if=pc.bin of=$@ bs=1 seek=512 conv=notrunc
	mcopy -sQ -i $@ fs/* ::
	cat fs/xcomp/pc/init.fs fs/xcomp/init.fs | mcopy -D overwrite -i $@ - ::init.fs

.PHONY: pcrun
pcrun: pc.img
	qemu-system-i386 -drive file=pc.img,format=raw

.PHONY: testpc
testpc: pc.img
	cat fs/xcomp/pc/init.fs fs/xcomp/pc/inittest.fs | mcopy -D overwrite -i pc.img - ::init.fs
	qemu-system-i386 -nographic -drive file=pc.img,format=raw | tee /dev/stderr | grep "All tests passed"

.PHONY: run
run: dusk
	stty -icanon -echo; ./dusk ; stty icanon echo

.PHONY: test
test: dusk
	echo "' byefail to abort f<< tests/all.fs bye" | ./dusk || (echo; exit 1)

.PHONY: clean
clean:
	rm -f $(TARGETS) dusk.o fs/init.fs posix/boot.fs memdump *.bin *.img