forked from nanochess/bootOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (65 loc) · 1.52 KB
/
Makefile
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Makefile contributed by jtsiomb
src = os.asm
FILES = .
.PHONY: help
help:
@echo =====bootOS=====
@echo all: make all
@echo run: run
@echo install: install on /dev/sdc
@echo software: make os image with software
@echo wipe: wipe /dev/sdc
@echo installer: make installer
@echo cdimg: make cd image
@echo strip: strip image
@echo symbols: create sysmap.inc
@echo ================
.PHONY: all
all: run
os.img: $(src)
nasm -f bin -o os.img -l os.lst $(src)
.PHONY: clean
clean:
$(RM) *.img
$(RM) *.lst
$(RM) lst/*.lst
$(RM) *.inc
-$(RM) software/ -fr
.PHONY: run
run: os.img
qemu-system-i386 -drive file=$<,format=raw -serial stdio -s -soundhw pcspk
.PHONY: install
install:
dd if=os.img of=$M
.PHONY: software
software: os.img symbols
mkdir software
bash makesoftware.sh
python3 makebase.py $(EXCLUDE)
dd if=$< of=base.img conv=notrunc bs=512 count=1
mv base.img os.img
rm -fr software
.PHONY: installer
installer:
nasm -f bin -o installer.img installer.asm
cat os.img >> installer.img
mv installer.img os.img
.PHONY: cdimg
cdimg: os.img
dd if=/dev/zero of=tmp.img bs=512 count=2879
dd if=os.img of=tmp.img count=512 count=2879 conv=notrunc
mv tmp.img os.img
genisoimage -pad -b os.img -R -o cd.img os.img
.PHONY: strip
strip: os.img
python3 strip.py
.PHONY: runkvm
runkvm: os.img
qemu-system-x86_64 -drive file=$<,format=raw --enable-kvm -serial stdio -s -soundhw pcspk
.PHONY: symbols
symbols:
python3 symbols.py os.asm sysmap.inc
.PHONY: upload
upload: software
@sudo cp os.img /smb/usb.img
@echo Reboot the PC!