Download OS-9 Porting Guide

Transcript
6
Creating a Low-Level Timer Module
Starting the Low-Level Timer Module
During the early stages of system bootup, the bootstrap code searches
for and starts low-level system modules included in the boot image. The
start-up entry point for the low-level system modules is supplied in a
relocatable (.r) file in the distribution. This entry point branches to the C
function p2start() you need to provide for your timer module. The
start-up routine should perform these tasks:
Step 1.
Ensure no other timer module has been installed.
Step 2.
Allocate and initialize the timer services record. Allocation may be done
passively by defining the timer services record as a module global
variable.
Step 3.
Make the entry points for its services available through the timer
services record.
Step 4.
Allocate and initialize any device-specific data structure.
Step 5.
Install the timer services structure into the rominfo record.
Building the Low-Level Timer Module
Create the makefile for your timer module in a properly named
subdirectory of your port’s ROM directory (for example,
<Target>/ROM/LL<nnnn>). Use the makefiles from the example
ports as a guide.
Complete the following steps to add your low-level timer module to the
system:
Step 1.
Edit the makefile file in <Target>/ROM.
Step 2.
Add your timer directory name to the list of directory names used to
define the TRGTS macro.
114
OS-9 Porting Guide