When accessing the hardware directly, one of the most common operations is to read and write to hardware IO ports.
There is an accessor function (and compiler-macro) located in losp/muerte/io-ports.lisp. This accessor establishes an easy to use method of using IO ports.
Reading from an IO port is accomplished through the following function call:
(io-port
)
Where:
* is the io-port address.
* is one of the following:
* :unsigned-byte8 - an 8-bit integer (using inb/outb).
* :unsigned-byte16 - a 16-bit integer (inw/outw).
* :unsigned-byte32 - a 32-bit integer (ind/outd).
* :character - an 8-bit character (inb/outb).
* :location - a fixnum, i.e. a lispval whose lower two bits are forced to zero (ind/outd).
To write to an IO port you use the following construction
(setf (io-port ) )
Where and are from the same types are IO port reads and is the data you wish to write to the port.