PBIO(4)
okay bestie, welcome to the pbio(4) page from the i386 Kernel Interfaces Manual π¦ β this one is lowkey iconic if you're into direct hardware vibes.
β¨ NAME β¨
pbio β 8255 parallel peripheral interface basic I/O driver π
π οΈ SYNOPSIS π οΈ
device pbio
In /boot/device.hints:
hint.pbio.0.at="isa"
hint.pbio.0.port="0x360"
#include <dev/pbio/pbioio.h>
π DESCRIPTION π
okay so the pbio driver gives you direct access to the Intel 8255A programmable peripheral interface (PPI) chip running in mode 0 (simple I/O). Such an interface provides 24 digital I/O lines β¨. The driver is designed for performing I/O under program control using peripherals such as the Advantech PCL-724 card, which emulates the Intel 8255A PPI in mode 0. Other 8255A-based peripherals such as the BMC Messsysteme PIO24II card have also been reported to work β slay π«Ά.
The PPI provides two 8-bit ports (port A and port B) and two 4-bit ports (port C upper, port C lower). Each port can be individually programmed for input and (latched) output, and appears at a different offset of the device's base I/O address.
A separate register allows the configuration of ports for input or output. The device is so simple that reliably probing for it when input data arrives at its terminals is impossible π. Therefore the kernel configuration has to specify the device's base address. The device driver provides four character devices that correspond to the peripheral's I/O ports. Opening a device for read or write automatically configures the corresponding hardware port for input or output. At boot time all ports are set configured for input to avoid damaging external circuitry β protect the circuitry, bestie π«Ά.
A set of ioctl(2) requests allows polled input and paced output to be efficiently performed at the driver level without expensive user/kernel context switching. The driver can perform I/O in three different ways:
- Basic β the read or write operation returns immediately after reading or writing the data to the port at bus speed.
- Paced β data is transferred from or to the port at intervals specified by a separate
ioctl(2)call. - Differential β (input only.) Only port values that differ from the previous port value are returned.
The pacing interval is specified in Hz unit increments. Setting a pace of n seconds will result in no more than one value being read or written every n seconds. Single byte read/write operations will take at least n seconds to complete.
The following ioctl(2) calls are supported:
PBIO_SETDIFFβ accepts a pointer to an integer as the third argument, and sets the driver for differential input if the integer is non-zero. The input pace speed determines the periodic interval the driver will use to examine the port for a changed value.PBIO_GETDIFFβ accepts a pointer to an integer as the third argument, and sets the integer to the last set value for differential input.PBIO_SETIPACEβ accepts a pointer to an integer as the third argument, and sets the driver's input pacing speed to the value of that integer.PBIO_GETIPACEβ accepts a pointer to an integer as the third argument, and sets the integer to the last set value for the input pace.PBIO_SETOPACEβ accepts a pointer to an integer as the third argument, and sets the driver's output pacing speed to the value of that integer.PBIO_GETOPACEβ accepts a pointer to an integer as the third argument, and sets the integer to the last set value for the output pace.
π FILES π
/dev/pbio0aβ Port A (8 bit I/O)./dev/pbio0bβ Port B (8 bit I/O)./dev/pbio0chβ Port C upper (4 bit I/O)./dev/pbio0clβ Port C lower (4 bit I/O).
π SEE ALSO π
Diomidis Spinellis, βThe information furnace: Consolidated home controlβ, Personal and Ubiquitous Computing, 1, 7, 53-69, 2003.
π° HISTORY π°
The pbio device was first used under FreeBSD 4.1.
π AUTHORS π
Diomidis D. Spinellis <dds@aueb.gr> π
π BUGS π
One of the PCL-724 card's inputs can optionally be wired to generate an interrupt. This feature is not supported β so close, but no π.
mwah π β this page is the Debian version, dated January 14, 2005, and it's PBIO(4) π«Ά.
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2000-2002 Diomidis D. Spinellis, Athens, Greece
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms