[kernel] Let objects inherit caps from superclasses

The main point of this change is to allow "global" capabilities defined
on the base object type. The example here is the clone capability on all
objects, which governs the ability to clone a handle.

Related changes in this commit:
- Renamed `kobject` to `object` as far as the syscall interface is
  concerned. `kobject` is the cname, but j6_cap_kobject_clone feels
  clunky.
- The above change made me realize that the "object <type>" syntax for
  specifying object references was also clunky, so now it's "ref <type>"
- Having to add `.object` on everywhere to access objects in
  interface.exposes or object.super was cumbersome, so those properties
  now return object types directly, instead of ObjectRef.
- syscall_verify.cpp.cog now generates code to check capabilities on
  handles if they're specified in the definition, even when not passing
  an object to the implementation function.
This commit is contained in:
Justin C. Miller
2022-01-29 15:22:38 -08:00
parent bdae812274
commit cd037aca15
19 changed files with 101 additions and 70 deletions

View File

@@ -3,7 +3,7 @@ import "objects/vma.def"
# The system object represents a handle to kernel functionality
# needed by drivers and other priviledged services
object system : kobject {
object system : object {
uid fa72506a2cf71a30
capabilities [
@@ -21,17 +21,17 @@ object system : kobject {
# Ask the kernel to send this process messages whenever
# the given IRQ fires
method bind_irq [cap:bind_irq] {
param dest object endpoint # Endpoint that will receive messages
param irq uint # IRQ number to bind
param dest ref endpoint # Endpoint that will receive messages
param irq uint # IRQ number to bind
}
# Create a VMA and map an area of physical memory into it,
# also mapping that VMA into the current process
method map_phys [cap:map_phys] {
param area object vma [out] # Receives a handle to the VMA created
param phys address # The physical address of the area
param size size # Size of the area, in pages
param flags uint32 # Flags to apply to the created VMA
param area ref vma [out] # Receives a handle to the VMA created
param phys address # The physical address of the area
param size size # Size of the area, in pages
param flags uint32 # Flags to apply to the created VMA
}
# Request the kernel change the IOPL for this process. The only values