Jameco Electronics 2000, 3000 manual C.4.3 Complete Operating System, Interrupt, Syscall

Models: 3000 2000

1 349
Download 349 pages 5.72 Kb
Page 335
Image 335
C.4.3 Complete Operating System

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.

System Mode

User Mode

 

Return from interrupts

Interrupt

Application

handlers

code

Flash file

User-defined

system

interrupts

SYSCALL

 

handler

 

 

Interrupts,

 

SYSCALL, RST

Figure C-4. System/User Mode Setup for Operating System

326

Rabbit 3000 Microprocessor

Page 335
Image 335
Jameco Electronics 2000, 3000 manual C.4.3 Complete Operating System, Interrupt, Syscall