-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake.sh
executable file
·55 lines (45 loc) · 1.7 KB
/
make.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
#!/bin/sh
BOOT_DIR=isodir/boot
#echo 'MYOS_QEMU_PARAMS="-m 128 -blockdev driver=file,node-name=f0,filename=./fat32_floppy.img -device floppy,drive=f0 -no-reboot"' >> ~/.bashrc
if alias os-machine >/dev/null 2>&1; then
ENVIRONMENT="os-machine"
else
ENVIRONMENT="docker run -it --rm -v $PWD:/os -v $PWD/sysroot:/os/sysroot -v $PWD/ports/newlib/myos:/src/newlib-2.5.0/newlib/libc/sys/myos -v $PWD/build:/src/build os_tools";
fi
if [ "$1" = "clean" ]
then
$ENVIRONMENT ./clean.sh
elif [ "$1" = "build_libc" ]
then
$ENVIRONMENT sh /src/libc.sh build && $ENVIRONMENT sh /src/libc.sh install
elif [ "$1" = "rebuild_libc" ]
then
$ENVIRONMENT sh /src/libc.sh rebuild && $ENVIRONMENT sh /src/libc.sh install
elif [ "$1" = "rebuild" ]
then
$ENVIRONMENT ./clean.sh && \
$ENVIRONMENT ./build.sh install && \
$ENVIRONMENT ./make_iso.sh myos
elif [ "$1" = "build" ]
then
$ENVIRONMENT ./build.sh install && \
$ENVIRONMENT ./make_iso.sh myos
elif [ "$1" = "test-build" ]
then
$ENVIRONMENT ./clean.sh && \
$ENVIRONMENT ./build.sh test && \
$ENVIRONMENT ./make_iso.sh test
elif [ "$1" = "test" ]
then
#$ENVIRONMENT ./clean.sh && \
$ENVIRONMENT ./build.sh test && \
$ENVIRONMENT ./make_iso.sh test && \
qemu-system-i386 -monitor unix:qemu-monitor-socket,server,nowait -chardev stdio,id=char0,logfile=uart1.log -serial chardev:char0 $MYOS_QEMU_PARAMS -kernel isodir/boot/test.bin
elif [ "$1" = "run" ]
then
$ENVIRONMENT ./build.sh install && \
$ENVIRONMENT ./make_iso.sh myos && \
qemu-system-i386 -monitor unix:qemu-monitor-socket,server,nowait -chardev stdio,id=char0,logfile=uart1.log -serial chardev:char0 $MYOS_QEMU_PARAMS -kernel isodir/boot/myos.bin
else
echo "Unknown param: clean, build, run"
fi