Path: utzoo!mnetor!uunet!husc6!linus!mbunix!jcmorris From: jcmorris@mitre-bedford.ARPA (Joseph C. Morris) Newsgroups: comp.os.minix Subject: Re: How do you turn on the AT's LEDs? Message-ID: <22954@linus.UUCP> Date: 28 Jan 88 15:09:37 GMT References: <1832@botter.cs.vu.nl> <4240@eagle.ukc.ac.uk> Sender: news@linus.UUCP Reply-To: jcmorris@mbunix (Morris) Organization: The MITRE Corporation, McLean, VA. Lines: 56 Summary: Try it. In article <1836@botter.cs.vu.nl> ast@cs.vu.nl (Andy Tanenbaum) writes: >As everyone with MINIX on an AT has observed, hitting caps lock does not turn >on the LED. (Another response to Andy's message): This is a pseudo-code summary of the LED code in the original AT. As usual, no guarantees, and your mileage may vary. (This code doesn't exactly match the executive summary I recently posted. It's amazing how much detail one can find in a program when you read it carefully...8-)= write_led(bits): IF led_update_in_progress THEN EXIT SET led_update_in_progress DISMISS_INTERRUPT [send EOI to port 020h] CALL kb_send (LED_CMD) [LED_CMD = 007h] IF send_err GOTO sl2 CALL kb_send (bits) [low three bits set 3 LED's] IF send_err GOTO sl3 sl2: CALL kb_send (KB_ENABLE) [KB_ENABLE = 0f4h] sl3: RESET led_update_in_progress RESET send_err EXIT kb_send(byte): sd0: RESET kb_fa RESET kb_fe sd5: IN KB_STATUS [KB_STATUS = port 064h] IF inpt_buf_full THEN GOTO sd5 [inpt_buf_full = 002h] OUT PORT_A,byte [PORT_A = port 060h] sd1: IF (kb_fa or kb_fe) THEN GOTO sd3 IF NOT 01a00_times_here THEN GOTO sd1 [approx. 10 msec] sd2: IF NOT 3rd_time_here THEN GOTO sd0 [retry limit] SET send_err EXIT sd3: IF kb_fa THEN EXIT [if keyboard acknowledge] GOTO sd2 [must be resend order] [part of keyboard interrupt follows:] ... [scan code has been read ... from keyboard] IF SCAN EQ kb_ack THEN [kb_ack = 0fah] { [keyboard acknowledge] SET kb_fa GOTO kb_exit [exit from keyboard interrupt] } IF SCAN EQ kb_resend THEN [kb_resend = 0feh] { [keyboard requests resend] SET kb_fe GOTO kb_exit } ... Hope this helps... /Joe Morris