File: README

package info (click to toggle)
ioport 1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 416 kB
  • sloc: sh: 1,072; ansic: 165; makefile: 49
file content (33 lines) | stat: -rw-r--r-- 1,156 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
I/O port access from the command line
By Richard W.M. Jones
----------------------------------------------------------------------

This package adds commands to access machine I/O ports directly.  For
example:

  outw 0x443 0xf
  inb 0x278

Note most of the time you should never use these commands unless you
know what you are doing.

Usage
----------------------------------------------------------------------

The commands are pretty much used as you would expect.  For additional
help, use '--help' and/or read the manual page.

You will need to run the commands as root.  Strictly speaking you will
need CAP_SYS_RAWIO capability.

Implementation
----------------------------------------------------------------------

At first glance it would seem that /dev/port would be the best way to
access I/O ports.  However /dev/port under Linux is fundamentally
flawed because it only allows byte-sized access to ports.  For example
if you write a single long (4 bytes) it will turn that into 4
individual outb operations.

Instead we use iopl(2) to raise our I/O privilege level so that we can
do the correct in<size> and out<size> operation as requested.