Write Emulator-Friendly Linux Code
By Peter Seebach2005-04-16
Full Hardware Emulators
A full hardware emulator simulates an entire machine; not just the processor but the rest of the machine as well. For instance, an emulated computer will act as though it has its own keyboard controller and video card.
Full hardware emulation is especially common for accessing older-machine programs. A popular example is the MAME arcade game emulator, which emulates the hardware of various old arcade machines.
Full hardware emulators are in some ways the simplest way to do emulation. A lot of work goes into building a full hardware emulator, but once you've got it, everything should just work. For instance, VirtualPC on the Macintosh started supporting Linux in version 3.
Hardware emulation can get you around problems you can't easily bypass otherwise. For instance, I once had a BIOS flash utility that was distributed only in the format of a self-extracting image file for DOS. Worse, it only ran on a machine with an actual floppy on a traditional ISA floppy controller (my Windows desktop machine had an LS-120 drive). Emulation to the rescue! I ran the program under an emulator, writing the data to a USB floppy drive plugged into a Mac.
Hardware emulation has its downside, too. A lot of effort goes into making everything work. If you want a network, you need to emulate a network chip well enough for the operating system to run on it. Furthermore, emulating foreign instructions can be very expensive. Often, a system like this will work nearly perfectly, but timing-related functionality may be unreliable.
Full hardware emulators have been in use for a long time, at their best for handling legacy systems and code that can take the speed hit from emulation.
Nonetheless, users who want to run x86 Linux binaries on a Macintosh or any other non-x86 machine may well rely on one of the currently available x86 emulators to try to get it running. Most utility programs will run perfectly well (if slowly, perhaps) on systems like this. The only major concern to worry about is that users of such systems may install smaller or older Linux distributions in the hopes of improving performance. Someone running an emulated machine with 32 MB of memory is unlikely to run the latest version of KDE.
Tutorial Pages:
» A Developer's Guide to Linux Emulators and How They Operate
» The Basic Emulator
» Emulators as a Distribution Format
» Full Hardware Emulators
» Partial Hardware Emulators
» Software Emulators
» Like Normal Development, Only More So
» Resources
First published by IBM DeveloperWorks
| Related Tutorials: » How to Install PHP 5 on Linux » How to Install Apache 2 on Linux » How to Install MySQL 5.0 on Linux » SMB Caching » Mound --Bind » Tar Wild Card Interpretation |
