-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.sh
148 lines (138 loc) · 3.43 KB
/
build.sh
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#!/bin/bash
function tools {
cd tools
echo "Start compiling dos2out & build & minixfsutils"
gcc -o build build.c 1>>../log.txt 2>&1
if [ $? -ne 0 ]; then
echo "Failed to compile build"
exit
fi
gcc -o dos2out dos2out.c 1>>../log.txt 2>&1
if [ $? -ne 0 ]; then
echo "Failed to compile dos2out"
exit
fi
gcc -std=gnu11 -o minixfsutils fsutils/minixfsutils.c 1>>../log.txt 2>&1
if [ $? -ne 0 ]; then
echo "Failed to compile minixfsutils"
exit
fi
cd ..
}
function libsys {
cd libsys
rm -fr libsys.lib
echo "Start compiling libsys"
wmake all 1>>../log.txt 2>&1
if [ $? -ne 0 ]; then
echo "Failed to compile libsys"
exit
fi
cd ..
}
function kernel {
cd kernel
echo "Start compiling kernel"
wmake kernel.exe 1>>../log.txt 2>&1
if [ $? -ne 0 ]; then
echo "Failed to compile kernel"
exit
fi
../tools/dos2out kernel 1>>../log.txt 2>&1
cd ..
}
function fs {
cd fs
echo "Start compiling fs"
wmake fs.exe 1>>../log.txt 2>&1
if [ $? -ne 0 ]; then
echo "Failed to compile fs"
exit
fi
../tools/dos2out fs 1>>../log.txt 2>&1
cd ..
}
function mm {
cd mm
echo "Start compiling mm"
wmake mm.exe 1>>../log.txt 2>&1
if [ $? -ne 0 ]; then
echo "Failed to compile mm"
exit
fi
../tools/dos2out mm 1>>../log.txt 2>&1
cd ..
}
function init_fsck {
cd tools
echo "Start compiling init & fsck"
wmake all 1>>../log.txt 2>&1
if [ $? -ne 0 ]; then
echo "Failed to compile init_fsck"
exit
fi
../tools/dos2out init 1>>../log.txt 2>&1
../tools/dos2out fsck 1>>../log.txt 2>&1
cd ..
}
function libc {
cd libc
rm -fr libc.lib
echo "Start compiling libc"
wmake all 1>>../log.txt 2>&1
if [ $? -ne 0 ]; then
echo "Failed to compile libc"
exit
fi
cd ..
}
function test {
cd test
echo "Start compiling test"
wmake all 1>>../log.txt 2>&1
if [ $? -ne 0 ]; then
echo "Failed to compile test"
exit
fi
../tools/minixfsutils ../tools/c.img.old put /user/test/t10a t10a.out
../tools/minixfsutils ../tools/c.img.old put /user/test/t11b t11b.out
../tools/minixfsutils ../tools/c.img.old put /user/test/test10 test10.out
../tools/minixfsutils ../tools/c.img.old put /user/test/test1 test1.out
../tools/minixfsutils ../tools/c.img.old put /user/test/test3 test3.out
../tools/minixfsutils ../tools/c.img.old put /user/test/test5 test5.out
../tools/minixfsutils ../tools/c.img.old put /user/test/test7 test7.out
../tools/minixfsutils ../tools/c.img.old put /user/test/test9 test9.out
../tools/minixfsutils ../tools/c.img.old put /user/test/t11a t11a.out
../tools/minixfsutils ../tools/c.img.old put /user/test/test0 test0.out
../tools/minixfsutils ../tools/c.img.old put /user/test/test11 test11.out
../tools/minixfsutils ../tools/c.img.old put /user/test/test2 test2.out
../tools/minixfsutils ../tools/c.img.old put /user/test/test4 test4.out
../tools/minixfsutils ../tools/c.img.old put /user/test/test6 test6.out
../tools/minixfsutils ../tools/c.img.old put /user/test/test8 test8.out
cd ..
}
function image {
$1/build $1/$2 ./kernel/$3.out ./mm/$4.out ./fs/$5.out $1/$6.out $1/$7.out $1/$8
if [ $? -ne 0 ]; then
echo "Failed to Image"
exit
fi
}
echo "The MINIX documentation is contained in the appendices of the following book:"
echo " Title: Operating Systems: Design and Implementation"
echo " Author: Andrew S. Tanenbaum"
echo " Publisher: Prentice-Hall (1987)"
echo " "
rm -fr log.txt
tools
libsys
kernel
fs
mm
init_fsck
image ./tools bootblok.bin kernel mm fs init fsck image
cd tools
tar xf img.tar.xz
cd ..
#libc
#test