projects‎ > ‎School‎ > ‎

realtimesystems

I took a course in Real-Time Operating Systems in the fall of 2008. The class was given by Dr Wilde. The text used was An Embedded Software Primer, Simon, David E.

Some of the course goals were:
  • The ability to apply C and assembly programming languages and knowledge of the hardware/software interface to the design and implementation of a real-time kernel.
  • The ability to design and implement a real-time application.
  • The ability to design and implement a real-time kernel.
  • The ability to use C programs, compilers, and debuggers in the design and implementation of real-time application software.
  • The ability to write interrupt service routines.
  • The ability to use a real-time operating system as a tool in the development of real-time application software.
All the class projects were run inside the YAK Kernel.

Some of the popular topics covered in class were: Interrupts, ISRs, Scheduling, Re-entrantcy, Semaphores, Events, Message Queues, Event Flags. Below are some short explanations of methods and routines we implemented in our RTOS kernel.
  • YKInitialize - Initializes all required kernel data structures
  • YKNewTask - Creates a new task
  • YKRun - Starts actual execution of user code
  • YKDelayTask - Delays a task for specified number of clock ticks
  • YKEnterMutex - Disables interrupts
  • YKExitMutex - Enables interrupts
  • YKEnterISR - Called on entry to ISR
  • YKExitISR - Called on exit from ISR
  • YKScheduler - Determines the highest priority ready task
  • YKDispatcher - Begins or resumes execution of the next task
  • YKTickHandler - The kernel's timer tick interrupt handler
  • YKCtxSwCount - Global variable tracking context switches
  • YKIdleCount - Global variable used by idle task
  • YKTickNum - Global variable incremented by tick handler
  • YKEnterMutex - Disables interrupts
  • YKExitMutex - Enables interrupts
  • YKIdleTask - Kernel's idle task
  • YKNewTask - Creates a new task
  • YKRun - Starts actual execution of user code
  • YKScheduler - Determines the highest priority ready task
  • YKDispatcher - Begins or resumes execution of the next task
  • YKCtxSwCount - Global variable that tracks context switches
  • YKIdleCount - Global variable incremented by idle task
  • YKDelayTask - Delays a task for specified number of clock ticks
  • YKEnterISR - Called on entry to ISR
  • YKExitISR - Called on exit from ISR
  • YKTickHandler - The kernel's timer tick interrupt handler
  • YKTickNum - Global variable incremented by the kernel's tick handler
  • YKSemCreate - Create and initialize a semaphore
  • YKSemPend - Obtain a semaphore
  • YKSemPost - Release a semaphore
  • YKQCreate - Create and initialize a message queue
  • YKQPend - Obtain the oldest message from a queue
  • YKQPost - Append a message to a queue
At the end of the course we had the chance to run a simple Tetris like game on our kernel to test it's stability The spec was "your code must clear at least 200 lines at the default tick frequency (a tick every 10,000 instructions)." Despite receiving these constant interrupts the kernel kept the games memory stack intact and ran at the mentioned interrupt frequency!
Comments