global interface

message notifications

oneway notifications(data: notifications)

A notification message. If a task has unread notifications, the kernel constructs and returns this message. data may include multiple notifications (e.g. NOTIFY_TIMER | NOTIFY_ASYNC).

message async

oneway async()

Requests a pending async message. Internally used by async_recv API.

message invalid

oneway invalid()

Represents an invalid message.

message exception

oneway exception(task: task, exception: exception_type)

The kernel sends this message to a pager task when an exception occurs.

rpc page_fault

rpc page_fault(task: task, vaddr: vaddr, ip: vaddr, fault: uint) -> ()

The kernel calls this RPC when a page fault occurs. When the pager task replies, the kernel continues executing the page-faulted task.

rpc abi_hook

rpc abi_hook(task: task, type: int, frame: trap_frame) -> (frame: trap_frame)

The kernel calls this RPC when a task with ABI hook enabled initiated a system call.

hv interface

Hardware-assisted hypervisor like Linux's KVM.

rpc x64_start

rpc x64_start(task: task) -> (guest_rip: uint64, ept_pml4: paddr, initial_rbx: uint64)

The x64 guest calls this RPC before it starts to retrieve some initial guest states.

rpc halt

rpc halt(task: task) -> ()

The guest calls this RPC when it enters an idle state or waits for interrupt.

rpc guest_page_fault

rpc guest_page_fault(task: task, gpaddr: gpaddr, frame: hv_frame) -> (frame: hv_frame)

The guest calls this RPC when it tried to perform an invalid access to a guest physical memory address (EPT violation in Intel VT).

rpc ioport_read

rpc ioport_read(task: task, port: uint16, size: size) -> (value: uint32)

IO port read access from the guest.

rpc ioport_write

rpc ioport_write(task: task, port: uint16, size: size, value: uint32) -> ()

IO port write access from the guest.

message await

oneway await(task: task)

Receive a pending message from the server.

message inject_irq

oneway inject_irq(irq_bitmap: uint32)

Injects an IRQ into the guest.

benchmark interface

IPC benchmarking.

rpc nop

rpc nop(value: int) -> (value: int)

No-op. Do nothing but returns the value as it is.

rpc nop_with_ool

rpc nop_with_ool(data: bytes) -> (data: bytes)

No-op. Do nothing but returns data (to be sent as ool) as it is.

vm interface

The memory management server (vm) interface.

rpc alloc_pages

rpc alloc_pages(num_pages: size, paddr: paddr) -> (vaddr: vaddr, paddr: paddr)

Allocates memory pages. paddr is zero, it allocates arbitrary physical memory pages. Otherwise, it maps the specified physical memory address to an unused virtual memory address.

discovery interface

Service discovery.

rpc serve

rpc serve(name: str) -> ()

Registers a service.

rpc lookup

rpc lookup(name: str) -> (task: task)

Looks for a service. This blocks until a service with name appears.

task interface

High-level task managemnt.

rpc alloc

rpc alloc(pager: task) -> (task: task)

Allocates an unused TASK ID.

rpc free

rpc free(task: task) -> ()

Deallocates an unused TASK ID.

rpc launch

rpc launch(name_and_cmdline: str) -> (task: task)

Launches a task.

rpc watch

rpc watch(task: task) -> ()

Watches a task. If the task exits, the watcher task receives an async message task.exited.

rpc unwatch

rpc unwatch(task: task) -> ()

Unwatches a task.

async message exited

oneway exited(task: task)

A message sent to watcher tasks when a task exits.

ool interface

Out-of-Line (OoL) payload internal interface.

rpc recv

rpc recv(addr: vaddr, len: size) -> ()

Registers a receive buffer for an OoL payload.

rpc send

rpc send(dst: task, addr: vaddr, len: size) -> (id: vaddr)

Sends an OoL payload to dst. Returns the OoL payload identifier.

rpc verify

rpc verify(src: task, id: vaddr, len: size) -> (received_at: vaddr)

Checks if the caller task has received a OoL payload from src with the id. Returns the receive buffer address if it's valid.

fs interface

A file system driver.

rpc open

rpc open(path: str) -> (handle: handle)

Opens a file.

rpc create

rpc create(path: str, exist_ok: bool) -> (handle: handle)

Creates a file. If exist_ok is true, it return OK even if the file already exists.

rpc close

rpc close(handle: handle) -> ()

Closes a file handle.

rpc read

rpc read(handle: handle, offset: offset, len: size) -> (data: bytes)

Reads file contents.

rpc write

rpc write(handle: handle, offset: offset, data: bytes) -> ()

Writes bytes into the file.

rpc stat

rpc stat(path: str) -> (size: size)

Returns file metadata.

blk interface

A block (disk) device interface.

rpc read

rpc read(sector: offset, num_sectors: size) -> (data: bytes)

Reads blocks at offset (in bytes) from the device. The size of a block depends on the device.

rpc write

rpc write(sector: offset, data: bytes) -> ()

Writes blocks at offset (in bytes) into the device. The size of a block depends on the device.

net interface

A network device interface.

message rx

oneway rx(payload: bytes)

A RX packet payload.

message tx

oneway tx(payload: bytes)

A TX packet payload to be sent from the device.

rtc interface

rpc read

rpc read() -> (year: uint32, month: uint8, day: uint8, day_of_week: uint8, hour: uint8, minute: uint8, second: uint8)

time interface

rpc gettimeofday

rpc gettimeofday() -> (unixtime: uint64)

shm interface

rpc create

rpc create(size: size) -> (shm_id: int)

rpc map

rpc map(shm_id: int, writable: bool) -> (vaddr: vaddr)

rpc close

rpc close(shm_id: int) -> ()

shm_test interface

rpc read

rpc read() -> (shm_id: int)