beautypg.com

Renesas Emulator System M3T-MR100 User Manual

Page 27

background image

- 11 -

During this interval, it

appears that the key input

microcomputer is haled.

Key input

Task

Remote control

Task

Program execution

interrupt

Program execution

resumed

Figure 3.5 Task Execution Interruption and Resumption

In the state shown in Figure 3.5, it appears to the programmer that the key input task or its microcomputer is halted while
another task assumes execution control.

Task execution restarts at the point of last interruption as the register contents prevailing at the time of the last interruption
are recovered. In other words, task switching refers to the action performed to save the currently executed task register
contents into the associated task management memory area and recover the register contents for the task to switch to.

To establish the kernel, therefore, it is only necessary to manage the register for each task and change the register contents
upon each task switching so that it looks as if a number of microcomputers exist (See Figure 3.6).

Remote control

Task

Actual

Register

R0

R1

PC

Kernel

Register

Register

Key input

Task

R0

R1

PC

R0

R1

PC

Figure 3.6 Task Switching

The example presented in Figure 3.7

5

indicates how the individual task registers are managed. In reality, it is necessary

to provide not only a register but also a stack area for each task.

5

It is figure where all the stack areas of the task were arranged in the same section.