2018-02-13 18:32:17 +00:00
|
|
|
# Building
|
2018-02-13 18:32:46 +00:00
|
|
|
### Environment
|
2018-02-18 04:22:46 +00:00
|
|
|
Linux distribution / Bash for Windows.
|
2018-02-13 18:29:45 +00:00
|
|
|
|
2018-02-13 18:32:46 +00:00
|
|
|
### Required packages
|
2018-02-18 04:22:46 +00:00
|
|
|
NASM (sudo apt-get install nasm)
|
2018-02-18 04:23:17 +00:00
|
|
|
|
2018-02-18 04:22:46 +00:00
|
|
|
GCC cross compiler (see the next section)
|
|
|
|
|
|
|
|
### GCC cross compiler
|
|
|
|
##### Method 1 - Compile from GCC source.
|
2018-02-18 04:53:25 +00:00
|
|
|
Follow the [instructions](https://wiki.osdev.org/GCC_Cross-Compiler)
|
2018-02-13 18:29:45 +00:00
|
|
|
|
2018-02-18 04:53:25 +00:00
|
|
|
Set the "TARGET" to "x86_64-elf" instead of "i686-elf" and build [libgcc without redzone](https://wiki.osdev.org/Libgcc_without_red_zone).
|
2018-02-13 18:29:45 +00:00
|
|
|
|
2018-02-13 18:32:46 +00:00
|
|
|
##### Method 2 - Precompiled binaries
|
2018-02-13 18:29:45 +00:00
|
|
|
VERSION: GCC 7.3 + Binutils 2.30
|
2018-02-13 18:33:24 +00:00
|
|
|
|
2018-02-13 18:29:45 +00:00
|
|
|
HOST: x86_64-pc-linux-gnu
|
2018-02-13 18:33:24 +00:00
|
|
|
|
2018-02-13 18:29:45 +00:00
|
|
|
CONFIGURED WITH: --target=x86_64-elf --disable-nls --enable-languages=c,c++ --without-headers
|
|
|
|
|
2018-02-17 04:44:48 +00:00
|
|
|
1. Download "cross.tar.gz" from the Github release page.
|
2018-02-13 18:29:45 +00:00
|
|
|
|
|
|
|
2. Run "tar -xvf cross.tar.gz -C $HOME/opt/cross"
|
|
|
|
|
2018-02-13 18:32:46 +00:00
|
|
|
### Compiling
|
2018-02-18 04:38:23 +00:00
|
|
|
Run "make" in the root directory.
|
2018-02-13 18:33:24 +00:00
|
|
|
|
2018-02-18 04:38:23 +00:00
|
|
|
This will generate secxkrnl.elf (kernel executable) and secxkrnl.dmp (kernel dump).
|
|
|
|
|
|
|
|
Run "make clean" to clean a build.
|
|
|
|
|
|
|
|
# Running
|
2018-02-18 04:53:25 +00:00
|
|
|
secX requires bootloader [secboot](https://github.com/secXsQuared/secboot).
|
2018-02-13 18:29:45 +00:00
|
|
|
|
2018-02-18 04:50:22 +00:00
|
|
|
See secboot repository for more information.
|