Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Parallel port
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==IBM PC implementation== === Port addresses === Traditionally IBM PC systems have allocated their first three parallel ports according to the configuration in the table below (if all three printer ports exist). {| class="wikitable" |- ! <small>PORT NO</small> !! <small>[[Interrupt]] #</small> !! <small>Starting [[I/O Address|I/O]]</small> !! <small>Ending [[I/O Address|I/O]]</small> |- | <code>#1</code> || <code>[[Interrupt Request|IRQ]] 7</code> || <code>0x3BC</code><ref name="Gilluwe_1994"/> || <code>0x3BF</code> |- | <code>#2</code> || <code>[[Interrupt Request|IRQ]] 7</code> || <code>0x378</code><ref name="Gilluwe_1994"/> || <code>0x37F</code> |- | <code>#3</code> || <code>[[Interrupt Request|IRQ]] 5</code> || <code>0x278</code><ref name="Gilluwe_1994"/> || <code>0x27F</code> |} If there is an unused slot, the port addresses of the others are moved up. (For example, if a port at 0x3BC does not exist, the port at 0x378 will then become the first logical parallel port.)<ref name="Gilluwe_1994">Frank Van Gilluwe, The Undocumented PC, 1994, page 703, {{ISBN|0-201-62277-7}}</ref> The base address 0x3BC is typically supported by printer ports on MDA and Hercules display adapters, whereas printer ports provided by the mainboard chipset or add-on cards rarely allow to be configured to this base address. Therefore, in absence of a monochrome display adapter, a common assignment for the first logical parallel port (and therefore also for the corresponding LPT1 DOS device driver) today is 0x378, even though the default is still 0x3BC (and would be selected by the BIOS if it detects a printer port at this address). The IRQ lines are typically configurable in the hardware as well. Assigning the same interrupt to more than one printer port should be avoided and will typically cause one of the corresponding ports to work in polled mode only. The port addresses assigned to slot can be determined by reading the [[BIOS Data Area]] (BDA) at 0000h:0408h. Bit-to-pin mapping for the Standard Parallel Port (SPP): {| class="wikitable" |- ! <small>Address</small> !! !! <small> [[Most significant bit|MSB]] </small> !! !! !! !! !! !! !! <small>[[Least significant bit|LSB]]</small> |- | || Bit: || 7 || 6 || 5 || 4 || 3 || 2 || 1 || 0 |- | <code>Base (Data port)</code> || Pin: || 9 || 8 || 7 || 6 || 5 || 4 || 3 || 2 |- | <code>Base+1 (Status port)</code> || Pin: || ~11 || 10 || 12 || 13 || 15 || || || |- | <code>Base+2 (Control port)</code> || Pin: || || || || || ~17 || 16 || ~14 || ~1 |} ~ indicates a hardware inversion of the bit. === Program interface === In versions of [[Microsoft Windows|Windows]] that did not use the [[Windows NT]] kernel (as well as [[DOS]] and some other operating systems), programs could access the parallel port with simple outportb() and inportb() subroutine commands. In operating systems such as [[Windows NT]] and [[Unix]] ([[NetBSD]], [[FreeBSD]], [[Solaris (operating system)|Solaris]], [[386BSD]], etc.), the microprocessor is operated in a different security ring, and access to the parallel port is prohibited, unless using the required driver. This improves security and arbitration of device contention. On Linux, inb() and outb() can be used when a process is run as root and an ioperm() command is used to allow access to its [[base address]]; alternatively, ppdev allows shared access and can be used from userspace if the appropriate permissions are set. The cross-platform library for parallel port access, libieee1284, also is available on many Linux distributions and provides an abstract interface to the parallel ports of the system. Access is handled in an open-claim-release-close sequence, which allows for concurrent access in userspace.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)