io

Read from and write to I/O registers and memory (QNX Neutrino)

Syntax:

io width[*number[+]] [options] address[range] [value]

Runs on:

QNX Neutrino

Options:

The arguments must appear in the following order:

width[*number[+]]
The width you're interested in reading or writing. The possible values are:
  • 8 bits: 8, 8b, 1B, or b
  • 16 bits: 16, 16b, 2B, or s
  • 32 bits: 32, 32b, 4B, or l (i.e., lowercase L)
  • 64 bits: 64, 64b, 8B, ll (i.e., lowercase LL), or L

On x86 and x86_64 systems, a width of 64 bits is available only as a memory access.

If the width is followed by an asterisk (*), the value that follow is the number of successive, incremental reads or writes to do. A plus sign (+) specifies that each successive write increments the value to be written. This has a meaning only when you specify a write value.

options
A comma-separated list of options, which include the following:
mem
Operate on memory instead of an I/O register. You need this only on systems with a separate address space for I/O and memory, such as x86.
be, le
Do a big- or little-endian read or write. It's invalid to specify both be and le.
priv
Request privileged access. This may be necessary on some ARM modules.
address[range]
The address to begin reading from or writing to.

After the address, you can provide a range in square brackets that specifies that the operation occurs only on part of the bit range of the selected register(s). For example, to operate only on the first byte of a register, specify [0:7] for the range.

value
The value to write. If you don't specify a value, io reads from the given location.

Description:

The io utility reads and writes memory and I/O registers.

Note: This utility is useful for debugging but is a security hole. Never include io on production systems.

Examples:

Read 32 bits from address 0x80000000 and display them:

io 32 0x80000000

Write a value of 0xAA00AA00F000F000 to the address 0x80000000:

io 64 0x80000000 0xAA00AA00F000F000

Write 0 to 0x80000000, 1 to 0x80000002, and so on (four 16-bit writes):

io s*4+ 0x80000000 0

Set the thirty-first bit of 0x80000000:

io 32 0x80000000[31] 1

Request privileged access and do a big-endian write to the first two bytes of 0x80000000:

io 32 be,priv 0x80000000[:15] 0x501F

The effects of this command on memory are as follows: