Jameco Electronics 2000 Network Card User Manual


 
326 Rabbit 3000 Microprocessor
C.4.3 Complete Operating System
This section describes a “full” use of the System/User mode—separating all common
functions into a System mode “operating system” while letting the application-specific
code run in the User mode.By default, the System mode handles all peripherals and inter-
rupts, as well as high-level interfaces such as a flash file system. However, the processor
will be running the application code in the User mode most of the time.
The application code can request direct access to a peripheral and/or interrupt from the
System mode. If allowed, the System mode can create an interrupt vector as described in
Section C.3 that will execute the user code interrupt handler.
When the application code wants to perform an action that is controlled by the System
mode, it can request the particular action by loading the appropriate value into HL and
executing
SYSCALL. This requires generating a list of all the actions that the application
code would want to do, assigning values to each action, and implementing a SYSCALL
handler in the System mode that parses the value passed to it and calls the appropriate
function.
Write protection should be enabled (User mode only) for all blocks containing system
code and data as well as any critical memory regions.
If any critical interrupts occur (stack limit violation, system mode violation, write protec-
tion violation), the System mode handlers can perform any of a number of operations:
restart the application code, signal another device, halt operation, and so on.
An overview of this level of operation is shown in Figure C-4.
Figure C-4. System/User Mode Setup for Operating System
Return from interrupts
Interrupts,
SYSCALL, RST
System Mode User Mode
Application
code
User-defined
interrupts
Interrupt
handlers
Flash file
system
SYSCALL
handler