-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuild.sh
More file actions
executable file
·43 lines (34 loc) · 1.04 KB
/
Copy pathBuild.sh
File metadata and controls
executable file
·43 lines (34 loc) · 1.04 KB
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
#!/bin/bash
# CaOS - Build Utilities
#
# A script to kick off the CMake process and then perform various conveniences,
# Like kicking off emulation test
#
# Maybe CMake could do this, I don't know it as well as shell, yet.
# Please advise!
#
# CopyRight (c) 2023, Cao Smith
# Set variables
# The first cli argument is the command
Command="${1}"
# Project-related variables
ProjectNameBoot="bootloader"
FileNameBinBoot="${ProjectNameBoot}.bin"
FileNameSrcBoot="${ProjectNameBoot}.asm"
FileNameObjBoot="${FileNameSrcBoot}.o"
# Directories
DirRoot="/home/cao/Development/C/c/"
DirBuild="${DirRoot}Make/"
DirCMake="${DirBuild}/CMakeFiles/"
DirBootOutput="${DirCMake}${FileNameBinBoot}.dir/Source/BootSector/"
BinBootloader="${DirBootOutput}${FileNameObjBoot}"
# SubShell to go to build dir & kick off make
(cd ${DirBuild}
make)
if [ "${Command}" = "run" ]; then
dd if=/dev/zero of=disk.img count=1008 bs=512
dd if=${BinBootloader} of=disk.img conv=notrunc
qemu-system-x86_64 disk.img
elif [ "${Command}" = "" ]; then
echo "No Command"
fi