Servers in OSHS

The servers are processes that provide services (hence the name "servers") to other processes called clients. The pipes are used to communicate the service requests from the client to the server and the response of the server to the client.

The system servers are processes that provide what is called system services. System services are defined in the OSHS system interface and have assigned their standard handle name that can be used to refer to handles that need to be used.

??? NASLEDUJUCI TEXT TREBA UPRAVIT A ZLUCIT S PREDCHADZAJUCIM ???

In the previous chapter we realized that there are only four types of objects. Now you might wonder where all the things such as device handling, memory allocation, program image loading and other typical functions of the operating system are located and how they could be performed.

The answer to the above question is simple. There are special processes called servers which accept requests from another processes. The processes running the applications contact these servers and ask them to perform certain things like reading data from a file. The servers then use the basic facilities of the kernel to perform these actions. The servers and the applications use the message pipes to communicate with each other.

More specifically the servers are special only formally. There is no technical difference nor any kind of special status that could be used to distinguish between a server process and any other process (except the device driver servers, which have some special access rights to the hardware I/O port address space). Anyone can run a server in the system and any other process can then use that server.

For example when a process wants to load and execute a program, it asks the execution server to do this job for it. The execution server then uses the kernel calls to create the pieces of the new process (an empty process and some memory regions), fill them with code and data and assembles the running process from these pieces. The act of loading the program binary is thus not restricted in any way; the loading process can pick the data from any source it wishes and in any format it wishes. And there is no need for special root privileges to do any of these things so ordinary users can build up their execution server with customized binary file support and even publish them to other users without bothering the system administrator.

Also file I/O is done by a server. This filesystem server creates connections which represent the open files and file I/O on these open files is done by exchanging messages (with content described by the file I/O protocol) through these channels between the applications and the server managing the files. These servers can be chained so that it is easy to treat a file like a block device with a filesystem on it.

Even the hardware device drivers are not present in the kernel; rather they are special servers which differ from ordinary processes only by having special access rights to the hardware I/O ports occupied by the hardware they are driving.

As mentioned above, there is no need for users to be in a privileged state in the system in order to be able to start their own servers and to use them (except the hardware device drivers). Only some special high privileged operations (which generally are rarely wanted to be available) need some kind of root privileges. These root privileges are represented by a special handles created at boot time and handled directly by a server which is a part of the kernel. The CHAOS even has no notion about user and group IDs.

There exists a standard set of servers and protocols for OSHS. However the OSHS nanokernel does not force the rest of system to support any of these standard servers and protocols nor it assumes their presence. The rest of the system running on top of OSHS nanokernel can vary in ways never possible before.