Caruh - the Multitasking-Manager for FutureOS
I. Overview
I.1. General information
The 'Caruh' application is part of the FutureOS operating system. Caruh is a tasker, that's a multitasking manager. Or rather, a program to run several applications (tasks) at the same time on the CPC. The individual 'Tasks' can behave cooperatively.
What properties does Caruh have or do the Tasks have?
- The Caruh application is located in the lower RAM between &0000 and &37FF. The area from &4000 to &7FFF is used in addition (for buffers, tables)
- Caruh works in screen MODE 2, in the 80 character x 25 line format
- CBM is used as the user interface: So Caruh can be used like to operate most other FutureOS applications.
- In addition to the pull-down menus at the top of the screen, there is another Task-Bar at the bottom of the screen. The names of four tasks are displayed there in the middle. With the arrows all the way left and right you can scroll horizontally through the names of the tasks
- The surface of Caruh offers functions to load, save, terminate or change the priority of one or more tasks
- The maximum number of different tasks is 255 (with a 4 MB RAM expansion)
- A task can reach a maximum size of 15.75 KB
- The tasks are managed dynamically. Task numbers can therefore change. For example, when a task is deleted, the higher task numbers are adjusted
- Each task has its own 16 KB expansion RAM (E-RAM). These E-RAMs are banked in between &4000 and &7FFF. Accordingly a task is always assembled at the start address &4000.
I.2. Types of Tasks
There are foreground and background tasks. A background task can be switched to be a foreground task by the user - if the task allows this (is capable of).
Foreground Tasks
A foreground task is able to take over the entire screen and to write on it. In addition he can also scan the keyboard.
He has to respond to the 'ESCape' key. In case the key was pressed then the task must return control back to Caruh.
Every foreground task is always also a background task (as long as it has not taken over the output to the screen).
Only the user can switch a background task to the foreground! There can only be one foreground task at a time!
Background Tasks
A background task is only allowed to write on the common screen. There he can reserve screen areas.
Summary
1. A task can be a (pure) background task
- He may reserve parts of the general screen and write on it
- He is not allowed to take over the entire screen
- It's identified by a cleared bit #0 at address &7FF8 (TCON8) in its E-RAM
2. A task can be switched to the 'foreground' by Caruh.
- There is always only one foreground task
- When starting Caruh, Caruh itself is the foreground task
- If another task becomes the 'Foreground Task', it's allowed to use the entire screen area. And the keyboard and the joysticks.
- However, he must also be able to give control back to Caruh at 'ESC'
- It's identified by a set bit 0 at address &7FF8 (TCON8) in E-RAM
Attention: To be able to switch a task to the foreground, bit 1 at address &7FF8 (TCON8) must be set. This is done by the task itself.
Pressing the 'ESCape' key must switch the task back to the background! Caruh itself checks for ESC. But the task must / should do that too.