[coreboot] Dynamic detection of Parallel Port
stepan at coresystems.de
Sat Dec 6 23:32:26 CET 2008
Joseph Smith wrote:
> For the Paraflasher project I would like to setup a function to
> automatically detect the presence of the PC's parallel ports and their base
> addresses. This way it doesn't need to be hard-coded into the program. I
> was thinking of using /proc/ioports to do this but I am not really sure how
> to do this in C. Here is what I am thinking:
> 1. First use grep -c paraport /proc/ioports to check if we have multiple
> parallel ports and maybe setup loop for it.
> 2. Then grep paraport /proc/ioports again to get the base address of each
> parallel port detected. This is where I am stuck. I just need to turn the
> first 4 characters (base address) into a variable. Can anyone help???
Check out http://people.redhat.com/twaugh/parport/html/parportguide.html
It has some information on how to use /dev/partportX for your purposes.
coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br.
Tel.: +49 761 7668825 • Fax: +49 761 7664613
Email: info at coresystems.de • http://www.coresystems.de/
Registergericht: Amtsgericht Freiburg • HRB 7656
Geschäftsführer: Stefan Reinauer • Ust-IdNr.: DE245674866
More information about the coreboot