circuitcellar.com
Magazine Support   Digital Library   Products & Services   Suppliers Directory 
 
 





 


Published March 2000

EMBED THIS PC

Lessons from the TrenchesPART 3: Emulator to the App Test
by George Martin

StartThe ProgramReal ModeGetting An App Up and RunningSources and PDF

REAL MODE

Most 486s start in operating modes that permit software written for the original PC of the early ’80s. So, this means that addressing is limited to 20 bits and that the processor is in real mode. Essentially, you have an 8086 with the 20-bit addressing of the original PCs.

Some programs relied on the addresses increasing from 00000 up to FFFFF and then rolling over to 00000, which is the 20-bit addressing limit. The real mode uses 16-bit registers such as AX, not the EAX, and the addresses are made up of a 16-bit segment with a 16-bit offset in that segment. This, of course, explains the F000:0000 notation. You’re looking at the SEGMENT:OFFSET.

No protection mechanism is supported in the CPU to prevent programs from accessing resources.

PROTECTED MODE

The other mode is called the protected mode. In the protected mode, various types of protection are offered. In this mode, one program can run independent of all others and be protected. Registers become 32 bits wide. In its simplest form, you can have one program that has all the resources of the CPU. If you’re interested in all the complexities of real and protected mode, check out the "Additional Ink Articles" sidebar for other references.

The CPU starts in real mode and then switches to protected mode. If you’re running an RTOS, you can find startup code that does this switch. Once the PDREMOTE software is loaded and running, the Paradigm design environment connects to the PDREMOTE software with some configuration of the environment. I used the parallel port to communicate between the development PC and the PromIce device. With this, I have a real emulator that can inspect the CPU, memory, and I/O just like an expensive hardware emulator solution.

Next, you need to create an application that you load and debug. Let’s look at creating a real- mode application that can be loaded and run with the debugger.

PREVIOUSNEXT


Circuit Cellar provides up-to-date information for engineers. Visit www.circuitcellar.com for more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com or subscribe online. ©Circuit Cellar, the Magazine for Computer Applications. Posted with permission.