Niche interest - viewing SMRAM on T22
Bruce M Simpson
bms at spc.org
Tue Jul 8 01:30:29 PDT 2003
Hi,
Here's a hack for those who'd like to read the Systems Management
Mode memory segment on their ThinkPad T22. The hack described should work
for any i440BX chipset based laptop.
This is probably only of interest if you like to hack BIOS.
This is lifted from some incomplete C code I have for the hack. Using
the shell commands described is easier but makes assumptions about
the position of the host bridge device on the bus.
---8<---
* It appears as though my ThinkPad does not map SMRAM at the default
* location. This isn't too much of a surprise. Firmware is responsible
* for reprogramming the default location, and has to issue an SMI
* during boot in order to do this. The actual SMI handler code is
* located at SMBASE+0x8000. A quick way of issuing the SMI is to use
* the on-chip APIC. A number of vendor BIOS do it this way.
*
* Can we discover if the host bridge remaps SMBASE? Yes.
* on the i440BX host bridge, check the SMRAMC register.
*
* There are two modes: Compatible and Extended SMRAM. Compatible mode
* is meant to be backwards compatible with older BIOS PM code.
* The C_BASE_SEG bits will tell you where the SMRAM memory
* really is. Setting D_OPEN to high will let you get at the SMRAM memory.
*
* If your VGA controller mapping is active, it would be a good idea not
* to use it while you're doing this.
*
* My ThinkPad's BIOS doesn't set the lock bit.
* By poking D_OPEN to 1, I was able to extract the SMRAM segment from
* my machine.
* # pciconf -r -b pci0:0:0 0x72
* 0a
* # pciconf -w -b pci0:0:0 0x72 0x4A
* # dd bs=0x1000 skip=0xA0 count=0x20 if=/dev/mem of=./foo
* # pciconf -w -b pci0:0:0 0x72 0x0A
---8<---
Ciao!
BMS
More information about the freebsd-mobile
mailing list