Applied operating system - an operating system kernel written in the ATS programming language.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
prelude Add a polymorphic stream type for writing strings to. Mar 29, 2012
.gitignore Add long long integer types (llong, ullong) Mar 29, 2012
COPYING Add GPLv3 (COPYING). Mar 29, 2012
Makefile Add a polymorphic stream type for writing strings to. Mar 29, 2012
README.md Add a hopefully informative README.md. Mar 29, 2012
ats-anairiats-bignums.patch Add automatic compiler bootstrapping. Mar 29, 2012
ats_basics.h It prints and scrolls. Mar 29, 2012
ats_config.h It prints and scrolls. Mar 29, 2012
ats_exception.h It prints and scrolls. Mar 29, 2012
ats_memory.h Add a polymorphic stream type for writing strings to. Mar 29, 2012
ats_types.h Add a polymorphic stream type for writing strings to. Mar 29, 2012
bitflags.dats Print some information from the boot loader. Mar 29, 2012
bitflags.sats Print some information from the boot loader. Mar 29, 2012
boot.dats Add a polymorphic stream type for writing strings to. Mar 29, 2012
bounded_strings.dats Add a polymorphic stream type for writing strings to. Mar 29, 2012
bounded_strings.sats Add a polymorphic stream type for writing strings to. Mar 29, 2012
enablable.dats Trace to serial port. Mar 29, 2012
enablable.sats Trace to serial port. Mar 29, 2012
gdt.dats Interrupt handling. Mar 29, 2012
gdt.sats Set up GDT. Mar 29, 2012
gen_integer.lua Add shr functions Mar 29, 2012
interrupts.dats Eliminate the uniformly sized isrs. Mar 29, 2012
interrupts.sats Interrupt handling. Mar 29, 2012
isr.S Eliminate the uniformly sized isrs. Mar 29, 2012
kernel.ld Don't put kernel at 3G; there's no need. Mar 29, 2012
multiboot.sats Print some information from the boot loader. Mar 29, 2012
portio.dats Print some information from the boot loader. Mar 29, 2012
portio.sats Print some information from the boot loader. Mar 29, 2012
serial.dats Print some information from the boot loader. Mar 29, 2012
serial.sats Print some information from the boot loader. Mar 29, 2012
start.S Don't put kernel at 3G; there's no need. Mar 29, 2012
streams.dats Add a polymorphic stream type for writing strings to. Mar 29, 2012
streams.sats Add a polymorphic stream type for writing strings to. Mar 29, 2012
trace.dats Print some information from the boot loader. Mar 29, 2012
trace.sats Print some information from the boot loader. Mar 29, 2012
vga-text.dats Automatically generate integer.sats Mar 29, 2012
vga-text.sats Code clean-up. Mar 29, 2012

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] (http://www.gnu.org/software/grub/manual/multiboot/multiboot.html) 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] (http://www.gnu.org/software/grub/) to boot AOS, or run it in QEMU with

qemu -kernel kernel