cons – console, clocks, process/process group ids, user, null, reboot, etc.
bind #c /dev
The console device serves a one-level directory
giving access to the console screen and
causes the characters to be printed on the console screen. Console
input is handled by a different program (see
file contains a textual representation of the operating system’s version and parameters.
At the moment, it contains one field: the 9P protocol version, currently
file contains a copy of the kernel configuration file used to build the kernel.
file holds the last 16 kilobytes of output written to the console
by the kernel’s print statements or by processes writing to
It is useful for retrieving boot messages once the boot
process is over.
file may be read to receive a copy of the data written
to the console by the kernel’s print statements or by processes
Only data written after the file is opened is available.
If the machine’s console is a serial line, the data is sent both to the
console and to
if its console is a graphics screen, the data is sent either to the
display or to
but not both.
(It is advisable not to open
on terminals until you have started
file throws away anything written to it
and always returns zero when read.
file is a read-only file that produces an infinite stream of zero-valued bytes when read.
file contains, one per line, a listing of the drivers configured in the kernel, in the format
file contains the name of the authentication domain that
this host belongs to; see
Only the user named in
may write this.
file contains the name of the user that owns the console device files.
The hostowner also has group permissions for any local devices.
return a stream of random bytes produced by the kernels cryptographic
random number generator. The rate at which data can be read depends on
the implementation and can vary from hundreds of megabytes to just
a few hundred bits a second. Therefore,
should be treated as a seed to
pseudo-random number generators which can produce a faster
Writing the string
causes the system to shutdown and, if
Writing the string
loads the named kernel image and restarts,
preserving the kernel configuration in
except that the
variable is set to
Writing the string
activates the remote kernel debugger (see
Only the host
owner has the ability to open this file.
is a binary interface that provides
the same information as
in binary form,
and also controls clock frequency and clock trim.
All integers read or written from
are in big endian order.
Unlike the other files, reads and writes do not affect
the offset. Therefore, there is no need for a seek
back to zero between subsequent accesses.
A read of
returns 24 bytes, three 8 byte numbers, representing nanoseconds
since start of epoch, clock ticks, and clock frequency.
A write to
is a message with one of 3 formats:
set the nanoseconds since epoch to the given
d<8-byte delta><4-byte period>
trim the nanoseconds since epoch by
over the next
Set the frequency for interpreting clock ticks to be
ticks per second.
The rest of the files contain (mostly) read-only strings.
Each string has a fixed length: a
of more than that gives a result of that fixed length (the result does not
include a terminating zero byte);
of less than that length leaves the file offset so the
rest of the string (but no more) will be read the next time.
To reread the file without closing it,
must be used to reset the offset.
When the file contains numeric data
each number is formatted in decimal.
If the binary number fits in 32 bits, it is formatted as an
11 digit decimal number with
leading blanks and one trailing blank; totaling 12 bytes.
is formatted as 21 digit decimal numbers with leading blanks and one
trailing blank; totaling 22 bytes.
file holds six 32-bit numbers, containing the time in milliseconds
that the current process has spent in user mode, system calls,
real elapsed time, and then the time spent, by exited children and their descendants,
in user mode, system calls, and real elapsed time.
file holds one 32-bit number representing the seconds since start of epoch
and three 64-bit numbers, representing nanoseconds since
start of epoch, clock ticks, and clock frequency.
A write of a decimal number to
will set the seconds since epoch.
file holds the textual name of the machine, e.g.
file holds 10 numbers:
processor number, context switches, interrupts, system calls, page faults,
TLB faults, TLB purges, load average, idle time and time spent servicing interrupts.
The load average is in units of milli-CPUs and is decayed over time;
idle time and interrupt time are percentage units;
the others are total counts from boot time.
If the machine is a multiprocessor,
holds one line per processor.
Writing anything to
resets all of the counts on all processors.
device holds a text block giving memory usage statistics:
a/n/m kernel malloc
a/n/m kernel draw
These are total memory (bytes), system page size (bytes),
kernel memory (pages), user memory (pages), swap space (pages),
kernel malloced data (bytes), and kernel graphics data (bytes).
used out of
For kernel malloc and kernel draw,
indicates the current allocation in bytes.
These numbers are not blank padded.
To turn on swapping, write to
the textual file descriptor number of a file or device on which to swap.
Reads and writes to
will inevitably cause the front to fall off.
The other files served by the
device are all single numbers:
process group number
parent’s process number