mirror of
https://github.com/justinian/jsix.git
synced 2025-12-09 16:04:32 -08:00
This change finally adds capabilities to handles. Included changes: - j6_handle_t is now again 64 bits, with the highest 8 bits being a type code, and the next highest 24 bits being the capability mask, so that programs can check type/caps without calling the kernel. - The definitions grammar now includes a `capabilities [ ]` section on objects, to list what capabilities are relevant. - j6/caps.h is auto-generated from object capability lists - init_libj6 again sets __handle_self and __handle_sys, this is a bit of a hack. - A new syscall, j6_handle_list, will return the list of existing handles owned by the calling process. - syscall_verify.cpp.cog now actually checks that the needed capabilities exist on handles before allowing the call.
43 lines
1.4 KiB
Modula-2
43 lines
1.4 KiB
Modula-2
import "objects/endpoint.def"
|
|
import "objects/vma.def"
|
|
|
|
# The system object represents a handle to kernel functionality
|
|
# needed by drivers and other priviledged services
|
|
object system : kobject {
|
|
uid fa72506a2cf71a30
|
|
|
|
capabilities [
|
|
get_log
|
|
bind_irq
|
|
map_phys
|
|
change_iopl
|
|
]
|
|
|
|
# Get a log line from the kernel log
|
|
method get_log [cap:get_log] {
|
|
param buffer buffer [out optional] # Buffer for the log message data structure
|
|
}
|
|
|
|
# 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
|
|
}
|
|
|
|
# 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
|
|
}
|
|
|
|
# Request the kernel change the IOPL for this process. The only values
|
|
# that make sense are 0 and 3.
|
|
method request_iopl [cap:change_iopl] {
|
|
param iopl uint # The IOPL to set for this process
|
|
}
|
|
}
|