logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

inb, outb, inw, outw, inl, outl - access I/O ports

Authors

       Richard W.M. Jones <rjones @ redhat . com>

Description

       These commands enable command line and script access directly to I/O ports on PC hardware.

       The "inb", "inw" and "inl" commands perform an input (read) operation on the given I/O port, and print
       the result.

       The "outb", "outw" and "outl" commands perform an output (write) operation to the given I/O port, sending
       the given data.  Note that the order of the parameters is ADDRESS DATA.

       The size of the operation is selected according to the suffix, with "b" meaning byte, "w" meaning word
       (16 bits) and "l" meaning long (32 bits).

       Port numbers are in the range 0-0xffff.  We don't support access to memory mapped devices.

       Hexadecimal numbers (prefixed by "0x"), decimal numbers, and octal numbers (prefixed by 0), are allowed
       as parameters.

Examples

        inb 0x278
        outw 0x440 0xffff

Name

       inb, outb, inw, outw, inl, outl - access I/O ports

Permissions

       You would normally need to be root or have the "CAP_SYS_RAWIO" capability in order to run these commands.

Return From "In" Operations

       The value read from the port by an "in" operation is normally printed in decimal.

       Use the "--hex" option to print the result as hexadecimal ("0x" prefix is NOT printed).

       Use the "--code" option to turn the result into an exit status.  Note that Unix/shell can only reliably
       return exit status in the range 0-0x7f, so this is not particularly useful in practice.

See Also

Synopsis

        inb ADDRESS
        inw ADDRESS
        inl ADDRESS
        outb ADDRESS DATA
        outw ADDRESS DATA
        outl ADDRESS DATA

Type And Size Of Operation

       The type and size of the operation is normally determined by the name of the command, eg. "inb" is a read
       operation of 1 byte.

       You can override this by using the "--read", "--write" and/or "--size N" options.  For "--size N", "N"
       should be 1, 2 or 4 meaning byte, word and long respectively.

Warning

       Using these commands can cause Bad Things to happen to your hardware.

See Also