CS452 - Real-Time Programming - Fall 2011

Lecture 4 - Tasks

Pubilc Service Annoucements

  1. Partners
  2. Work off campus: IPAQ

The Hardware

Three suppliers

The hardware used in the course depends mainly on three suppliers

  1. ARM: design firm that provides the architecture plus either wire-list or masks
  2. Cirrus: chip manufacturer that integrates other elements with CPU to create the SoC, which contains
  3. Technologic: system manufacturer, who creates a circuit board, supplies memory (DRAM & flash RAM), puts connectors on a box, and puts the circuit board into the box.

TS-7200

`COM' ports

Connected to UARTs

Only really two

Ethernet port

IP number of the box is static, part of the configuration maintained in Flash memory.

Reset switch

Documentation says the switch is black, but on some boxes it's red.

Memory

Byte addressable, word size 32 bits

RedBoot

In Flash RAM

EP-9302

System on chip

System busses

Advanced high-speed bus (AHB)

AHB connects

Advanced peripheral bus (APB)

ARM 920T with v4 Instruction Set


Kernel of a Real-time Operating System

Microkernels

The real-time operating system we build consists of

  1. an uninterruptible microkernel, plus
  2. interruptible device-handling server tasks that run in user-space with permissions allowing them to access hardware.

What Does a Microkernel Provide?

Tasks

Program is conceived as a collection of co-operating tasks

What is a task?

  1. A set of instructions
  2. Current state, which is changed by executing instructions, which includes

Two tasks can use the same set of instructions, but

The kernel keeps track of every task's state

The TD normally contains

  1. The task's stack pointer, which points to a private stack, in the memory of the task, containing

    all ready to be reloaded whenever the task next runs.

  2. Possibly the return value for when the task is next activated
  3. The task's parent
  4. The task's state
  5. Links to queues on which the task is located

Possible states of the task

  1. Active: running or about to run
  2. Ready: can run if scheduled
  3. Blocked: waiting for something to happen

How tasks work together

Why are tasks important?

Communication

Communication has two aspects

  1. sharing information, requesting service
  2. synchronization

We use Send/Receive/Reply (SRR) to do both.

  1. Send blocks
  2. Receive blocks: is synchronous with the call to send
  3. Reply doesn't block: is synchronous with the return from send

Synchronization

  1. Between tasks
  2. With internal events
  3. With external events

Interrupts

Input from the outside world

  1. Provide the information you polled for
  2. ISR OS design, which is essentially a jump table, which separates testing from acting
    interrupt entry point:
        calculate action_entry_point;
        jump to act_entry_point;
    entry_point1:
        action1;
    entry_point2:
        action2;
    ...
    entry_pointn:
        actionn;

    These are the same actions you implemented in your polling loop,


Kernel Structure

The kernel is just a function like any other, but which runs forever.

kernel( ) {
  initialize( );  // includes starting the first user task
  FOREVER {
    request = getNextRequest( );
    handle( request );
  }
}

Where is the OS?

one type of request creates a task

There needs to be a first task that gets everything going


Return to: