-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_files.sh
executable file
·51 lines (45 loc) · 1.79 KB
/
build_files.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
50
51
#!/usr/bin/env bash
make clean
make os.iso
#set -e
#cd build_os
#rm -rf *.bin *.o *.elf
#cd ..
#
#cfiles=""
#for file in $(find . -type f -name \*.c)
#do
# filename=${file%.c}
# filename=${filename##*/}
## cfiles="$cfiles $file"
# /usr/local/i386elfgcc/bin/i386-elf-gcc -ffreestanding -O2 -s -c -g "$file" -o ./build_os/"$filename.o"
# echo "Created ./build_os/$filename.o"
#done
##echo "/usr/local/i386elfgcc/bin/i386-elf-gcc -ffreestanding -c -g $cfiles -o ./build_os/overall.o"
##/usr/local/i386elfgcc/bin/i386-elf-gcc -ffreestanding -c -g $cfiles -o ./build_os/overall.o
##echo "Created ./build_os/overall.o"
#
#nasm ./on_boot/start_kernel.s -f elf -o ./build_os/start_kernel.o # Pass over to 32 bit protected mode
#echo "Created ./build_os/start_kernel.o"
#
#objectfiles="./build_os/start_kernel.o ./build_os/kernel.o ./build_os/port_access.o ./build_os/cursor.o ./build_os/screen_control.o"
##objectfiles="./build_os/start_kernel.o"
##for file in $(find . -type f -name \*.o)
##do
## if [[ "$file" != "./build_os/start_kernel.o" ]]; then
### if [[ "$file" != "./build_os/kernel.o" ]]; then
## objectfiles="$objectfiles $file"
### fi
## fi
##done
#
#/usr/local/i386elfgcc/bin/i386-elf-ld -o ./build_os/kernel.bin -Ttext 0x1000 $objectfiles --oformat binary # Convert Kernel and Convertto32bit code to one bin file -- KERNEL
#echo "Created ./build_os/kernel.bin from these files: $objectfiles"
#
#cd on_boot
#nasm boot_sector_main.s -f bin -o ../build_os/boot_sector_main.bin # Boot Sector code -- OS START
#cd ..
#echo "Created ./build_os/boot_sector_main.bin"
#
#cat ./build_os/boot_sector_main.bin ./build_os/kernel.bin > ./build_os/os.bin # Combine all code into one binary OS File
#echo "Created ./build_os/os.bin from ./build_os/boot_sector_main.bin ./build_os/kernel.bin"