Primitive and modern outdoor skills

Assumptions/statements:

Goals:

Non-goals:

Terminology

Kernel API

Basic Types:

It should be understood that whatever program a cap refers to can affectively supply whatever "properties" of that capability they wish. Any capability is functionally just a pure capability with other semantics supplied by whatever program or set of programs are talking on that capability. These are simply basic capabilities that are required to be able to write anything, and are thus have semantics supplied by the kernel.

Syscalls:

Capability addressing semantics:

Please note that all capability addressing is address space centric. Meaning that sends go to address spaces which have a capability mapped. Address spaces can then be assocated with VCPU's to actually generate the upcall events in a given VCPU.

Each capability has an "owner". There are 2 pieces of semantics related to owners. An owner refers to an address space not a VCPU. The important piece of semantic here is which address space the capability is addressed with: the "owning" address space, or another address space that it's also mapped into.

  1. When a capability is released from the owner, it is forcefully revoked from all other mappings. Meaning that it will be removed from all address spaces imeadiatly, and the capability itself is free'd. When this occurs a message is sent to every other holder of the capability.
  2. Freeing a capability further causes every "child" capability (a capability created using this capability) to be freed, and thus revoked. This is recursive of course.
  3. When a send is performed on a given capability, from the owning address space it is sent to all non-owners. When a send is performed on a non-owner address space it is sent to the owner only.

Kernel Process API

Strictly speaking the kernel is talked to exactly like any other process on the system. It does need an API though, and thus it requires some concepts of "special" capability types. These are all subtypes of either mem_cap or pure_cap and thus are not actually "special" except as part of an API like any normal process API.

Kernel API:

To talk to the kernel we send it messages using the vcpu_cap_t. To avoid races it is recommended that each VCPU use it's own capability to talk to kernel. To send a message we simply insert it into the "send" queue in the vcpu_cap_t, and call "send" on that vcpu_cap_t (and the address_space that it's mapped too) and the kernel will drop any responses in the "recv" queue, and if it responds it will also call "send" on the capability. The kernel can be modeled 100% correctly as an indipendant process which is asyncronously recieving messages. Once something is in that queue the kernel is free to perform the operation whenever it would like. "send" is therefore really more like "yield'ing" to the kernel. The kernel will however always perform the requested operations in strict queue order (at least as they are visible to the user). In this way dependant operation can be requested in a batch.

We're going to use the notation: resp msg_name(arg1, arg2, ...)
It should be understood that this is not a function call, but simply means placing {uintptr_t ind, msg_type_t msg_name, arg1, arg2, ...} in the send queue of the vcpu_cap_t. The kernel will respond with {uintptr_t ind, resp} in the the "recv" queue. If there is no "resp" the kernel will not respond.

#TODO: error codes?

Upcalls and Events:

Events:

junk I'm still figuring out/haven't typed up yet

Special events:

I think we want to avoid having these at all preemption events come from vcpu_cap_t (preempt written in VCPU buffer) kernel call return events come from vcpu_cap_t (msg written in VCPU buffer) HMMMMMM.... not sure about this, be sure preempt can be emulated with send
sig_cap semantics (death of addr if no upcalls available)

Swap API:

Upcall System: