Schemes
Schemes are the natural counter-part to URLs. URLs are opened to schemes, which can then be opened to yield a resource.
Schemes are named such that the kernel is able to uniquely identify them. This name is used in the scheme
part of the URL.
Schemes are a generalization of file systems. It should be noted that schemes do not necessarily represent normal files; they are often a "virtual file" (i.e., an abstract unit with certain operations defined on it).
Throughout the whole ecosystem of Redox, schemes are used as the main communication primitive because they are a powerful abstraction. With schemes Redox can have one unified I/O interface.
Schemes can be defined both in user space and in kernel space but when possible user space is preferred.
Kernel Schemes
The kernel provides a small number of schemes in order to support userspace.
Name | Description | Links |
---|---|---|
: |
Root scheme - allows the creation of userspace schemes | Docs |
debug: |
Provides access to serial console | Docs | event: |
Allows reading of `Event`s which are registered using fevent |
Docs |
irq: |
Allows userspace handling of IRQs | Docs |
pipe: |
Used internally by the kernel to implement pipe |
Docs |
sys: |
System information, such as the context list and scheme list | Docs |
Userspace Schemes
The Redox userspace, starting with initfs:bin/init
, will create schemes during initialization. Once the user is able to log in, the following should be established:
Name | Daemon | Description |
---|---|---|
disk: |
ahcid |
Raw access to disks |
display: |
vesad |
Screen multiplexing of the display, provides text and graphical screens, used by orbital: |
ethernet: |
ethernetd |
Raw ethernet frame send/receive, used by ip: |
file: |
redoxfs |
Root filesystem |
ip: |
ipd |
Raw IP packet send/receive |
network: |
e1000d rtl8168d |
Link level network send/receive, used by ethernet: |
null: |
nulld |
Scheme that will discard all writes, and read no bytes |
orbital: |
orbital |
Windowing system |
pty: |
ptyd |
Psuedoterminals, used by terminal emulators |
rand: |
randd |
Psuedo-random number generator |
tcp: |
tcpd |
TCP sockets |
udp: |
udpd |
UDP sockets |
zero: |
zerod |
Scheme that will discard all writes, and always fill read buffers with zeroes |
Scheme operations
What makes a scheme a scheme? Scheme operations!
A scheme is just a data structure with certain functions defined on it:
-
open
- open the scheme.open
is used for initially starting communication with a scheme; it is an optional method, and will default to returningENOENT
. -
mkdir
- make a new sub-structure. Note that the name is a little misleading (and it might even be renamed in the future), since in many schemesmkdir
won't make adirectory
, but instead perform some form of substructure creation.
Optional methods include:
-
unlink
- remove a link (that is a binding from one substructure to another). -
link
- add a link.