https://github.com/nickscha/aiaos
C89, nostdlib, bare metal 64bit operating system
https://github.com/nickscha/aiaos
64bit bare-metal c89 from-scratch nostdlib operating-system
Last synced: 6 months ago
JSON representation
C89, nostdlib, bare metal 64bit operating system
- Host: GitHub
- URL: https://github.com/nickscha/aiaos
- Owner: nickscha
- License: mit
- Created: 2025-06-06T09:56:20.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-07-01T18:12:04.000Z (7 months ago)
- Last Synced: 2025-07-01T19:23:00.034Z (7 months ago)
- Topics: 64bit, bare-metal, c89, from-scratch, nostdlib, operating-system
- Language: C
- Homepage:
- Size: 441 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# aiaos
A C89 nostdlib bare metal 64bit operating system with a custom bootloader.
The name **AIAOS** is a simplification and stands for "Application is an Operating System".
> [!WARNING]
> THIS PROJECT IS A WORK IN PROGRESS! ANYTHING CAN CHANGE AT ANY MOMENT WITHOUT ANY NOTICE! USE THIS PROJECT AT YOUR OWN RISK!
## Quick Start
On **Windows** just run the "**build.bat**" file which compiles and links the bootloader and kernel and creates an elf bootable image.
## Building Windows cross compilation setup
In this section we will build an **x86_64-elf** cross compiler based on GCC using the **MSYS2** subsystem.
Download and Install the MSYS2 package:
https://www.msys2.org/wiki/MSYS2-installation/
Once you have it setup install nasm (needed for assembly files), gcc and other libraries needed for gcc cross compilation:
```bat
pacman -S base-devel make nasm gcc mingw-w64-x86_64-gcc mingw-w64-x86_64-qemu git gmp-devel mpfr-devel mpc-devel mpc isl-devel zlib-devel
```
Verify in the MSYS2 shell that they are installed:
```bat
make --version
nasm --version
gcc --version
```
Build x86_64-elf binutils for objcopy and ld linker command:
```bat
git clone --depth 1 https://sourceware.org/git/binutils-gdb.git
cd binutils-gdb
./configure --target=x86_64-elf --prefix=$HOME/opt/cross --disable-nls --disable-werror
make -j$(nproc)
make install
cd ..
```
Build x86_64-elf gcc cross compiler:
```bat
git clone --depth 1 https://gcc.gnu.org/git/gcc.git gcc-src
cd gcc-src
./contrib/download_prerequisites
mkdir build-gcc
cd build-gcc
../configure --target=x86_64-elf --prefix=$HOME/opt/cross --disable-nls --enable-languages=c --without-headers
make all-gcc -j$(nproc)
make all-target-libgcc -j$(nproc)
make install-gcc
make install-target-libgcc
```
Afterwards you should be able to call these executables:
```bat
x86_64-elf-gcc --version
x86_64-elf-ld --version
x86_64-elf-objcopy --version
```

