- Main Page
- Modules
- Data Structures
- Files

# pico]OS - Real Time Operating System

### 1.0.0

Table Of Contents

- Overview
  - Features
  - Available Ports
  - Files
  - License

- Introduction
  - The Layer Scheme
  - pico]OS Porting Information
  - Debug Features
  - Make Environment

- Configuration
  - Pico Layer
    - Architecture / CPU Specific Settings
    - Code Style
    - Disable / Enable Interrupts
    - Features
    - Generic Findbit
    - Nano Layer Port
    - OS Core Settings
  - Nano Layer
    - Abstracted Functions
    - Bottom Halfs
    - Console I/O
    - CPU Usage
    - Dynamic Memory Management
    - Registry

- User API Function Reference
  - Pico Layer
    - Atomic Variables
    - Error Codes
    - Flag Functions
    - Lists
    - Message Box Functions
    - Mutex Functions
    - Semaphore Functions
    - Software Interrupt Functions
    - Task Control Functions
    - Timer Functions
  - Nano Layer
    - Abstracted Functions
      - Flag Functions
      - Message Box Functions
      - Mutex Functions
      - Semaphore Functions
      - Task Control Functions
      - Timer Functions
    - Bottom Halfs
    - Console Input / Output
    - CPU Usage Calculation
    - Nano Layer Initialization
    - Memory Management
    - Registry

## Overview

pico]OS is a highly configurable and very fast real time operating system. It targets a wide range of architectures, from the small 8 bit processors with very low memory till huge architectures like 32 bit processors with lots of memory.

### Features

pico]OS is currently divided into two layer. The pico-layer (the core of the operating system) includes this features:

Scheduler:

- two modes: standard priority based or round robin
- preemptive multitasking
- max. 64 tasks on 8 bit processors, max. 1024 tasks on 32 bit processors
- round robin: max. 8 priority level on 8 bit processors, max. 32 priority level on 32 bit processors

Events:

- the number of events is unlimited
- semaphores
- mutexes
- flag events

Message Boxes:

- one built in message box per task
- unlimited box size, messages are collected
- messages can be pointers or huge buffers

Timer:

- autonomous running timer, the system timer interrupt is used as timebase
- timer can work in one shot mode or in auto reload mode
- when a timer expires, it triggers a semaphore event

Software Interrupts:

- up to 256 simulated software interrupts on 8 bit processors
- can be used to interface fast hardware interrupts outside the scope of pico]OS to the operating system

Miscellaneous:

- atomic variables
- blocking and nonblocking lists
- debugging support allows access to internal structures

The optional nano-layer supports:

- Bottom Halfs for interrupt service routines
- Multitasking able console I/O
- Multitasking able dynamic memory management
- Standardized API for easier task creation
- Named tasks, semaphores, mutexes and timer
- CPU usage measurement

### Available Ports

Currently, ports to the following platforms are available:

- Intel 80x86 in real mode, the executable is loadable from DOS
- MS Windows 32bit port, usefull for software development and debugging
- 6502 / 65c02 / 6510 series, port for Commodore 64 available. Minimum configuration (4 tasks): 4.6kb code, 4.7kb data
- PowerPC: IBM PPC440 (GNU C and MetaWare compiler supported)
- AVR (ATMega, GNU C compiler supported)
- ARM: SAMSUNG S3C2510A CPU (ARM940T core), Philips LPC ARM chips

### Files

The pico]OS Real Time Operating System consists of only a couple of files:

- picoos.h
  - This header is the interface to the operating system. It is included by the pico]OS core and must also be included by user applications.
- poscfg.h
  - pico]OS configuration file. Must be supplied by the user.
- noscfg.h
  - nano layer configuration file. Must be supplied by the user.
- port.h
  - Configuration file for the port. Must be supplied by the user / port developer.
- picoos.c
  - The pico]OS core source file. This is the operating system.
- n_xxxx.c
  - The nano layer source files.
- fbit_gen.c
  - This file implements a set of generic "findbit" functions. The "findbit" function is needed by the operating system. The user may support its own "findbit" function to increase performance on a particular architecture.
- arch_c.c
  - User supplied file. This is the architecture specific C-code of the platform port.
- arch_a.asm
  - User supplied file (optional). This is the architecture specific assembler code of the platform port.

## License

Copyright (c) 2004-2006, Dennis Kuschel.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

## Contact Information

Dennis Kuschel
Emanuel-Backhaus-Strasse 20
28277 Bremen
GERMANY

mail: dennis_k@freenet.de
web: http://picoos.sourceforge.net

(C) 2004-2006 Dennis Kuschel