COrnell Miniature ATmel Operating System (COMATOS)

By Ben Greenblatt




Welcome to COrnell Miniature ATmel Operating System (COMATOS), a simple, non-preemptive real-time operating system for the Atmel AT90S8515 and related microcontrollers. This site documents the internal workings of COMATOS and provides instruction in programming for the operating system.

Basic Features:

Basic Rules

Programming under an OS is dramatically different from programming a foreground-background system. Tasks in COMATOS are basically subroutines. Each task is created using a special OS call, OSCreateTask. A scheduler runs routinely to determine which tasks are eligible to run. Since this is a non-preemptive operating system, it is the responsibility of the task to return control to the OS. Many larger operating systems preserve the state of all of the registers for each task, effectively giving each process its own register set. Because the AT90S8515 only has 512 bytes of SRAM, storing all of the registers is infeasible. As a result, the state of the registers is not preserved between runs of a task. Several options are available for storing state. First, tasks can send messages to one another containing information. Secondly, each task has a byte of memory, called PCBState, in which to store state information. Finally, dynamically changing the address at which execution of a task begins, through the OSSetEntryPt call, allows for execution of different code depending on the state of the task.

I recommend examining this documentation, especially the Application Programmer's Interface and the tutorial before beginning to code for COMATOS.



Questions? Contact Ben Greenblatt
Copyright 1999 Benjamin M. Greenblatt