3 arch \- architecture-specific information and control
17 This device presents textual information about PC hardware and allows
18 user-level control of the I/O ports on x86-class and DEC Alpha machines.
22 recover the processor type and clock rate in MHz.
25 yield at least data of this form:
34 cache 0x0 1073741824 wb
35 cache 0x3ff00000 1048576 uc
40 is the processor type,
42 is the processor speed in MHz,
45 is present only if the `page global extension' capability is present;
46 the next line reflects its setting.
54 showing the form of memory barrier used by the kernel.
60 reflecting the form of `compare and swap' used by the kernel.
62 is a flag, indicating the need to explicitly set
63 the Intel 8253 or equivalent timer.
64 There may be lines starting with
66 that reflect the state of memory caching via MTRRs
67 (memory-type region registers).
68 The second word on the line is
70 or a C-style number which is the base physical address of the region;
71 the third is a C-style length of the region;
72 and the fourth is one of
84 A region may be a subset of another region, and the smaller region
86 This may be used to make I/O registers uncachable
87 in the midst of a write-combining region mostly used
88 for a video framebuffer, for example.
89 Control messages may be written to
91 and use the same syntax as the data read from
93 Known commands include
103 return I/O ranges used by each device, one line
105 Each line contains three fields separated by white space: first address
107 last address, name of device.
111 return the enabled interrupts, one line per
112 interrupt. Each line contains three fields separated by white space:
113 the trap number, the IRQ it is assigned to, and the name of
121 cause 8-bit wide, 16-bit wide, and 32-bit wide requests to
123 The port accessed is determined by the byte offset of the
128 go to the P4/P6/Core/Core2/AMD64 MSRs.
130 The following code reads from an x86 byte I/O port.
134 inportb(unsigned port)
139 iobfd = open("#P/iob", ORDWR);
141 seek(iobfd, port, 0);
142 if(read(iobfd, &data, sizeof(data)) != sizeof(data))
143 sysfatal("inportb(0x%4.4ux): %r", port);
148 .B /sys/src/9/pc/devarch.c