Page 1 of 1

What on earth is a realtime OS???

Posted: Wed Dec 26, 2001 7:50 am
by Peter_Vigren
Hi! My question is as simple as the subject. WHAT ON EARTH IS A REALTIME OS??? I know that QNX for example is one but I haven't found out what makes out the realtime-part... What is it that differs it from a preemptive multitasking OS?

Please let me know...

Re: What on earth is a realtime OS???

Posted: Wed Dec 26, 2001 12:28 pm
by Juddley
The term "Real Time" usually refers to the use of INT's some OS's disable the various interrupts to perform tasks. Depending on how long they are disabled you may or may not get prompt response for your request to a hardware action. I frequently hear confusion between RTOS and EMBEDDED. Not all "EMBEDDED" systems provide fast response. You also have to consider that a 4MHZ cpu with interrups disabled for 2 or 3 instructions may be equivalent to a 800mhz cpu with interrupts disabled for 200 - 300 instructions. Unfortunately a lot of the term "RTOS" is just Marketing by the companys that SELL THEM.

Normally Multi-Tasking uses INT's to service all of the fuctions of the computer at one time. IE. KBD, DISPLAY, PRN, NET, SER, USB ... and so on. Single tasking? -- KBD in> Monitor out, or some other combination, like SER in>

If you want a fabulous RTOS write in Assembly Language, Never disable interrupts. Keep overhead to a minimum. Only enable time clock functions when you call them. AND write your own!

Re: What on earth is a realtime OS???

Posted: Wed Dec 26, 2001 4:41 pm
by Chris Giese
Realtime means a task must start running and finish
by a certain deadline, usually in response to an
asynchronous event like a button being pushed.
This is not necessarily "fast", but "timely".

"Soft" realtime: late is bad. Example: fax machine.
Missed deadline could be perceived by the user as
"This stupid machine is too slow", or "I don't know
why, but sometimes you must push that button twice"

"Hard" realtime: late is wrong. Example: fly-by-wire
system. Missed deadline here could crash the plane.

Realtime OS (RTOS) is sometimes just a library of code
that can be used in an embedded system. More often, it
contains features that let a programming problem be
decomposed into tasks:

- Support for installable interrupt handlers, like the
 getvect() and setvect() functions
- Code runs with interrupts enabled as much as possible,
 so interrupts aren't missed or serviced too late
- Interrupt bottom-halves (deferred interrupt processing)
- Features for inter-process communication (IPC) and
 synchronization, such as message queues and semaphores
- Software timers and timeouts
- Preemptive multitasking
- Many (typically 256) task priority levels
- Priority inheritance. If a low-priority task holds a
 resource needed by a high-priority task, the priority
 of the low-priority task gets boosted temporarily,
 letting it run until it frees the resource needed by
 the high priority task.
- Variable time slice

Simple open-source RTOS: uC/OS: http://www.ucos-ii.com/ports_v1.htm
Complex open-source RTOS: RTEMS: http://www.rtems.com
Complex closed-source RTOS: QNX: http://www.qnx.com