home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
OSK
/
MISC
/
mtp.shar
/
ReadMe
< prev
Wrap
Text File
|
2009-11-06
|
4KB
|
89 lines
================
OPERATION OF MTP
================
The OS-9 end is the server and the Sun end is the client.
The OS-9 system launches the daemon mtpd which creates a sokect listening at
the port MTP_PORT.
When mtp is started on the Sun, it creates a socket and connects to MTP_PORT on
the OS-9 system.
mtpd accepts the connection and forks a copy of mtpdc to handle the connection.
mtpd then closes its compy of the connection and listens for another
connection.
mtpdc interacts with the Sun programme mtp. Upon being forked it closes its
copy of the master socket and then writes an acknowledge code into the socket.
mtp waits till it receives the acknowledge code before continuing.
[HAVE TO HANDLE THE CASE WHEN NONE ARRIVES]
Interaction is then via a 1 byte code which specifies the action. Following
bytes are code dependent. OS-9 acknowledges when it is finished (or ready) with
the acknowledge code.
CODES
-----
ACKNOWLEDGE 'a' Sent by OS-9 server when it is ready
QUIT 'q' Sent by client(mtp) to server(mtpd) to tell it that the
session is finished.
ERROR_CONTROL 'e' Error. Followed by 4 bytes which are an integer in
network order specifying the error.
PUTMOD 'p' Put module from client file to server's memory.
Client sends PUTMOD followed by 4 bytes which are an
integer in network order specifying the number of bytes
in the module name., then that many bytes giving the
module name. Then the client sends 4 bytes ino giving
the module size. It then waits for the server to send
an ACKNOWLEDGE or an ERROR_CONTROL.
On getting a PUTMOD command, the server reads the
name size and the the name, and the module size. It
then unloads any module with this name and creates
space for it. If this can't be done an ERROR_CONTROL
is sent to the client else an ACKNOWLEDGE is sent.
On receiving the ACKNOWLEDGE the client then sends
all bytes for the module and waits for an ACKNOWLEDGE
or an ERROR_CONTROL. If it gets an ERROR_CONTROL back
at any stage it must handle it properly.
On getting the module and loading it into memory
the server then verifies it to load it into the module
directory. Once this is done the server sends an
ACKNOWLEDGE or an ERROR_CONTROL.
That completes the module transfer.
UPUTMOD 'u' Same as PUTMOD except that no attempt is made to
unload the module first. This is necessary for modules
in ROM which cannot be unloaded. But loading in a
module of the same name but a newer edition number will
result in the old version being dropped at the
verification stage.
GETMOD 'g' Get module from server's memory and put into file on
client.
Client sends GETMOD followed by 4 bytes which are
an integer in network order specifying the number of
bytes in the module name, then that many bytes giving
the module name. It then waits for the server to send
an ACKNOWLEDGE or an ERROR_CONTROL.
On getting a GETMOD command, the server reads the
name size and the the name. It then links to the
module with this name and returns an ACKNOWLEDGE. If
there is no such file or an error occurs, an
ERROR_CONTROL is sent.
If there is no error, the server next sends 4 bytes
in network order specifying the module size, followed
by that many bytes from the module.
On receiving the ACKNOWLEDGE the client then reads
the module size and that number of bytes for the
module.