|
by Bob
Perrin
Start ý Selecting
an Embedded PC ý Hello World ý Controlling
Resources ý Thank You, Intel ý Sources
and PDF
THANK YOU, INTEL
The code in Listing 1 uses the MK_FP
macro to initialize the pointers. MK_FP accepts two parameters:
a SEGMENT and an OFFSET. Some people may not be clear on exactly what
these parameters are. Allow me to explain.
For some reason, back in the 1980s, Intel
decided that having a memory space accessed by a single 20-bit address
register was not the most optimal method. Nevermind the fact that
Motorola's MC68000 family had a 24-bit address space accessed by using
32-bit internal address registers (the most significant 8 bits were
not put out on the external 24-bit address bus). Instead, Intel decided
to use two 16-bit values (a SEGMENT and an OFFSET) to compute a 20-bit
physical address.
The computation is simple. Left shift
the SEGMENT a nibble and add it to the OFFSET. The least significant
20 bits of the sum comprise the physical address. Although that all
seems pretty easy, consider that there is no longer only one unique
representation of a physical address. As long as the bits in the SEGMENT
and OFFSET values add to the desired 20-bit sum, that combination
of SEGMENT and OFFSET registers is a legitimate representation of
the physical address.
Figure 1
shows how the SEGMENT and OFFSET are aligned to compute a physical
address.
My
understanding of Intel's reasoning for this scheme was that the SEGMENT/OFFSET
method would make multitasking easier. Segments could be assigned
to separate tasks and, when required, segments could overlap. Unfortunately,
15 years later we still have to live with the legacy of this kooky
idea.
APPLICATION TERMINATED
Embedded PCs can seem a bit intimidating
at first look, but like most things, once you have one on your desk
to play with, the mist lifts and the picture becomes clear. Starting
with a simple board and taking things one step at a time makes the
learning easier. The bottom line seems to be, if you can write a bit
of code in C and can read a datasheet, you can use an embedded PC.
PREVIOUS
NEXT
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.
|