Real-time operating
systems
Tuesday January 1, 2002
15:12
A forth operating system used mostly to host the Nautilus 2 forth metacompiler used for building 8085, 8051, and 8086 operating systems was tried on Sunday February 12, 2000 on windows 2000.
It worked! This is amazing since some of the video contains direct writes to video memory.
This forth was first written by Henry Neugass, later modified by Ray Duncan for Laboratory Microsystem for PC/Forth, and later a four-file version modified for the Nautilus metacompiler.
The 8051 operating system saw US government use in a cryptographic processor in a missle launch control system and the seismic data authenticator for the US/USSR comprehensive test ban treaty, and several other government projects too. Monday February 12, 2001 10:53
The forth is invoked from DOS window running on windows 2000. Here's the logon logo after typing p in the directory c:/fx. The secondary file is a terminal emulator for an 8051 forth operating system executing on an 8051. All source code is contained in 1.
This appears after the emulator is loaded with 1 SLOAD. And 8051 running forth was hooked to the windows 2000 machine through com1 serial port. And look what happned!
The 8051 logo didn't appear. After several Enter, Enter, .. the ookokook appeared on the screen. A forth operating echos 'ok' after it received a cr/lf. The real world again. Some work needs to be done to find out what the problem is and correct it. csd does this type of work. This forth 8051 operating system will work on any of the new 'C52 chips. It can be used to interactively inspect and check hardware of a usb or 1394 hub processor. The DOS window you see is the 8051's display, the keyboard, is the 8051's keyboard, and the primary file is the 8051 disk file. Uploads to the 8051 and downloads from the 8051 screen buffers currently at at 19,200 bps. But this can be replaced by usb serial communication. This forth operating system can upload assembler and high-level source code, compile and assemble it, then execute it on the 8051. |
Windows 2000 and associated products are entering the embedded systems world.
DriverWorks works very well on both 98 and win2k.
If you are doing A usually means that you are not doing B. Or if you do both usually means that you don't do either A or B as well as doing only one task.
CDS's attention is focused mostly on designing and implementing real-time wdm drivers, not doing system programmer tasks. But CSD can do system tasks if forced.
CDS uses DriverWorks and associated tools.
There are tasks which DriverWorks does, like modifying the registry, that an applications programmer does not want to spend application design and development doing.
CSD is in the process of converting some VtoolsD vxd services to wdms.
Services like software interrupt to a Visual Basic 60 application from a wdm driver are required for proper system operation. Thursday November 9, 2000 08:32
Embedded Systems Programming November 2000 page 71 |
It is always advisible to use an operating system as opposed to writing code from scratch.
Never reinvent the good work of others, unless it's too expensive to get!
Dibble should have mentioned that real time operating system may nor may not be interactive.
Interactive operating systems which host their own compilers and assemblers are preferable for hardware and software maintenance. Programming usually cannot anticipate all hardware/software failure mode. Therefore, interactive exercising of both hardware and software is usally required.
Forth is a high-reliability real-time interactive operating system which hosts it own incrememtal Forth compiler and assembler even on an 8051.
So is BASIC51.
Dibble writes
Windows programmers would be surprised to learn that RTOSs are expected to run indefinitely without re-booting.
While Dibble's comment may apply to windows 3.11, 95 and 98, it certainly
does not apply to Windows 2000 using wdm drivers.
Thursday November 9, 2000
08:06
| The role of an RTOS in an embedded system
The choice of system software affects development cost, time to market, product quality, and unit cost
BY PETER DIBBLE Most embedded systems do not use a real-time operating system (RTOS), or any commercial system software. This used to be a reasonable situation. When software was a small percentage of the engineering effort, there were better ways to spend time and money than looking for the optimum software development and deployment environment The world has changed. Now software is becoming a large part of the engineering cost of embedded systems. That makes software a likely place to look for engineering efficiencies and time- to- market improvements. Efficiency and time-to-market improvements come from good methodologies, good tools, and talented programmers. An operating system is a development tool and also part of the end product. The choice of system software affects development cost, time to market, product quality, and unit cost. It is worth a little thought.
An RTOS has two defining at tributes: it is an operating system, and it
has some measure of real-time performance. Those attributes are seldom found
together. There are dozens of operating systems, but only a few of them have
real-time characteristics. There are over a hundred real-time kernels, but
only a few RTOSs.
Os vs. tiny kernel In its most general sense, an RTOS is any software that hides the complexities of computer hardware. This covers a wide range of system software. Almost every RTOS provides threading, the illusion that the processor can do several things at the same time, and most system software offers services that wrap I/O in functions something like read(), write(), open(), and close(). System software that provides little more than threading and primitive I/O is generally called a tiny kernel. The leading commercial tiny kernels are Nucleus and the Wind kernel. An operating system is distinguished from a kernel by the protection it offers. Operating systems run applications in processes. The OS expects errors in processes, prevents processes from harming anything but themselves, and recovers smoothly when a process terminates unexpectedly. The leading real-time operating systems are OS-9, QNX, and LynxOS. What real time means Real-time software is designed for systems that care about meeting deadlines. All well-written system software cares about performance, but real-time software has more complicated goals: It should be possible to predict the execution time of the system accurately. Depending on the hardware, the allowable margin of error might be 200 µs, or 2 µs. Non-real-time operating systems sometimes wander from expected timing by a millisecond or more. It should be responsive. RTOS engineers make particular efforts to reduce both context switching and interrupt response time. It should be fast These three performance goals are in priority order. A conventional operating system would reverse the order, then nearly ignore everything but typical performance. What good is an OS? An RTOS or any operating system makes itself useful in hundreds of ways, but Ill select two: it runs binary images, and it protects them in processes. These features seem obvious to people who use operating systems and rather strange to kernel users, but supporting them goes a long way toward defining the behavior of an RTOS. Portable binaries When you buy a program for Windows, Unix, 05-9, or any less-known operating system, it comes as a binary image on a CD, or perhaps you download it from a Web site. You dont modify the source, compile it, or link it. You just copy it onto the computer and run it. That is nice for the buyer, and crucial for the software developer. The developer has to test the program as the user will run it If the final image is not determined until the application is bound to target hardware, mass marketing of software becomes impossible. This problem is less critical for embedded software than for consumer software since embedded systems often deploy software for a specific hardware configuration, hut this does not make portable binary images irrelevant: Software can be targeted to a development system while hardware is being developed. When the final hardware is ready, the software can be used without even recompiling it. This makes concurrent hardware and software development easier and improves time to market Provided that they use the same processor family and have the necessary memory and I/O resources, the same software will run across a line of similar systems. There is no need to test, inventory, and document multiple software versions for every hardware permutation. Support becomes tractable. Every customer is running a software image that is identical to the one at the support engineers desk. This degree of portability requires that the operating system hides nearly every aspect of the platform. The processor family, total amount of RAM, and general I/O complement have to be visible, but the operating system handles issues related to the location of memory, the details of the I/O, and the other software running on the platform. In most cases it will even conceal differences between processors in the same family. (You could run the same image on a 68000 and a 68060 even though they have substantially different instruction sets and architectures.) Processes Every operating system supports processes (perhaps under another name). A process gives the program using it the illusion of running on its own machine. It gets a share of the available processor time, and it is given access to other resources such as memory and I/O. Some resources are available to the process as soon as it is created, and it can request and release resources as it runs. From the embedded point of view, a process is essentially a thread with protection. This does two things: Since every resource is issued by the operating system to a specific process, it can recover resources when a process terminates. This prevents resource leaks even when processes terminate unintentionally. The operating system uses software techniques, the supervisor! user distinction in the processor instruction set, and hardware memory protection to keep accidental or malicious actions in any process from harming the operating system or any other process. This isolates problems in the process that causes them. This eases debugging, and improves time to market It also makes fault recovery easier in the field. This leads to more robust systems. RTOS vs. OS Someone accustomed to an ordinary operating system like Unix or Windows already takes the features in the previous section for granted. For them, other aspects of the embedded RTOS are more interesting: Windows programmers would be surprised to learn that RTOSs are expected to run indefinitely without re-booting. Real-time operating systems are designed for systems with much less memory than ordinary operating systems. Less than a megabyte is fine. Less than 100 Kbytes is probably not enough memory. Real-time operating systems are good at things that have to happen in a short time. They are probably a little slower at big jobs than an ordinary OS. They are designed more to respond to events very quickly. They are also generally designed to run well under very heavy load. For embedded control, real-time operating systems are often the only practical choice, especially when multiple control loops must behave predictably, with controlled priority. ELCTRONICS PRODUCTS SUPPLEMENT Fall 2000 http://www.electronicproducts.com/ |