Created a few shell scripts to update and create an build of the Kernel/Operating System.

A python script can be run to run the scripts in the correct order and immediatly try the build.
dev
Nigel Barink 2023-02-20 01:03:46 +01:00
parent dea8ab7d71
commit 81f7351fe6
10 changed files with 44 additions and 21 deletions

View File

@ -1,4 +1,3 @@
EMULATOR = qemu-system-i386
AS = ${HOME}/opt/cross/bin/i686-elf-as
CC = ${HOME}/opt/cross/bin/i686-elf-gcc
CPP = ${HOME}/opt/cross/bin/i686-elf-g++

View File

@ -2,24 +2,23 @@
import os
import subprocess
print("Building BarinkOS")
print("Give BarinkOS A Test Run")
# list and run build scripts
print("Running build-scripts")
os.chdir("scripts")
scripts=os.listdir()
currentScript=os.path.basename(__file__)
if currentScript in scripts:
scripts.remove(currentScript)
os.chdir("../CoreLib")
print("Building CoreLib")
subprocess.call("make")
os.chdir("../kernel")
print("Building kernel")
subprocess.call("make")
for script in scripts:
print(os.getcwd())
print("Running:" + script)
subprocess.call(script, cwd=os.getcwd())
os.chdir("..")
os.chdir("..")
subprocess.call("scripts/update_harddrive.sh", cwd=os.getcwd())
subprocess.call("scripts/create_symbol_lookup.sh", cwd=os.getcwd())
subprocess.call("scripts/run_qemu.sh", cwd=os.getcwd())

5
scripts/create_iso.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
mkdir -p root/boot/grub
cp build/kernel/myos.bin root/boot/myos.bin
cp kernel/grub.cfg root/boot/grub/grub.cfg
grub-mkrescue -o barinkOS.iso root

View File

@ -0,0 +1,3 @@
#!/bin/bash
objcopy --only-keep-debug build/kernel/myos.bin kernel.sym

View File

@ -1,5 +1,2 @@
#!/bin/bash
# Run clang-tidy

12
scripts/run_qemu.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
# Run from harddisk
qemu-system-i386 -boot d -drive format=raw,file=disk.img -serial stdio -vga std -display gtk -m 2G -cpu core2duo
# Run disk version
# qemu-system-i386 -cdrom barinkOS.iso -serial stdio -vga std -display gtk -m 2G -cpu core2duo -s -d int -no-shutdown -no-reboot
# Run the raw kernel image
# qemu-system-i386 -kernel build/kernel/myos.bin -serial stdio -vga std -display gtk -m 2G -cpu core2duo -d int -no-shutdown -no-reboot

2
scripts/run_virtualbox.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
virtualboxvm --startvm "BarinkOS_test"

View File

@ -1,5 +0,0 @@
#!/bin/bash
start=`date +%s`
end=`date +%s`
echo That took $((end-start)) seconds
date +"%c" -d195440409

11
scripts/update_harddrive.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
echo "Mount harddrive image as block device"
sudo losetup /dev/loop9 disk.img
sudo mount /dev/loop9 /mnt
echo "Copy over kernel binary"
sudo cp build/kernel/myos.bin /mnt/boot/myos.bin
echo "unmount image"
sudo umount /mnt
sudo losetup -d /dev/loop9