-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcompile++
More file actions
executable file
·34 lines (29 loc) · 801 Bytes
/
compile++
File metadata and controls
executable file
·34 lines (29 loc) · 801 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
#!/bin/bash
mkdir core/tmp
g++ -m32 -c core/lib/math.cpp -o core/tmp/math.o
g++ -m32 -c core/system/video.cpp -o core/tmp/video.o
g++ -m32 -c core/lib/window.cpp -o core/tmp/window.o
g++ -m32 -c core/lib/stdio.cpp -o core/tmp/stdio.o
g++ -m32 -c -masm=intel -nostdlib -fpic core/system/CMOS.cpp -o core/tmp/CMOS.o
g++ -m32 -c -masm=intel -nostdlib -fpic core/system/disc.cpp -o core/tmp/disc.o
g++ -nostdlib -m32 -fpic -masm=intel core/main.cpp core/tmp/*.o -o main.bin
if [ $? -ne 0 ]; then
echo "gcc error"
exit -1;
fi
objcopy -O binary main.bin
if [ $? -ne 0 ]; then
echo "objcopy error"
exit -1;
fi
nasm -f bin boot.asm -o boot.bin
if [ $? -ne 0 ]; then
echo "nasm error"
exit -1;
fi
python3 compile.py
rm main.bin
rm boot.bin
rm core/tmp/*.o
rmdir core/tmp
qemu-system-i386 discpy.img