diff --git a/.gitignore b/.gitignore index 5266f2b..41b32c3 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ kernel.elf os.iso blankos.iso real/ +i386-elf-7.5.0-Linux-x86_64/ diff --git a/README.md b/README.md index fca460d..d4b8286 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,12 @@ git clone https://aur.archlinux.org/bochs.git Then follow [these](https://bbs.archlinux.org/viewtopic.php?id=178479) instructions to compile Bochs with X support. Alternatively you can use Bochs with SDL but you'll have to change the `bochsrc.txt` file accordingly. +### Cross Compiler + +A cross-compiler is needed to build the system. More info on why [here](https://wiki.osdev.org/GCC_Cross-Compiler). In order for the build to work, you will need to download the i386-elf toolchain from [here](https://newos.org/toolchains/i386-elf-7.5.0-Linux-x86_64.tar.xz) and extract the root folder into the BlankOS root folder, or build it by youself if you're not lazy like me. + +Why didn't I use one sooner? Can't tell. Maybe I was too lazy. This is actually problematic because I wasn't able to use some libraries and I had to put in a bunch of weird compilation flags. It's better like this. + ## Building and running ``` diff --git a/iso/boot/kernel.elf b/iso/boot/kernel.elf index 51c05f1..ef91c7e 100755 Binary files a/iso/boot/kernel.elf and b/iso/boot/kernel.elf differ diff --git a/makefile b/makefile index e3153ed..1df1132 100644 --- a/makefile +++ b/makefile @@ -1,5 +1,5 @@ -CC = gcc -CFLAGS = -m32 -nostdlib -nostdinc -fno-builtin -fno-stack-protector -nostartfiles -nodefaultlibs -Wall -Wextra -Wno-div-by-zero -c -I src/ +CC = i386-elf-7.5.0-Linux-x86_64/bin/i386-elf-gcc +CFLAGS = -Wall -Wextra -Wno-div-by-zero -Wno-builtin-declaration-mismatch -c -I src/ LDFLAGS = -T link.ld -melf_i386 AS = nasm ASFLAGS = -f elf