System Organization

From NitrOS-9
Jump to: navigation, search

System Organization

The NitrOS-9 Operating System is composed of groups of modules that work together to perform a common task. The following illustration shows the major modules and their position in the five-layer organization of NitrOS-9:

Layer 5 D0 D1 D2 Term T1 T2 Pipe
Layer 4 Floppy Driver (rb1773) Terminal or Serial Driver Pipe Driver (Piper)
Layer 3 Disk File Manager (RBF) Character File Manager (SCF) Pipe File Manager (PIPEMAN)
Layer 2
Input/Output Manager (IOMan)
Layer 1 NitrOS-9 Kernel (Krn, KrnP2) Init Clock Clock2

Layer 1: The Kernel

At the lowest layer, Krn and KrnP2 make up the two primary parts of the kernel, or core of NitrOS-9. It is the kernel that provides the intelligence behind NitrOS-9, and handles basic system services such as multitasking and memory management. The kernel also links all other NitrOS-9 modules into the system.

Another important set of modules that reside at this layer are Clock and Clock2. Together, these two modules work to keep track of both system time (known as the tick, the heartbeat of the system) as well as actual clock time, either through software or via real-time clock hardware.

The final module of this layer is Init. This module contains a table of initialization values and is consulted by the kernel during system startup. Information such as the user task to run after boot, initial table sizes, and device names are found in this module. It is loaded into RAM (random access memory) by the NitrOS-9 bootstrap module Boot, along with other necessary system modules.

Layer 2: IOMan

The system’s second layer (just above kernel) contains the input/output manager, IOMan. This module provides common processing for all input/output operations, and is required for performing any I/O supported by NitrOS-9.

Layer 3: File Managers

The system’s third layer contains file managers. File managers perform I/O request processing for similar classes of I/O devices. There are three file managers:

RBF The random block file manager processes all disk I/O operations.

SCF The sequential character file manager handles all non-disk I/O operations that operate one character at a time. These operations include terminal and printer I/O.

PIPEMAN The pipe file manager handles pipes. Pipes are memory buffers that act as files. Pipes are used for data transfers between processes.

Layer 4: Device Drivers

The system’s fourth layer is the device driver layer. Device drivers handle basic I/O functions for specific I/O controller hardware, and are normally provided to you when you purchase new I/O devices or cartridges. You can use pre-written drivers, or you can write your own.

Layer 5: Device Descriptors

The system’s fifth layer contains the device descriptors. Device descriptors are small tables that define the logical name, device driver and file manager for each I/O port. They also contain port initialization and port address information. Device descriptors require only one copy of each I/O controller driver used.

Beyond Layer 5: Applications

NitrOS-9’s primary purpose is to act as the manager of data flow for applications, which run as processes outside of the five layer hierarchy. This includes the initial user process, SysGo, which is forked after boot, and Shell, the program that allows commands to be typed and executed by NitrOS-9.