From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <200606290531.k5T5VQ1W000476@ducky.net> To: 9fans@cse.psu.edu From: Mike Haertel <9fans@ducky.net> Subject: Re: [9fans] usb keyboard and mouse? Date: Wed, 28 Jun 2006 22:31:26 -0700 Topicbox-Message-UUID: 7029f24e-ead1-11e9-9d60-3106f5b1d025 Er, no. Legacy keyboard emulation is intended to work with any OS, even if the OS bypasses the BIOS and directly fiddles with the PS/2 hardware. It uses chipset magic to translate "in" and "out" operations to ports 0x60 and 0x64 (the PS/2 keyboard ports) into USB operations. The implementation is chipset dependent. Often what happens is that the chipset recognizes an I/O request to port 0x60 or 0x64 and aborts the request with an SMI (system management interrupt). This is a *very* non-maskable interrupt (more non-maskable than NMI...) that causes the processor to save pretty much all its register state in a special memory area, and jump to a handler in the system BIOS. The BIOS SMI handler examines the saved register state, figures out what the OS was trying to do, runs a software model of the PS/2 keyboard controller's state, chats with the USB keyboard, formulates an appropriate response, emulates the I/O instruction the OS was trying to do, and resumes execution of the OS at the instruction following the I/O instruction. Some chipsets might do it directly in hardware rather than using the SMI+BIOS strategy. >From: "Artem Letko" >To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu> > >but that's only if your kernel uses BIOS calls, right? > >On 6/26/06, geoff@collyer.net wrote: >> Some BIOSes have an option with a name like "enable legacy USB" or >> "enable USB keyboard" that, if set, will simulate PS2 input from a USB >> keyboard or mouse.