Some space (24 Kbytes typically) is allocated in the OASIS RAM which may be used to load code 'on the fly', outside of the ROM. Its intended use is to replace faulty drivers in the field, or load utilities that are not critical to the mooring operation to conserve ROM space. The space has occassionally been used to host drivers that would not fit into ROM. It is important to note that the patch space is volatile, and will be cleared during a Reset All, so any code placed there are at risk of being removed at any time.
The procedure outlined below describes how to build and install a 'Hot Patch'.
First, a patch must be built and linked with the OASIS ROM image. Here, we will make a patch for the M2 ROM, adding driver foo with source code in foo.c, driver function foo_drv() and wakeup function foo_wake(). It is assumed that the ROM image was built in /oasis/src and there is are directories /oasis/src/patch, and directories /oasis/src/patch/m2 with makefiles to build the patch:
Once the driver has been made, the hex record output and oasis commands to load the driver are placed in a text file, which may be uploaded and executed by OASIS. The load command is first; it expects to be followed by the hex format driver code (foo.hex), followed by a drvadd command, which expects the driver name (foo), the driver memory location, the driver wakeup function memory location (contained in foo.M96). The drvadd command will also execute a dp foo, which will expect the driver parameters values to be set. The parameter-value pairs are at the end of the foo.txt file:
Finally, the patch is installed by performing an ASCII file upload at the OASIS prompt:
The load command at the beginning of the file will be executed on the
OASIS command line, causing OASIS to begin to load and locate the hex record
portion of the file. When the hex records have been loaded, the drvadd
command will execute, adding the driver to the driver list. The drvadd
command then prompts for driver parameters in parameter-number/parameter-value
pairs, separated by a carriage return. A carriage return input for a parameter
number or timeout ends the parameter input.
A similar method is used to add commands to the OASIS user interface, e.g.,
shutcal. In this instance, the loading of hex records is the same as it is for
driver hex records. The cmdadd command is executed, which prompts for
the types of three command line parameters.
It may be more convenient to do these procedures manually, since the timing
over the packet radio is often such that the input parameters for the drvadd
or cmdadd are missed. To do this,
*may be done manually after file upload
** other terminal programs do not work as well with OASIS due to differences
in file transfer protocol implementation. Telix is best second choice, followed
by Hyperterm.