From: Jon E. <el...@pi...> - 2006-05-27 05:41:44
|
jmk...@at... wrote: >Jon Elson <el...@pi...> wrote: > > > >>2. Some computers need the program "pcisetup" to select the EPP mode, >>the BIOS setup just seems to enable that mode. That program can be >>loaded from http://pico-systems.com/codes/pcisetup >>You run it with this command : >>sudo ./pcisetup 378 >>You may need to set the executable bit on thiese with : >>chmod u+x <program name> >> >> > >Is pcisetup a GPL program? If so, and if it is needed in some systems >to run EMC, it should be part of EMC. I would suggest putting the source >in src/hal/utils, along with the user space program that loads M5I20 FPGA >config into the chip on that board. > > It certainly should be GPL-able, it is about 5 lines of C. The actual function is to write hex 80 to an I/O byte address 0x402 past the parallel port's data register. (The insane disjunct addresses are part of the insane PC architecture, the par port config regs are in the floppy controller.) The code is at http://pico-systems.com/codes/pcisetup.c if anyone wants to hack on this. >Is pcisetup a program that sets the parport to EPP mode? Seems that >way, but if so, the name is horrible, since the program has nothing to >do with the PCI bus. Before adding it to EMC its name should be changed >to something less confusing. "setepp" maybe? I'm open to suggestions. > > > Umm, yes, sort of. Actually, the program was first used to make a PCI plug-in par port card work, I later fond it was needed on all Dell computers for the mo bo par port, too. Yes, the name is descended from a 10 minute program I wrote on a Saturday afternoon to get one customer's computer up. I had no idea it would develop such legs! >Does pcisetup have any undesirable side effects on systems that >_don't_ need it? > I don't know, but blindly writing to an essentially random byte in I/O space sounds really dangerous to me. If some other par port card caused the + 0x402 address to wind up in the ATA disk controller, the result could be catastrophic. That's why I decided to NOT make it a part of the ppmc driver. Maybe there's a way to probe the PCI plug-n-play database to determine if the I/O port address is associated with another block starting at + 0x400, and that would indicate it is safe to do what pcisetup currently does. But, I know nearly nothing about P-n-P. > If not, then the univpwm and univstep configs >can invoke it by default. Just use a "loadusr -w progname" line >in the hal file before you attempt to loadrt the driver. "progname" >should be new name of the program - maybe "seteppmode" or something. > >Finally, emc2 has after much effort gotten away from the need for the >user to run _anything_ sudo, and I don't want to go back. setepp or >pcisetup or whatever its called should be setuid, like module_helper. > > > Yes, I can do this, but the program essentially allows you to write 0x80 into ANY I/O byte you choose. That could be a big security hole. Jon |