Page History

ServiceModel

Lukas Eisenhauer edited this page on 13 Dec 2022

Clone this wiki locally
You can clone HTTP or SSH.

The service model

Honey OS is based on a microkernel architecture. Any functionality will be given through user mode programs. A user mode program is known as a service, where one ELF file, after being loaded and initialized equates to a service. Inside of the kernel, the following attributes exist for each service:

name type description
paging info Paging Info the paging information for the service.
name String the service's name (mapped in kernel space)
functions List<Function> a collection of functions being provided by the service
events List<Event> a collection of events being fired by the service

The paging information contains information about weather any single page is mapped to some portion of memory and also includes the page table for this specific service.

Functions

Every service can provide a number of functions, stored in the functions list. Each functions has the following attributes:

name type description
name String the name of the function
address void * the entry point for the function

A function receives its name when being created along with its starting address. When a function should be run, the kernel will set EIP to address and set up the stack in a way that returning from the function will jump back to some piece of code to cleanly finish processing.

Whenever a service is created, a default function with name "main" is created and set up with its address pointing to the start address field in the ELF file header. A task to run this function will also be scheduled together with the creation of the task and should serve to initialize the service. The main function should for example register all functions and events provided by the kernel and initialize any static variables.

Other services can call a service's functions using the request system call with the result of the function (stored in EAX by convention) being returned to the calling service.