42
K
A
DAK
Application Tasks
3.10 Restart Procedures
The manner in which the operating system begins execution is application dependent.
Execution begins in the user domain providing the opportunity for hardware specific and
application dependent setup prior to the initialization of the AMX system. For example,
hardware interfaces may require custom configuring. In some systems, it might be
desirable to perform a memory integrity check before system startup is permitted.
AMX will enable or disable the interrupt system at the time you launch AMX, as dictated
by the launch parameter you provide when you start AMX.
Once AMX has initialized all of its internal variables and structures, it executes the
sequence of application Restart Procedures provided in the Restart Procedure List in your
System Configuration Module (see Chapter 14.6). These procedures can invoke AMX
services to start tasks and initialize interval timers.
When AMX calls a Restart Procedure, the following conditions exist:
Interrupts reflect the state specified at the time AMX was
launched. If AMX was launched with launch parameter AMLPIE,
interrupts will be enabled. Otherwise interrupts will be disabled.
All registers are free for use.
DS,ES DGROUP segment
SS:SP AMX Kernel Stack ready for use
The direction flag is set to forward.
Restart Procedures are written as Large or Medium model C procedures without formal
parameters.
void cdecl rrproc(void) /* Restart Procedure */
{:
Do restart processing
:
}
A Restart Procedure is coded in assembly language as a FAR procedure as follows:
USER_CODE SEGMENT BYTE 'CODE'
;ASSUME CS:USER_CODE
;
RRPROC PROC FAR
:
Restart Procedure code goes here.
:
RET
;
RRPROC ENDP
;
USER_CODE ENDS