The Programmable Interval Timer (PIT) is a feature of the BIOS. It provides multiple timers for use by any software in the Mark 1 with 0.1 second granularity. The PIT is used heavily in the BIOS and SCOPE to time certain system tasks, but any user software can also use the PIT.
Originally, the PIT was created due to the need for multiple timers in a single process. Because each process occupies only one script, it is tedious and memory-intensive to design a timer solution that could run multiple tasks in a single script, and it would be extremely inefficient to have a new library for each simple timer. Hence, the PIT was designed so that programs can have multiple timers running at the same time, and the PIT will send a system call when the timer expires.
Because of the way the PIT works, timer input is accepted in milliseconds but it is impossible for the LSL script to respond in less than increments of 1/45th of a second (~0.022 seconds, or ~22 milliseconds). Therefore, it is not useful for programs that require timer events in precise or extremely rapid increments. However, the PIT will theoretically accept timers up to 13.6 years long, although they will likely not be accurate at that point.
System Call | Description |
---|---|
BIOS_PIT_CANCEL | Cancels a running PIT timer. |
BIOS_PIT_REPEAT | Starts a repeating PIT timer. |
BIOS_PIT_START | Starts a one-shot PIT timer. |
System Call | Description |
---|---|
BIOS_PIT_TRIGGER | Signals that a PIT timer has triggered. |
The PIT is derived from the Extensible Timer Interface (ETI), an API included in the _nbslib
script. The PIT and ETI function identically, except that the ETI has much less memory and is used only directly by the BIOS for functions that should not be interrupted by other software. All other scripts should use the PIT using the calls described above because the PIT has much more memory available for additional timers and is controlled indirectly by the SCI and BIOS power states. All "userland" code should ignore the corresponding ETI_CANCEL
, ETI_REPEAT
, ETI_START
, and ETI_TRIGGER
link messages.