
October 13 1995, Draft 1
353
Chapter 7 Software Debugging
ister
gr121
, if this number is less than 256 then MonTIP must assist. A request for
MonTIP assistance, to say, open a file for writing, is accomplished by the operating
system sending a MiniMON29K message to the TIP process. There are currently
three types of messages used by the OS: HIF–request, CHANNEL1 (used when
printing to
stdout
), and CHANNEL0_ACK (used when acknowledging data from
stdin
). Note, it is easy to extend the operating system message system usage and
create new operating system message types. This may be useful if virtual memory
paging was being supported by an operating system, where the MonTIP was acting as
the secondary memory controller.
MonTIP replies to HIF MiniMON29K messages by sending messages to the
DebugCore to accomplish the requested task. It then sends a HIF_ACK message to
the operating system acknowledging the completion of the requested service.
CHANNEL1 and CHANNEL0 messages are used by the operating system to
support display and keyboard data passing between the application program and the
user. Note these are the only operating system messages which the MonTIP passes
via UDI to the MonDFE process. MonTIP responds to
stdout
service requests with
CHANNEL1_ACK message, and supplies new keyboard input characters with a
CHANNEL0 message sent to the operating system. (Note, some early versions of
MonTIP did not make use of the operating system *_ACK messages, they used the
DebugCore instead. This created difficulties for multitasking operating systems. If
you have this problem, you need to update your MonTIP program.)
Previously, the OS–boot implementation entered Wait mode after issuing a
MiniMON29K message. This is accomplished by setting the WM bit in the OPS reg-
ister before using an IRET to
return
to application code from the HIF trap handler.
Wait mode is exited when the message system interrupts the operating system in re-
sponse to a MonTIP reply–message to the operating system. Because Wait mode is
used OS–boot must run with interrupts turned on. However, the MiniMON29K De-
bugCore has no such restriction and can operate in a poll–mode fashion. Recent ver-
sions of OS–boot can also operate the message system in poll–mode and need not
have interrupts
permanently
enabled. The latest OS–boot code no longer uses Wait
mode while waiting for a message system interrupt. Either the message system or a
flag variable is continually polled. The flag being set by the message system interrupt
handler which previously cleared the WM bit.
7.4.4 Adding New Device Drivers
OS–boot is a very simple operating system and it does not offer support for addi-
tional I/O devices. However, the HIF specification states that file descriptors 0,1 and
2 are assigned to: standard in, standard out and standard error. Normally any open()
library calls issued by an application program will result in the HIF
open
service re-
turning a new file descriptor for a file maintained on the TIP host by MonTIP.