3 cons \- console, clocks, process/process group ids, user, null, reboot, etc.
33 The console device serves a one-level directory
34 giving access to the console and
35 miscellaneous information.
39 file returns characters typed on the keyboard.
40 Normally, characters are buffered to enable erase and kill processing.
45 the current input line (removes all characters
46 from the buffer of characters
51 the previous non-kill, non-erase character from the input buffer.
52 Killing and erasing only delete characters back to, but not including,
54 Characters typed at the keyboard actually produce 16-bit runes (see
56 but the runes are translated into the variable-length
60 before putting them into the buffer.
63 of length greater than zero causes the process to wait until a
66 ends the buffer, and then returns as much of the buffer as the argument
69 allows, but only up to one complete line.
72 is not put into the buffer.
73 If part of the line remains, the next
75 will return bytes from that remainder and not part of any new line
76 that has been typed since.
81 has been written to the
83 file and the file is still open,
87 characters are not echoed as they are typed,
92 are not treated specially,
93 and characters are available to
95 as soon as they are typed.
96 Ordinary mode is reentered when
100 or this file is closed.
108 causes the characters to be printed on the console screen.
112 file contains a textual representation of the operating system's version and parameters.
113 At the moment, it contains one field: the 9P protocol version, currently
118 file contains a copy of the kernel configuration file used to build the kernel.
122 file holds the last 16 kilobytes of output written to the console
123 by the kernel's print statements or by processes writing to
125 It is useful for retrieving boot messages once the boot
130 file may be read to receive a copy of the data written
131 to the console by the kernel's print statements or by processes
134 Only data written after the file is opened is available.
135 If the machine's console is a serial line, the data is sent both to the
138 if its console is a graphics screen, the data is sent either to the
142 (It is advisable not to open
144 on terminals until you have started
149 file throws away anything written to it
150 and always returns zero when read.
154 file is a read-only file that produces an infinite stream of zero-valued bytes when read.
158 file contains, one per line, a listing of the drivers configured in the kernel, in the format
166 file contains the name of the authentication domain that
167 this host belongs to; see
169 Only the user named in
175 file contains the name of the user that owns the console device files.
176 The hostowner also has group permissions for any local devices.
180 return a stream of random numbers. The numbers are
181 generated by a low priority kernel process that loops
182 incrementing a variable. Each clock tick the variable
183 is sampled and, if it has changed sufficiently, the last
184 few bits are appended to a buffer. This process is inefficient
185 at best producing at most a few hundred bits a second.
188 should be treated as a seed to
189 pseudo-random number generators which can produce a faster
196 causes the system to shutdown and, if
201 loads the named kernel image and restarts,
202 preserving the kernel configuration in
209 owner has the ability to open this file.
212 is a binary interface that provides
213 the same information as
217 and also controls clock frequency and clock trim.
218 All integers read or written from
220 are in big endian order.
221 Unlike the other files, reads and writes do not affect
222 the offset. Therefore, there is no need for a seek
223 back to zero between subsequent accesses.
226 returns 24 bytes, three 8 byte numbers, representing nanoseconds
227 since start of epoch, clock ticks, and clock frequency.
231 is a message with one of 3 formats:
232 .IP "\f5n\fP<8-byte \f2time\fP>" 1.2i
233 set the nanoseconds since epoch to the given
235 .IP "\f5d\fP<8-byte \f2delta\fP><4-byte \f2period\fP>" 1.2i
236 trim the nanoseconds since epoch by
241 .IP "\f5f\fP<8-byte \f2freq\fP>" 1.2i
242 Set the frequency for interpreting clock ticks to be
246 The rest of the files contain (mostly) read-only strings.
247 Each string has a fixed length: a
249 of more than that gives a result of that fixed length (the result does not
250 include a terminating zero byte);
253 of less than that length leaves the file offset so the
254 rest of the string (but no more) will be read the next time.
255 To reread the file without closing it,
257 must be used to reset the offset.
258 When the file contains numeric data
259 each number is formatted in decimal.
260 If the binary number fits in 32 bits, it is formatted as an
261 11 digit decimal number with
262 leading blanks and one trailing blank; totaling 12 bytes.
264 is formatted as 21 digit decimal numbers with leading blanks and one
265 trailing blank; totaling 22 bytes.
269 file holds six 32-bit numbers, containing the time in milliseconds
270 that the current process has spent in user mode, system calls,
271 real elapsed time, and then the time spent, by exited children and their descendants,
272 in user mode, system calls, and real elapsed time.
276 file holds one 32-bit number representing the seconds since start of epoch
277 and three 64-bit numbers, representing nanoseconds since
278 start of epoch, clock ticks, and clock frequency.
280 A write of a decimal number to
282 will set the seconds since epoch.
286 file holds the textual name of the machine, e.g.
292 file holds 10 numbers:
293 processor number, context switches, interrupts, system calls, page faults,
294 TLB faults, TLB purges, load average, idle time and time spent servicing interrupts.
295 The load average is in units of milli-CPUs and is decayed over time;
296 idle time and interrupt time are percentage units;
297 the others are total counts from boot time.
298 If the machine is a multiprocessor,
300 holds one line per processor.
303 resets all of the counts on all processors.
307 device holds a text block giving memory usage statistics:
315 \fIn\fP/\fIm\fP kernel malloc
316 \fIn\fP/\fIm\fP kernel draw
319 These are total memory (bytes), system page size (bytes),
320 kernel memory (pages), user memory (pages), swap space (pages),
321 kernel malloced data (bytes), and kernel graphics data (bytes).
329 These numbers are not blank padded.
331 To turn on swapping, write to
333 the textual file descriptor number of a file or device on which to swap.
339 will inevitably cause the front to fall off.
341 The other files served by the
343 device are all single numbers:
352 parent's process number
360 .B /sys/src/9/port/devcons.c
362 For debugging, two control-T's followed by a letter
363 generate console output and manage debugging:
365 toggles whether the console debugger will be run if the system fails.
367 starts the console debugger immediately.
369 kills the largest process; use with care.
371 prints data about processes.
373 prints the run queue for processor 0.
375 prints the kernel stack.
377 prints data about kernel memory allocation.
379 The system can be rebooted by typing