Você está na página 1de 3

Review Questions for Chapter 4

4.1 Since the Palm processor can only have one program on the display at a
time, why does the system need a multiprocessing OS?
a. There are other tasks that also can be running. The irst is the
handwriting recogni!er "in two parts# that replaces the keyboard ound
on a P$. %nother e&ample is a background communication process
that can be checking email or synchroni!ing data or programs with a
P$ or backup purposes.
4.' Outside o a slow processor and airly small memories compared to modern
systems, what is the most unusual part o the basic hardware design that the
OS is based on?
a. There is no secondary storage. %s was mentioned, disk storage
devices are available, but they are not presumed to be present by the
OS, and i they are present they are not used or many o the unctions
that they would be used or in a normal OS.
4.( )s the Palm OS a microkernel or a monolithic kernel?
a. The Palm OS is a microkernel design. )t has several clearly deined
layers and only the very basic eatures are in the protected mode
portion o the kernel.
4.4 *hat does the Palm OS use a real+time kernel or?
a. The primary real+time task is handwriting recognition. %nother
important real+time task is communication.
4., *hat is the basic logic low o most applications?
a. They recogni!e the irst time they are being invoked and they initiali!e
any iles "databases# they use. Then they all into a loop that does
nothing but burn $P- cycles waiting or something to happen. .ost
oten that something is user input. The program will respond to the
input and go back into the wait loop.
4./ *hy is memory allocated to a process accessed indirectly through the .PT?
a. So that there is an orderly way or the OS to relocate the allocated data
during garbage collection such that the program does not have to be
speciically inormed that the data has been moved. $hanging the
pointer is suicient to redirect the access o the program.
4.0 1ow does the OS track ree memory?
a. .emory chunks are tracked through the .aster Pointer Table, or .PT.
$hunks are marked as being in 2use or ree. )nitially all o the space
available to a program is a single ree chunk. %s memory is allocated a
single ree chunk may be used it it is the right si!e. Otherwise a larger
chunk is split into two pieces. % new .PT entry is created or the
unused part and marked as being ree.
4.3 %s is typical in much o inormation system technology, the developers o the
Palm OS overloaded a perectly good term with a dierent meaning. *hat
does the Palm OS documentation mean when it reers to a 4database5.
a. % database is 6ust what we would call a ile on any other OS.
4.7 $onsidering that the Palm platorms do not have much memory, why do they
typically not use compression on the databases?
a. $ompression takes $P- power, something that is lacking in most
Palm hardware. )n addition, on most computers the secondary storage
is a rotating memory and takes substantial time to access.
$ompression can make this access aster since less data is being
transerred. 8ut the compression can be hidden by the time re9uired to
access the drive. )n the Palm systems there is no secondary storage
so there is no latency to hide the compression.
4.1: The Palm OS gives the programmer several abstractions or );O so that
the application programmer did not have to worry about the hardware details.
*hat were some o the abstractions that were mentioned?
a. *e speciically mentioned stdin, stdout and stderr with respect to the
keyboard. %nother good answer would be the abstraction o a ile.
4.11 True or alse? The screens are memory mapped rather than handled by
);O instructions so most applications directly move data to the screen area in
memory.
a. <alse. There are so many dierent types o screens 2 dierent
resolutions, color versus 8;*, color depth "i any# that an application
would be hard put to deal with all the variations. )n addition, the uture
no doubt holds even more variety and the methods o supporting them
would be impossible to predict. %pplication programmers are strongly
advised to use the OS services to write to the screen. O course, there
is always strong pressure or the application to perorm better so
programmers oten take the shortcut o bypassing the OS and going
directly to the hardware. Then release ive comes out, assuming a
dierent $P-, and all those tweaks that worked beore don=t work>
%ngry users start calling the support line. <inancials go to pot. 1eads
roll.
4.1' 8riely describe event driven programming.
a. Separate controls are deined by the application and then a system call
is made to the OS to display the control. The OS displays the control
and the user begins to interact with it. 4?vents5 happen when the user
takes some speciic action on the control such as tapping a certain
button. The application is then asynchronously called with the
inormation that this event has occurred. The application can then
make decisions and take appropriate actions on the inormation. This
mechanism allows the application to turn over the unction o handling
the details o the control at the @-) level, remain idle in the
background, and wait until the OS tells it there is something to do.
4.1( 1ow does an application programmer draw the orms that he wants to
display on the screen?
a. @enerally he doesn=t. <or most controls the programmer simply ills in
a structure that is deined or the options and methods o the standard
OS+supported controls. The OS will draw the ob6ect, ill in the desired
te&t, and take the deault actions or invoke the programmer=s override
actions or the various events. Special controls or animated controls
can be developed, but they are not the norm.

Você também pode gostar