Operating System

This part contains the technical documentation of the JNode Operating System.

Boot and startup

During the boot process of JNode, the kernel image is loaded by Grub and booted. After the bootstrapper code, we're running plain java code. The fist code executed is in org.jnode.boot.Main#vmMain() which initializes the JVM and starts the plugin system.

Driver framework

The basic device driver design involves 3 components:

  • Device: a representation of the actual hardware device
  • Driver: a software driver able to control a Device
  • DeviceAPI: a programming interface for a Device, usually implemented by the Driver.

There is a DeviceManager where all devices are registered. It delegates to DeviceToDriverMapper instances to find a suitable driver for a given device. Instances of this mapper interface use e.g. the PCI id of a device (in case of PCIDevice) to find a suitable driver. This is configurable via a configuration file.

For a device to operate there are the following resources available:

  • Hardware interrupts. A driver can register an IRQHandler which is called on its own (normal java-) thread. The native kernel signals a hardware interrupt by incrementing a counter for that interrupts, after which the thread scheduler dispatches such events to the correct threads of the IRQHandler's.
  • DMA channels. A driver can claim a DMA channel.
    This channel can be setup, enabled and disabled.
  • IO port access. An Unsafe class has native methods for this. A device must first claim a range of IO ports before it can gain access to it.
  • Memory access. A device can claim a range of the the memory addressspace. A MemoryResource is given to the device. The device can use the methods of the MemoryResource to actually access the memory.

Filesystem framework

The filesystem support in JNode is split up into a generic part and a filesystem specific part. The role of the generic part is:

  1. Keep track of all mounted filesystems.
  2. Map between path names are filesystem entries.
  3. Share filesystem entries between various threads/processes.

The role of the filesystem specific part is:

  1. Store and retrieve files.
  2. Store and retrieve directories.

We should be more specific about what a filesystem is. JNode makes a distinction the a FileSystemType and a FileSystem. A FileSystemType has a name, can detect filesystems of its own type on a device and can create FileSystem instances for a specific device (usually a disk). A FileSystem implements storing/retrieving files and directories.

To access files in JNode, use the regular classes in the java.io package. They are connected to the JNode filesystem implementation. A direct connection to the filesystem implementation is not allowed.

FrameBuffer devices

This chapter details the FrameBuffer device design and the interfaces involved in the design.

FrameBufferAPI

All framebuffer devices must implement this API.

FrameBufferConfiguration

TODO write me.

Surface

TODO write me.

HardwareCursorAPI

TODO write me.

DisplayDataChannelAPI

TODO write me.

Network devices

This chapter details the design of network devices and describe the interfaces involved.

NetDeviceAPI

Every network device must implement this API.

The API contains methods to get the hardware address of the device, send data through the device and get/set protocol address information.

When a network deivce receives data, it must deliver that data to the NetworkLayerManager. The AbstractNetworkDriver class (which is usually the baseclass for all network drivers) contains a helper method (onReceive) for this purpose.

Network protocols

This chapter will detail the interfaces involved in the network protocol layer.

NetworkLayer

This interface must be implemented by all network protocol handlers.

TransportLayer

This interface must be implemented by OSI transport layer protocols.

LinkLayer

This interface must be implemented by OSI link layer protocols.

Registration

To register a network layer, the network layer class must be specified in an extension of the "org.jnode.net.networkLayers" extension point.
This is usually done in the descriptor of the plugin that holds the network layer.

Architecture specifics

This chapter contains the specific technical operating system details about the various architectures that JNode is operating on.

X86 Architecture

The X86 architecture is targets the Intel IA32 architecture implemented by the Intel Pentium (and up) processors and the AMD Athlon/Duron (etc) processors.

Physical memory layout

This architecture uses a physical memory layout as given in the picture below.

X86 Memory Map