This repository has been archived by the owner on Jun 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakefile
67 lines (48 loc) · 2.09 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
all: bootsect.bin mm.com stage2.txt kernel.txt fillprep
bootsect.bin: bootsect.asm
nasm -o bootsect.bin bootsect.asm
mm.com: mm.o
ld -s -o mm.com --oformat binary -Ttext 0x100 mm.o
mm.o: mm.asm
nasm -f aout -o mm.o mm.asm
stage2.txt: stage2.bin fillprep
echo -n "s1020" > stage2.txt
./fillprep < stage2.bin >> stage2.txt
echo "" >> stage2.txt
echo -n "g" >> stage2.txt
stage2.bin: stage2.o stage2_main.o lib_asm.o lib_c.o string.o stringc.o
ld -s -o stage2.bin --oformat binary -Ttext 0x10200 stage2.o stage2_main.o lib_asm.o lib_c.o string.o stringc.o
stage2.o: stage2.asm
nasm -f aout -o stage2.o stage2.asm
stage2_main.o: stage2_main.c lib_asm.h lib_c.h string.h
gcc -fno-builtin -mregparm=1 -c -O0 -Wall -o stage2_main.o stage2_main.c -fno-stack-protector -shared
stringc.o: string.c
gcc -fno-builtin -mregparm=1 -c -O0 -Wall -o stringc.o string.c -fno-stack-protector -shared
FAT.o: FAT.c FAT.h lib_asm.h lib_c.h
gcc -fno-builtin -mregparm=1 -c -O0 -Wall -o FAT.o FAT.c -fno-stack-protector -shared
delay.txt:
for i in `seq 1 50`; do echo "" >> delay.txt; done
kernel.txt: kernel.bin fillprep stage2.txt delay.txt
# cat stage2.txt > kernel.txt
# cat delay.txt >> kernel.txt
# echo -n "s00100000" >> kernel.txt
echo -n "s00100000" > kernel.txt
./fillprep < kernel.bin >> kernel.txt
echo "" >> kernel.txt
echo -n "c00100000" >> kernel.txt
kernel.bin: kernel.o kernel_main.o lib_asm.o lib_c.o string.o stringc.o FAT.o
ld -s -o kernel.bin --oformat binary -Ttext 0x100000 kernel.o kernel_main.o lib_asm.o lib_c.o string.o stringc.o FAT.o
kernel.o: kernel.asm
nasm -f aout -o kernel.o kernel.asm
kernel_main.o: kernel_main.c lib_asm.h lib_c.h string.h FAT.h
gcc -fno-builtin -mregparm=1 -c -O0 -Wall -o kernel_main.o kernel_main.c -fno-stack-protector -shared
lib_asm.o: lib_asm.asm lib_asm.h
nasm -f aout -o lib_asm.o lib_asm.asm
lib_c.o: lib_c.c lib_c.h
gcc -fno-builtin -mregparm=1 -c -O0 -Wall -o lib_c.o lib_c.c -fno-stack-protector -shared
string.o: string.asm
nasm -f aout -o string.o string.asm
fillprep: fillprep.c
gcc -o fillprep fillprep.c
clean:
rm -f *.bin *.o *.com *.txt fillprep