Fork us on GitHub Follow us on Google+ Follow us on Facebook Follow us on Twitter

Services and Devices

About services

As a multi-server system, the bulk of functionality in HelenOS is provided by a set of servers (tasks, a.k.a. processes) in terms of services. A service is an IPC endpoint that client tasks can talk to using the correct IPC protocol. To make it possible for tasks to locate a service, the respective server needs to register it with a name service.

The prominent, generic name service in the system is the Location Service.

Location Service

The Location Service is a registry where any server can sign up services identified by unique names in the form <group>/<name>. (Internally a unique numerical ID is assigned to each service, but this is hidden from the user.)

A service can be added to one or more categories. (The list of categories is defined statically at present.) Categories are used to group services sharing some commonality, such as the type of service provided. For example, there is a category for all services providing a network link.

locfs is a special file system that maps the Location Service namespace to the filesystem namespace. We can make use of that to list all services registered in the Location Service. The locfs filesystem is mounted on /loc:

# ls /loc/*

To see which categories are defined and which services are present in which categories we can use the administrative command

# loc

or

# loc show-cat <category>

to list just the contents of a single category.

Devices

Peripheral devices connected to buses such as PCI or USB are enumerated in cooperation of special servers acting as device drivers (called DDF-compliant device drivers), and the Device Manager. Device drivers provide device-specific knowledge and the Device Manager orchestrates the enumeration process. The enumeration process is dynamic as devices can be added to or removed from the system at any time.

The devices are organized in a device tree. Each device has a unique path corresponding to the system topology such as /hw/pci@0/.... To see the list of all devices in the system we can use the devctl command:

# devctl

The drivers present functionality to the rest of the system again in terms of services. The name of the services is devices/<mangled-device-name>. The mangled device name is the device name where slashes (/) are replaced with backslashes (\). This is due to a current limitation in the Location Service which can only support one level of grouping.

Since device drivers export services and services are visible under /loc via locfs, we can list all the device-services in the system as

# ls /loc/devices
Last modified 3 years ago Last modified on 2016-04-20T20:59:07Z