You're lucky. You only need a free parallel port, a DB25 connector, 2 
pieces of wire, and a switch.

You should try to build a loadable module (or a program with root access to 
ports) that scans the
"printer status register".

Look your BIOS about the address of the parallel port (if it's 0x378, the 
status register is the next one 0x379)

You can connect a switch between the pins 10 (Ack) or 11 (Busy) and
a pin with GND (i.e. 25). Then using a (inb(0x379) & mask) you can read the 
status of the switch and if you want,
you can call the shutdown -t now when the switch is turned on. That's all.

Take care about the electrical noise, you'd better make a few scans before 
shutting down the system (;>



                             Parallel Printer Port

        Port 3BC printer data output  (readable)

         |7|6|5|4|3|2|1|0|  ports 278, 378, 3BC
          | | | | | | | +---- data bit 0, hardware pin 2
          | | | | | | +----- data bit 1, hardware pin 3
          | | | | | +------ data bit 2, hardware pin 4
          | | | | +------- data bit 3, hardware pin 5
          | | | +-------- data bit 4, hardware pin 6
          | | +--------- data bit 5, hardware pin 7
          | +---------- data bit 6, hardware pin 8
          +----------- data bit 7, hardware pin 9

        Port 3BD printer status register   (Parallel Printer Port)

         |7|6|5|4|3|2|1|0|  ports 279, 379, 3BD
          | | | | | | | +---- 1 = time-out
          | | | | | +------- unused
          | | | | +-------- 1 = error,  pin 15
          | | | +--------- 1 = on-line,  pin 13
          | | +---------- 1 = out of paper,  pin 12
          | +----------- 0 = Acknowledge,  pin 10
          +------------ 0 = busy,  pin 11

        Port 3BE printer control register   (Parallel Printer Port)

         |7|6|5|4|3|2|1|0|  ports 27A, 37A, 3BE
          | | | | | | | +---- 1 = output data to printer,  (pin 1)
          | | | | | | +----- 1 = auto line feed,  (pin 14)
          | | | | | +------ 0 = initialize printer,  (pin 16)
          | | | | +------- 1 = printer reads output,  (pin 17)
          | | | +-------- 0 = IRQ disable,1=IRQ enable for ACK
          +------------- unused




-----Mensaje original-----
De:     Ken Teh [SMTP:[EMAIL PROTECTED]]
Enviado el:     jueves 24 de mayo de 2001 3:11
Para:   Real Time Linux
Asunto: [rtl] off-topic: ctrl-alt-delete



I have a rackmount PC with a hard disk, no monitor, no keyboard,  which I
would like to be able to run shutdown properly at the push of a button.
Right now I'm using a keyboard to push ctrl-alt-delete to do this, but I
was
wondering if anyone knows of something more elegant.  A keyboard is a
mighty
big switch :)

Thanks!

-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to