Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Applied operating system - an operating system kernel written in the ATS programming language.
Assembly Lua C
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
prelude
.gitignore
COPYING
Makefile
README.md
ats-anairiats-bignums.patch
ats_basics.h
ats_config.h
ats_exception.h
ats_memory.h
ats_types.h
bitflags.dats
bitflags.sats
boot.dats
bounded_strings.dats
bounded_strings.sats
enablable.dats
enablable.sats
gdt.dats
gdt.sats
gen_integer.lua
interrupts.dats
interrupts.sats
isr.S
kernel.ld
multiboot.sats
portio.dats
portio.sats
serial.dats
serial.sats
start.S
streams.dats
streams.sats
trace.dats
trace.sats
vga-text.dats
vga-text.sats

README.md

AOS - Applied Operating System

Aims

To be written in ATS (http://www.ats-lang.org/), which is a programming language that has a very flexible type system, supporting dependent and linear types. The language compiles straightforwardly to C, with no garbage collection (by default), making it very useful for low-level programming. ATS's type system can be used to prove at compile-time, among many other properties, the absence of memory leaks, double frees, dangling pointers, uninitialised value or pointer use and integer overflow.

Compiling

AOS defines operators on integers such that they cannot be called if the operation would overflow. This requires ATS's constraint solver to handle large integers. The current release of ATS, "Anairiats", is unable to handle such large numbers in the constraint solver (ironically, integers in the constraint solver overflow), so included with AOS is a patch to use bignums in the constraint solver.

The ATS compiler is written in ATS, but because it translates to C, the compiler can be boot-strapped by compiling intermediate C sources. AOS's makefile contains a rule to check out (from subversion) and build a copy of the ATS compiler automatically. Run:

make compiler

in the AOS directory. Then you can compile AOS with:

make depend
make

Use make V=1 to echo commands.

Features

  • 486SX-compatible. There's no reason it shouldn't run on i386 too, but it's not tested.
  • It prints greetings to the serial port!

Booting

AOS compiles to a multiboot ELF file called, believe it or not, kernel, linked at 0x00100000. A small amount of code in start.S identity-maps the first four megabytes of physical memory, turns on paging and jumps to ATS code, which can be linked at virtual addresses different to the physical addresses (but isn't now).

Use a multiboot-compliant boot-loader such as GNU GRUB to boot AOS, or run it in QEMU with

qemu -kernel kernel
Something went wrong with that request. Please try again.