2023-05-31 00:03:44 -07:00
|
|
|
# AcadiaOS
|
|
|
|
|
2023-10-24 22:56:45 -07:00
|
|
|
AcadiaOS is a hobby operating system I use to explore and learn about OS development.
|
2023-05-31 00:03:44 -07:00
|
|
|
|
2023-10-24 22:56:45 -07:00
|
|
|
It is built on top of a small capability-based microkernel that provides
|
|
|
|
memory management, process scheduling, and hardware access.
|
|
|
|
|
|
|
|
## Directory Structure
|
|
|
|
|
|
|
|
The subdirectories of the project are as follows:
|
2023-12-05 17:02:16 -08:00
|
|
|
- **zion**: Contains kernel code as well as a couple headers that user space uses to interface with
|
|
|
|
the kernel.
|
2023-10-24 22:56:45 -07:00
|
|
|
- **lib**: Library code used by the kernel and user space.
|
|
|
|
- **sys**: System services.
|
|
|
|
- **sysroot**: Files that are copied to the root filesystem.
|
|
|
|
- **toolchain** and **scripts**: Contain tooling for the cross-compile environment.
|
|
|
|
- **yunq**: Contains the El Yunque IDL used for IPC between processes in userspace.
|
|
|
|
|
2023-12-05 17:02:16 -08:00
|
|
|
Where available, further documentation about each of these components can be found in the README fi
|
|
|
|
les in each respective subdirectory.
|
2023-10-24 22:56:45 -07:00
|
|
|
|
|
|
|
## Building AcadiaOS
|
|
|
|
|
2023-12-05 17:02:16 -08:00
|
|
|
Run `./scripts/build_toolchain.sh` to build a gcc cross-compile toolchain for the project. This
|
|
|
|
step may take a long time (~5 mins on my new laptop, ~45 mins on my 2013 laptop).
|
2023-10-24 22:56:45 -07:00
|
|
|
|
2023-12-05 17:02:16 -08:00
|
|
|
Run `./init-dbg.sh` to initialize the CMake project.
|
2023-10-24 22:56:45 -07:00
|
|
|
|
2023-12-05 17:02:16 -08:00
|
|
|
Run `./scripts/qemu.sh` to build and run AcadiaOS in a VM. I usually run this from the `builddbg`
|
|
|
|
directory so it is easier to run `ninja clean` when necessary (for instance when updating yunq
|
|
|
|
files).
|
2023-10-24 22:56:45 -07:00
|
|
|
|
|
|
|
### System Dependencies
|
|
|
|
|
2023-12-05 17:02:16 -08:00
|
|
|
On arch linux I require the following packages to build this project:
|
|
|
|
|
|
|
|
`base-devel limine dosfstools parted cmake ninja qemu-desktop qemu-system-x86`
|
2023-10-24 22:56:45 -07:00
|
|
|
|
|
|
|
## Boot Process
|
|
|
|
|
2023-12-05 17:02:16 -08:00
|
|
|
AcadiaOS uses the limine bootloader to enter into a 64-bit kernel in the negative 2GB address space
|
|
|
|
(mcmodel kernel).
|
2023-10-24 22:56:45 -07:00
|
|
|
|
2023-12-05 17:02:16 -08:00
|
|
|
The Zion kernel then sets up interrupts, scheduling, and memory management before passing off
|
|
|
|
control to the Yellowstone process.
|
2023-10-24 22:56:45 -07:00
|
|
|
|
2023-12-05 17:02:16 -08:00
|
|
|
The kernel passes capabilities to the Denali and VictoriaFalls binaries to the Yellowstone process
|
|
|
|
to allow it to manage the rest of the boot process.
|
2023-10-24 22:56:45 -07:00
|
|
|
|
2023-12-05 17:02:16 -08:00
|
|
|
The Yellowstone, Denali, and VictoriaFalls processes are all passed at boot using limine modules,
|
|
|
|
however any subsequent processes are loaded off disk.
|