System services

As NightOS' kernel is not monolithic but a microkernel, it only handles the most fundamental tasks of the system, like memory and processes management, as well as direct hardware communication.

The vast majority of its features can be found in system services, run by the system itself under the sys DID.

This splitting implies that most low-level features of the system are documented in the individual services' specifications documents, which you will find here.

Nomenclature

System services are referred to as the sys:: services.

All methods and notifications describe the required permissions to use them, their arguments.

They also use common error codes:

  • 0x00: cannot read syscall's code or arguments (error while reading memory)
  • 0x01: the requested syscall does not exist
  • 0x02: at least one argument is invalid (e.g. providing a pointer to the 0 address)
  • 0x03: unmapped memory pointer (e.g. provided a pointer to a memory location that is not mapped yet)
  • 0x04: memory permission error (e.g. provided a writable buffer to an allocated but non-writable memory address)
  • 0x05: insufficient permissions
  • 0x06: driver error
  • 0x10 to 0x1F: invalid arguments provided (e.g. value is too high)
  • 0x20 to 0x2F: arguments are not valid in the current context (e.g. provided ID does not exist)
  • 0x30 to 0x3F: resource errors (e.g. file not found)
  • 0x40 to 0x4F: driver errors
  • 0x50 to 0x5F: hardware errors
  • 0x60 to 0xFF: other types of errors

All methods return an answer, though it may be empty (indicated by a None). System services' answers always conclude the exchange.

List of system services