Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
PAGE 30<br />
specify the file your are looking for,<br />
you "prefix" it with the names of<br />
the directories it is contained in.<br />
Prefixes can get pretty long if you<br />
choose to build up a hierarchy of<br />
directories. For convenience, SOS<br />
will keep track of the prefix for the<br />
directory you are using at a particular<br />
time. So if you have a file<br />
named "X" contained in directory<br />
" Y" which is contained in directory<br />
" Z" you could specify the file as<br />
"Z/Y I X" or you ca n tell SOS that<br />
the prefix is "/Z/Y!" and simply<br />
refer to file "X". Sound complicated<br />
Well, you'll just have to try it.<br />
You' ll like it. All languages on the<br />
<strong>Apple</strong> 111 access files through the<br />
SOS file system, so you'll only need<br />
to learn it once. Some languages<br />
have minor differences from the<br />
general file specification described<br />
here. Pascal, for instance, uses ":"<br />
instead of"!".<br />
So much for how to specify files,<br />
now what can you do with them<br />
SOS can be asked to perform the<br />
following functions: CREATE either<br />
a file or a directory, DESTROY a file<br />
or a directory, RENAME a file,<br />
OPEN, CLOSE, READ, or WRITE to a<br />
file, plus calls to set the currrent<br />
position in a file or end of file . . .<br />
You can SET and READ PREFIX, ask<br />
for file INFO, and FLUSH ... a file<br />
buffer, that is.<br />
In short, the SOS file management<br />
interface provides a set of<br />
high level capabilities accessable<br />
directly via assembly language, or<br />
at a very high level through the<br />
languages on the <strong>Apple</strong> Ill. Each<br />
language will have its own convention<br />
for using these capabilities,<br />
but SOS allows a very high level of<br />
consistency.<br />
Device Management Interface<br />
SOS also provides a lower level<br />
access to devices. Although this<br />
level of control is more primitive,<br />
it is useful where more performance<br />
is required. At this level, the<br />
file concepts are stripped away, and<br />
the caller has immediate access to<br />
the device drivers for any devices<br />
configured into the operating<br />
system. As a matter of fact, the high<br />
level ca lls just described are implemented<br />
using these calls!<br />
SOS is a configurable operating<br />
system. Each device on the system is<br />
supported by a set of routines that<br />
can be added to or removed from<br />
the operating system using the<br />
THE APPLE ORCHARD<br />
System Configuration Program<br />
supplied with SOS. Every SOS<br />
"boot" disk contains a file named<br />
SOS.DRIVERS. The driver contains<br />
the necessary information to control<br />
a particular kind of device.<br />
All devices known to the<br />
operating system are controlled by<br />
a device handler and if necessary,<br />
an interrupt handler. The device<br />
handler for a device contains up to<br />
six distinct modules: OPEN, CLOSE,<br />
READ, WRITE, CONTROL, and<br />
STATUS. The modules associated<br />
with each device are direC:tly callable<br />
by the SOS user through the<br />
Device Management System.<br />
Memory Management Interface<br />
Many have asked the inevitable<br />
question: " How does the <strong>Apple</strong> Ill<br />
address more than 64K bytes of<br />
memory with a 6502." The answer<br />
encompasses both hardware and<br />
software on the <strong>Apple</strong> 111.<br />
<strong>Apple</strong> 111 memory hardware<br />
provides two capabilities toward<br />
this end: bank switching and zero<br />
page switching. Thus, the amount<br />
of RAM memory in the system can<br />
extend beyond 64K bytes, and each<br />
code module or set of modules can<br />
have its own zero page.<br />
<strong>Apple</strong> 111 has three bank<br />
switches, a main bank switch, an 1/ 0<br />
bank switch, and a ROM bank<br />
switch. The main switch selects the<br />
chunk of RAM that will sit in the 8K-<br />
40K address range. The 1/ 0 switch<br />
ca n select between the hardware<br />
1/ 0 bank or a 4k RAM bank, and<br />
finally, the ROM bank switch<br />
selects between a 4k ROM bank or<br />
another 4k RAM bank.<br />
SOS's role is to manage both the<br />
bank switching and zero page<br />
select in a manner that reduces the<br />
apparent complexity of the<br />
memory as the operating system<br />
user views it. This is provided in the<br />
form of a bookkeeping mechanism<br />
for allocating and deallocating<br />
chunks of memory. The REQUEST<br />
SEG system call asks SOS to request<br />
a specific portion of memory. If the<br />
user doesn't care where the<br />
memory is located, he ca n simply<br />
FIND SEG. SOS will search for a free<br />
chunk of memory of the specified<br />
si ze, and assign it. The user can later<br />
expand this chunk of memory.<br />
When a program has finished using<br />
its assigned memory, it assigns it<br />
back to the free space pool using<br />
the RELEASE cal l.<br />
FALL <strong>1980</strong><br />
Several other calls are provided<br />
to obtain information on t he allocation<br />
of memory. The memory<br />
management system may seem to<br />
provide more capability that most<br />
programmers need. However, by<br />
allocating memory through the<br />
operating system, a programmer<br />
will never have to worry about<br />
another module in the system<br />
interfacing with his memory space,<br />
almost as if the <strong>Apple</strong> 111 had<br />
"virtual" memory.<br />
Interrupt Management<br />
One of the most complex aspects<br />
of writing 1/ 0 intensive programs is<br />
the handling of interrupts. SOS<br />
relieves the program of this difficult<br />
task by providing two types of<br />
interrupt management. The first is a<br />
· peripheral interrupt. These<br />
interrupts are handled entirely by<br />
SOS and its comtituent device<br />
drivers. These device drivers must<br />
be designed with great ca re since<br />
they are literally part of the operating<br />
system itself and because of<br />
danger of data overrun due to critica<br />
l timing constraints. Fortunately,<br />
device drivers with thoroughly<br />
tested interrupt handlers are<br />
provided with SOS for all the builtin<br />
devices on the <strong>Apple</strong> 111.<br />
A new kind of user software<br />
interrupt mechanism has been<br />
provided to allow user programs<br />
some asynchronous capabilities<br />
without interfering with the ability<br />
of SOS to deal with true peripheral<br />
interrupts. These are, of course, at a<br />
lower priority level than the peripheral<br />
interrupts.<br />
A user software interrupt usually<br />
corresponds to a similar peripheral<br />
interrupt. For example, a user<br />
software interrupt on the<br />
CONSOLE device would probably<br />
correspond to an interrupt on the<br />
<strong>Apple</strong> 111 keyboard.<br />
Associated with each distinct<br />
user software interrupt is a portion<br />
of the user code called an interrupt<br />
handler which processes the interrupt.<br />
Each interrupt is also assigned<br />
a priority level from 0 to 255 used to<br />
dete rmine the order that<br />
simultaneous inte rrupts are<br />
handled .<br />
A number of SOS calls are provided<br />
to take advantage of the user<br />
interrupt facility. These calls al low<br />
the user to install and remove<br />
various interrupt handlers, set<br />
interrupt priority level, and exit