Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Jul 2003 09:28:31 +0100
From:      Bruce M Simpson <bms@spc.org>
To:        freebsd-mobile@freebsd.org
Cc:        Adam Sulmicki <adam@cfar.umd.edu>
Subject:   Niche interest - viewing SMRAM on T22
Message-ID:  <20030708082831.GB22295@spc.org>

next in thread | raw e-mail | index | archive | help
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



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