Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Jan 2009 14:07:43 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-hackers@freebsd.org
Cc:        Andriy Gapon <avg@icyb.net.ua>
Subject:   Re: usb keyboard vs btx: an SMI theory
Message-ID:  <200901211407.44021.jhb@freebsd.org>
In-Reply-To: <4947AA3C.4040005@icyb.net.ua>
References:  <4947AA3C.4040005@icyb.net.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 16 December 2008 8:16:44 am Andriy Gapon wrote:
> Again, I am very fuzzy about the exact details, but I think that this is
> something that could be happening and I think that SMI is of primary
> interest here. I also think that this might explain to a certain degree
> the difference in behavior between "older" btx and "newer" btx.

One thing to keep in mind is that when an SMI# is delivered, the processor 
enters System Management Mode (SMM).  In SMM, the CPU actually uses a 
different set of memory for its RAM.  It also runs in a sort of weird 32-bit 
real mode.  It is not going to call the stock IRQ 1 handler.  Instead, it 
passes data back to "normal" mode by changing the values restored into 
registers when exiting SMM.  Typically doing an I/O port access to the ports 
backing the keyboard (0x60 and 0x64) cause an SMI# and the SMM handler 
emulates the inb/outb request by storing the resulting data for an inb in 
the %ax register the "normal" mode sees once it resumes execution after 
the 'inb' instruction.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200901211407.44021.jhb>