Distribution: COMPANY CONFIDENTIAL Project: NC Model 1 Issue: 0.08 Author(s): Steve Cormie Date: 02 Sep 1996 Last Issue: 0.07
0.01 SMC 27-Feb-96 First created. 0.02 SMC 01-May-96 More definite specification. 0.03 SMC 24-May-96 Added upcalls and new SWIs. 0.04 SMC 07-Jun-96 Added Service_PreReset. 0.05 SMC 10-Jun-96 Added ScreenBlanker_Control reason codes. 0.06 SMC 12-Jun-96 Added reference to TaskModule spec. 0.07 JS 03-Jul-96 Added details about Message_PreQuit etc. 0.08 SMC 02-Sep-96 Corrected the SWI numbers.
There are no outstanding issues.
NC standby mode is handled by a new "Standby" module. This module detects when the standby button is pressed, informs the rest of the OS of what is going to happen and then performs some internal actions before going into standby mode. The machine is still fully operational in standby mode except that the screen is blanked and keyboard and mouse input is suppressed. This allows background tasks to continue execution eg. a fax application could spool incoming faxes to a printer.
When the Standby module initialises it immediately enters active (non-standby) mode and sets the front panel LEDs to red off, green on.
The status of the front panel standby switch is reflected in bit 6 of the IOLINES register in the ARM7500 ie. the 8-bit I/O port (pins IOP[7:0]). These I/O pins are also reflected in the IRQC set of control registers which means that operation of the standby button can be detected via an interrupt. The Kernel is modified to support the IRQC control registers so that the interrupt can be claimed.
A new device vector has been assigned, IOMD_Standby_DevNo, which the Standby module claims using SWI OS_ClaimDeviceVector. The Kernel is modified to detect whether an interrupt is pending in IRQRQC (interrupt request) and, if there is, to read the offset to the appropriate device vector from a new table for the IRQC control register set (similar to the existing tables for IRQA, IRQB and IRQD control registers). The new device vector is also added to the Kernel.
The Standby module claims this device vector during module initialisation and releases it during module finalisation. The interrupt routine which is attached to the vector simply sets a flag which specifies that it is busy and then sets a callback using SWI OS_CallAfter with a specified delay of 10cs and returns. This callback performs the processing required to put the NC into or bring it out of standby mode depending on the current state. It then checks the state of the standby button by testing bit 6 of the IOLINES register. If the button is still being pressed then the callback arranges for itself to be called again after a further 10cs. If it is not being pressed then the busy flag is cleared. This callback structure is to provide debouncing of the standby button such that if the interrupt routine is called when the busy flag is set then the interrupt is ignored.
When the standby button is pressed to go into standby mode the Standby module initiates the desktop shutdown sequence by broadcasting a Message_PreQuit using SWI TaskModule_SendMessage which allows applications to prompt the user to save any unsaved data.
The Message_PreQuit is sent with all bits of the flag-word (offset 20 in the Message_PreQuit block) set to zero. In particular, bit 0 is left unset. This means that applications which need to prompt the user to save data don't think they are the only application being asked to quit, and terminate themselves.
Instead, they will send a Shift-Ctrl-F12 to TaskModule in an attempt to restart the closedown. This is ignored at present, but a future modification to TaskModule to allow registration of interest in non-broadcast messages would enable Standby to restart the Message_PreQuit process in response to this.
The switch to standby-mode is only continued when/if the the Standby module receives a Wimp event 19 (ie the Message_PreQuit bounced).
When the shutdown process is complete, the machine is not actually shut down. Instead, the Standby module issues the following upcall.
Notification that the system is about to enter standby state.
On entry R0 = &E (Standby) On exit R0 = 0 to prevent standby, otherwise preserved
The module also issues the following service call.
Notification that the system is about to enter standby state.
On entry R1 = &7E On exit R1 = 0 to prevent standby, otherwise preserved
If no objection to going into standby is raised by either of these mechanisms then the following service call is issued.
Notification that the system is entering standby state.
On entry R1 = &80 On exit R1 preserved (must not be claimed)
This service call should be used by other modules to detect that the system is entering standby state eg. modem software could drop the line. The Standby module then uses the following additional SWI ScreenBlanker_Control reason code to blank the screen.
Enter a strict blank state which can only be unblanked by ScreenBlanker_Control 9.
On entry R0 = 8 (reason code) On exit R0 preserved
Mouse movements and key presses do not unblank the screen when this SWI call is used. When coming out of standby mode the Standby module calls the following SWI to unblank the screen.
Exit strict blank state.
On entry R0 = 9 (reason code) On exit R0 preserved
The Standby module then issues the following upcall which can be trapped by modules which need to know when the system has come out of standby state.
Notification that the system is entering online state.
On entry R0 = &D (Online) On exit R0 preserved (must not be claimed)
Read the current state of the machine.
On entry R0 = flags (must be 0) On exit R0 = current state Bit Meaning when set 0 in standby mode 1-31 reserved
Put the machine into standby mode.
On entry R0 = flags (must be 0) On exit R0 = previous state (as for Standby_State)
Bring the machine out of standby mode.
On entry R0 = flags (must be 0) On exit R0 = previous state (as for StandbyState)
For test purpose only.
On entry R0 = flags Bit Meaning 0 0=green LED on, 1=red LED ON 1-31 reserved (must be 0) On exit R0 preserved
This interface allows the machine to be put into and brought out of standby mode via software control. For example, an IR handset driver would call this SWI when the standby button on the handset is pressed.