Skip to content

Tbalta/AdOS

Repository files navigation

AdOS

AdOS is a proof of concept for an operating system kernel written in Ada.

Project status

Currently AdOS support:

  • Booting through GRUB2
  • Serial output
  • Basic memory management with paging
  • Basic file system support for ISO9660
  • ELF loading and execution in user space
  • Read, Write, Open syscalls

Building

Prerequisites

  • qemu-system-i386 should be installed on the host system

Build with Docker

# 1. Create the AdOS docker image
make docker-build

# 2. Build AdOS using the docker image then run it in QEMU
make docker-make

Build natively

Dependencies

  • nasm
  • grub-pc-bin
  • grub-common
  • gcc-i366-elf
  • gnat-i386-elf
  • gnatformat (installed through alr, see below)

gcc-i386-elf and gnat-i386-elf cross compiler installation

Follow this tutorial:
https://wiki.osdev.org/GNAT_Cross-Compiler

Note that if the compiler is not found you may want to create a symbolic link to ${arch}-elf-gnatgcc which reference ${arch}-elf-gcc.
You can also edit the Library_Builder inside linker.xml in case gprlib is not located at libexec/gprlib. but at lib/gprlib.

Example for linker.xml and compilers.xml can be found in .docker/

Building AdOS

make
make run

Remarks

gnatformat

Gnatformat installation should be done through alr.

Since it seems there is an issue with alr 1.2.0 distributed on Ubuntu 24.04, a newer version of alr should be installed.

  1. Fetch the latest alr release from https://github.com/alire-project/alire/releases/tag/v2.1.0
  2. Using unzip extract the alr binary from the archive
  3. Copy the alr binary to /usr/local/bin
  4. Update the alr database:
    alr index --update-all
  5. Fetch gnatformat using alr:
    alr get gnatformat
  6. Build gnatformat using alr:
    alr build gnatformat && alr install gnatformat
  7. Copy the gnatformat binary to /usr/local/bin
wget https://github.com/alire-project/alire/releases/download/v2.1.0/alr-2.1.0-bin-x86_64-linux.zip
unzip alr-2.1.0-bin-x86_64-linux.zip
sudo cp bin/alr /usr/local/bin
alr get libadalang_tools
cd libadalang_tools
alr update
alr build
sudo cp bin/gnatformat /usr/local/bin

References

Intel

8259 PIC

https://wiki.osdev.org/8259_PIC
https://pdos.csail.mit.edu/6.828/2005/readings/hardware/8259A.pdf

Ada

https://www.adaic.org/resources/add_content/standards/22rm/rm-bar.pdf

Osdev

https://github.com/cirosantilli/x86-bare-metal-examples
https://github.com/ajxs/cxos/
https://wiki.osdev.org/Ada_Bare_bones

VGA

http://www.mcamafia.de/pdf/ibm_vgaxga_trm2.pdf
http://www.osdever.net/FreeVGA/vga/crtcreg.htm
https://www.worldradiohistory.com/Archive-Byte/80s/Byte-1988-11-IBM-Issue.pdf
https://wiki.osdev.org/Video_Signals_And_Timing
https://glenwing.github.io/docs/VESA-GTF-1.1.pdf

About

A proof of concept for an operating system in Ada.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published