-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
47 lines (33 loc) · 751 Bytes
/
build.sh
File metadata and controls
47 lines (33 loc) · 751 Bytes
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
#!/bin/bash
tmpdir=_builds
# build
function build()
{
dir=$tmpdir$1
cmake -H. -B$dir -DCMAKE_BUILD_TYPE=$1
if [ 0 != $? ]; then
exit 1;
fi
cmake --build $dir --config $1
if [ 0 != $? ]; then
exit 1;
fi
# test
pushd $dir && ctest -C Debug -VV
if [ 0 != $? ]; then
exit 1;
fi
popd
}
# build "Debug"
build "Release"
echo 'success';
echo '编译内核'
#gcc -m32 -c kernel/main.c && ld -m elf_i386 main.o -Ttext 0xc0001500 -e main -o bin/kernel.bin
echo 写入MBR
dd if=bin/mbr.bin of=hd60M.img bs=512 count=1 conv=notrunc
echo 写入LOADER
dd if=bin/loader.bin of=hd60M.img bs=512 count=4 seek=2 conv=notrunc
echo 写入 kernel
make
# dd if=bin/kernel.bin of=hd60M.img bs=512 count=200 seek=9 conv=notrunc