diff --git a/.gitignore b/.gitignore index 6a8bc10..2d3962b 100755 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .vscode -build \ No newline at end of file +build +src/tools \ No newline at end of file diff --git a/Makefile b/Makefile index 2030539..59f7aa5 100755 --- a/Makefile +++ b/Makefile @@ -4,13 +4,5 @@ # ToDo: # Ignore Upload when no programmer found -all: compile upload - -compile: - @echo "Compiling for 65c02" - @vasm6502_oldstyle -Fbin -dotdir -wdc02 src/main.s -o build/kernel.bin | grep : - -upload: - @echo "Uploading" - @minipro -p SST39SF040 -w build/kernel.bin -Sy - +all: + @sh build.sh diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..0d1bb05 --- /dev/null +++ b/build.sh @@ -0,0 +1,34 @@ +echo "Compiling for 65c02" + +# Removing previous build + +rm -rf build +mkdir build + +bold=$(tput bold) +normal=$(tput sgr0) + +build(){ + output=$(vasm6502_oldstyle -Fbin -dotdir -wdc02 src/main.s -o build/a.out | grep :) + + if `find build/a.out* > /dev/null`; + then + echo -e "\n\e[0;32m${bold}Compiled Succsessfully${normal}" + sh upload.sh + else + echo -e "\n\e[0;31m${bold}Error while Compiling${normal}" + fi + + echo "" + echo $output | sed 's/bytes /bytes\n/g' +} + +# Checking dependencies + +if command -v vasm6502_oldstyle > /dev/null 2<&1; +then + build +else + echo -e "\n\e[0;31m${bold}vasm6502_oldstyle not found${normal}" + echo "Aborting build..." +fi diff --git a/src/bootloader.s b/src/bootloader.s new file mode 100644 index 0000000..e69de29 diff --git a/src/kernel.s b/src/kernel.s index ea6e5d6..f9648a8 100755 --- a/src/kernel.s +++ b/src/kernel.s @@ -3,12 +3,15 @@ .include "src/kernel/video.s" .include "src/kernel/console.s" .include "src/kernel/graphics.s" - .include "src/kernel/string.s" - .include "src/kernel/int.s" .include "src/kernel/event_handler.s" .include "src/kernel/memory_manager.s" .include "src/kernel/hardware.s" - + + .include "src/kernel/string.s" + .include "src/kernel/int.s" + .include "src/kernel/byte.s" + .include "src/kernel/char.s" + kernel_init: diff --git a/upload.sh b/upload.sh new file mode 100644 index 0000000..b0685bb --- /dev/null +++ b/upload.sh @@ -0,0 +1,18 @@ +echo -e "\nUploading..." + +bold=$(tput bold) +normal=$(tput sgr0) + +upload(){ + output=`minipro -p SST39SF040 -w build/a.out -Sy` +} + +# Checking dependencies + +if command -v minipro > /dev/null 2<&1; +then + upload +else + echo -e "\n\e[0;31m${bold}minipro not found${normal}" + echo "Aborting upload..." +fi