Switch to cross-compiling (to enable using other libs like va_args and maybe fix the printf %f specifier so the math interpreter could work??)
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,3 +5,4 @@ kernel.elf
|
|||||||
os.iso
|
os.iso
|
||||||
blankos.iso
|
blankos.iso
|
||||||
real/
|
real/
|
||||||
|
i386-elf-7.5.0-Linux-x86_64/
|
||||||
|
|||||||
@@ -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.
|
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
|
## Building and running
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
Binary file not shown.
4
makefile
4
makefile
@@ -1,5 +1,5 @@
|
|||||||
CC = gcc
|
CC = i386-elf-7.5.0-Linux-x86_64/bin/i386-elf-gcc
|
||||||
CFLAGS = -m32 -nostdlib -nostdinc -fno-builtin -fno-stack-protector -nostartfiles -nodefaultlibs -Wall -Wextra -Wno-div-by-zero -c -I src/
|
CFLAGS = -Wall -Wextra -Wno-div-by-zero -Wno-builtin-declaration-mismatch -c -I src/
|
||||||
LDFLAGS = -T link.ld -melf_i386
|
LDFLAGS = -T link.ld -melf_i386
|
||||||
AS = nasm
|
AS = nasm
|
||||||
ASFLAGS = -f elf
|
ASFLAGS = -f elf
|
||||||
|
|||||||
Reference in New Issue
Block a user