An operating system with everything built custom.
Find a file
2016-04-26 19:11:01 +02:00
asm Adds dynamic.h and dynamic.S creating a dynamic call utility. 2015-08-14 23:53:51 +02:00
conductance Refreshes some files to fit refactorings. 2015-10-21 21:32:14 +02:00
csl Removes casts.?pp and moves it to Electronics. 2015-10-17 00:33:57 +02:00
include Moves ker/ to ker-project. 2015-11-20 12:28:29 +01:00
scripts Refreshes some files to fit refactorings. 2015-10-21 21:32:14 +02:00
src Refreshes some files to fit refactorings. 2015-10-21 21:32:14 +02:00
.gitignore Adds native code invoke unit. 2015-08-14 11:58:16 +02:00
CircuitOS.img Adds floppy image. 2015-10-20 23:48:36 +02:00
Depfile Adds starting processes via multiboot modules. Removes built-in module. Splits main.cu in main.cu and keyboard.cu. 2015-10-16 14:05:37 +02:00
kernel.ld Fixes bug: .dtors must be .fini_array. 2015-10-14 21:09:34 +02:00
keyboard-to-input.cu Adds use of USE standard; Adds example file for object interaction. 2015-10-17 10:36:46 +02:00
LICENSE initial release. 2015-08-09 02:42:56 +02:00
Makefile Make the makefile clone ker 2016-04-26 19:11:01 +02:00
mboot.c32 Adds floppy image. 2015-10-20 23:48:36 +02:00
README.md Small change in main.spark:irq 2015-10-08 00:35:57 +02:00
syslinux.cfg Adds floppy image. 2015-10-20 23:48:36 +02:00
traceback.lua Adds traceback tool. Fixes lots of memory leaks. 2015-10-12 14:32:38 +02:00
trainOS.pro Moves ker/ to ker-project. 2015-11-20 12:28:29 +01:00
trainscript.md initial release. 2015-08-09 02:42:56 +02:00

trainOS

Description

An operating system built around the language "trainscript" which is used to execute all user code in a virtual machine.

Current status:

The vm can execute some code and is able to call native code. Also it leaks memory. A lot of memory.

Screenshots

![Screenshot of current version] (http://s.mq32.de/?x6a3)

Todo List

  • Fix memory leaks
  • Validation code leaks memory
  • ???
  • Improve virtual machine / trainScript
  • Add support for feature restriction
  • Add variable modifier SHARED: C/C++ static counterpart
  • Add JIT compiler with thunkers
  • Improve kernel
  • Add support for "delegates" (callback + state): `void callback(void *state)

Guidlines

  • Calls to die or die_extra should follow the following scheme: ContextName.ErrorName

Kernel Architecture

The kernel is a simple kernel that does not utilize paging. It has simple interrupt management where an interrupt handler can be registerd for each interrupt.

Bootstrapping

  1. Setup 16 kB stack space
  2. Clear screen and print boot message
  3. Initialize physical memory management (page allocator)
  4. Initialize interrupts
  5. Enable hardware interrupts
  6. Initialize timer
  7. Initialize C++ support
  8. Register status bar timer callback
  9. Start virtual machine (and run OS)
  10. Disable hardware interrupts
  11. Print stop message

Memory Allocation

The kernel features a simple malloc structure that allocates memor between 0x400000 and 0x800000 (4 MB heap space).

The allocator can be configured to "secure" its allocation list with a magic number by defining USE_MAGIC_SECURED_MALLOC in config.h.

It also features a surveillance mode that logs all allocations / frees. It can be enabled by defining USE_VERBOSE_MALLOC and USE_VERBOSE_FREE in config.h.

Interrupt Mapping

Number Interrupt
0x00 - 0x1F System Interrupts
0x20 - 0x27 IRQ0 - IRQ7
0x28 - 0x2F IRQ8 - IRQ15