Take a look at our
ThinkPads.com HOME PAGE
For those who might want to contribute to the blog, start here: Editors Alley Topic
Then contact Bill with a Private Message

Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

T60/T61 Series
Message
Author
liyifan
Posts: 30
Joined: Wed Jun 20, 2007 10:40 pm
Location: Edmonton, Alberta, Canada

#44 Post by liyifan » Sun Jun 24, 2007 1:27 pm

axiom wrote: btw, how did you find out the TOLUD is at C0000000?
Send 0x8000009C to I/O port 0xCF8, and then read a byte from port CFC, see the 945 specification link I posted earlier.
axiom wrote:I am really interested to know the result of the memmap boot parameter, its job is exactly to fill in the gaps the e820 memory map leaves out.
(the e820 map fetching code is located @ /usr/src/linux/arch/i386/kernel/e820.c )

btw, how did you find out the TOLUD is at C0000000?
OK, I see that you are really one persistent guy, may be more than I am :-) I believe it will not work but if you can PM me the exact modification that is needed to the ubuntu 7.10 live CD http://cdimage.ubuntu.com/daily-live/current/ I promise I'll PM you back the results once I have the time to try it.
T60P, T7200, 4GB, FireGL 5250, 3945ABG, nice little baby.

adidasprince
Posts: 34
Joined: Wed Mar 07, 2007 1:54 am
Location: Tokyo, Japan
Contact:

Re: Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

#45 Post by adidasprince » Wed Jan 28, 2009 1:20 am

I found some explanation of 3.0GB issue.

Here is it. (from README for BIOS Update Utility 2.23)
BIOS INFORMATION

Memory Map Information
----------------------

Reserved Area:
The following conventional memory addresses are reserved by the BIOS
and others.

ATI Mobility Radeon X1300/X1400/FireGL V5200 models

C0000-CFFFF : Reserved for Video BIOS
D0000-D1FFF : Reserved for Option ROM of Ethernet (*1)
DC000-DFFFF : Reserved for USB BIOS (*2)
E0000-FFFFF : Reserved for System BIOS

Intel Graphics Media Accelerator 950 model

C0000-CE7FF : Reserved for Video BIOS
CE800-D07FF : Reserved for Option ROM of Ethernet (*1)
DC000-DFFFF : Reserved for USB BIOS (*2)
E0000-FFFFF : Reserved for System BIOS

Notes:
*1: This area becomes free by disabling the Internal Network Option
ROM option under Config and Network in the BIOS Setup Utility.
This choice will disable PXE and WOL features.
*2: This area becomes free by disabling the USB BIOS Support option
under Config and USB in the BIOS Setup Utility.
This choice does not affect using USB devices in Windows
operating systems.

Usable Area:
The following memory address can be used by the memory manager such as
EMM386.

ATI Mobility Radeon X1300/X1400/FireGL V5200 models

D2000-DBFFF

Intel Graphics Media Accelerator 950 model

D0800-DBFFF

Note: Certain addresses in this area will be reserved for CardBus
Controllers or others by Operating Systems.
The addresses vary and depend on the design of each Operating
System.
So ... , my answer is We can choose 3.0GB or 3.25 or 3.5 by ourselves.
IBM ThinkPad T60p 2007-93J

Uncle Joe
Posts: 26
Joined: Thu Aug 13, 2009 1:58 am
Location: Vienna, VA

Re: Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

#46 Post by Uncle Joe » Thu Aug 13, 2009 3:39 am

Good news. I have a Lenovo 3000 N100 and I managed to mod it to recognize 3.5Gb RAM.
I'm pretty sure Lenovo isn't going to bother to release an updated BIOS, so I decided to do it myself.

Here's how I did it.

1. NOP some instruction in ROMEXEC0.ROM (BIOS code) that sets D_LCK bit in i945 memory controller. This allows
TOLUD to be changed. I used Phoenix BIOS Editor to unpack then repack. Then I reflashed the BIOS.

2. Remap PCI devices that use memory in [c0000000, e0000000). Namely, the Geforce's 256Mb framebuffer
was remapped from c0000000 to e0000000. Specifically, change PCI_BASE_ADDRESS_* for each device
and PCI_IO_BASE, PCI_IO_LIMIT for bridges.

3. Change the memory mapped IO base of the PCIX extended configuration space from e0000000 to f8000000.
This involves setting i945's PCIEXBAR and patching the MCFG ACPI table accordingly.

4. Change i945's TOLUD from c0 to e0

5. Update MTRR registers accordingly

6. Install a hook to override the int 0x15, e820 memory map

Steps 2 to 6 were performed by writing a GRUB2 module.

Things work great with both Vista and Debian. I'm running/testing some pretty large graph centrality algorithms + other simulations, so every piece of RAM helps. I also won't have to close Team Fortress 2 when I switch tasks. The only problem so far is suspend/resume is broken, but I always have the option of disabling the 3.5Gb mod from the boot loader.

If anyone wants detailed instructions, I'll be happy to share them.

Yale

yak
ThinkPadder
ThinkPadder
Posts: 1256
Joined: Thu Dec 06, 2007 3:17 pm
Location: NRW, Germany

Re: Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

#47 Post by yak » Thu Aug 13, 2009 5:02 am

Uncle Joe, good job and welcome on-board!

Could this be released in a form usable for less savvy users? A BIOS binary possibly?
ThinkPad™ X201 / AFFS-120
i5-560M 2.67Ghz, 8GB RAM, Samsung 840 Pro 256GB SSD, Win 8 Pro 64-bit, UltraBase X200, ThinkPad Compact USB Keyboard,
Dell U2713HM (2560x1440, IPS), ExpressCard USB 3.0 (2 ports, flush), Nexus 7+10

Uncle Joe
Posts: 26
Joined: Thu Aug 13, 2009 1:58 am
Location: Vienna, VA

Re: Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

#48 Post by Uncle Joe » Thu Aug 13, 2009 6:05 am

Great, looks like I have customers.

Doing all those fixups I described in the BIOS is the ideal solution, but is not possible currently because:
1. My fix-up code has hard coded values that assume certain PCI addresses, TOLUD, etc. Dynamic detection anyone?
2. ACPI sleep/resume is broken, so until it's fixed, you probably don't want the mod permanently in the BIOS.
3. I don't know how to inject custom code into the BIOS. So far I only NOPed 3 instructions. BIOS code seems pretty
tightly packed, so I probably can't overwrite existing code and call it.

Right now, the only practical way I know of to do this mod is to write a grub2 module (grub2 has ability to hook int 0x15, e820 and override the physical memory map). This is going to be a hassle for most people who don't have GNU/Linux installed because you'll have to install grub2, which I don't know how to except from Linux (maybe systemrescuecd can let you do this without needing to install Linux). I did write a hello world boot loader for testing purposes during this project, so maybe the fix-ups can be installed into the master boot record.

For those of you who like using bleeding edge software and have grub2, I've posted my grub2 code & how to do the BIOS mod at the bottom (why don't I see attach file option?).

My module should also work for the Thinkpad T60, since they both use the i945. Can someone add a post to the 4Gb sticky thread and tell them > 3Gb is possible? I originally expected to be able to use 3.7Gb RAM, but unfortunately, the GeForce framebuffer had to be mapped on an aligned address, resulting in ~250Mb waste. If your laptop graphics board
doesn't have such a large memory window, then you should be able to get > 3.5Gb.

Then there's the question of how to mod the T60 BIOS. I took a look at Thinkpad BIOS 2.23 and it looks like almost the exact
code as in the Lenovo BIOS is used to set the D_LCK bit of the SMRAM register (ndisasm -a $01A3000.FL1):

Code: Select all

0011AB29  B09D              mov al,0x9d              SMRAM register
0011AB2B  BB4B46            mov bx,0x464b         return address
0011AB2E  FF                db 0xff
0011AB2F  E994FE            jmp word 0xa9c6       read SMRAM
0011AB32  80CC10            or ah,0x10               set D_LCK
0011AB35  BB547F            mov bx,0x7f54
0011AB38  46                inc si
0011AB39  E991FE            jmp word 0xa9cd       write SMRAM
I don't know if just replacing the or with nops will work because there's probably a checksum somewhere that will be wrong, resulting in complaints during boot. I used Phoenix BIOS Editor to repack the Lenovo BIOS, and I assume it fixes the checksum.

--------------------------------------------------------------------------------------------Attachments-----------------------------------------------------------------------------------------------------

Code: Select all

-----------------------------------4gb.c---------------------------------
#include <grub/types.h>
#include <grub/dl.h>
#include <grub/pci.h>
#include <stdint.h>
#include <grub/misc.h>

// grub_pci_make_address uses dword instead of byte addressing for register
#define PCI_ADDRESS(bus, dev, fun, reg)  (1U << 31) | (bus << 16) | (dev << 11) | (fun << 8) | reg

#define PCI_MEMORY_BASE         0x20
#define PCI_MEMORY_LIMIT        0x22

#define PCI_PREF_MEMORY_BASE    0x24
#define PCI_PREF_MEMORY_LIMIT   0x26

#define PCI_CB_MEMORY_BASE_0   0x1c
#define PCI_CB_MEMORY_LIMIT_0  0x20

#define PCI_CB_MEMORY_BASE_1   0x24
#define PCI_CB_MEMORY_LIMIT_1  0x28

#define true 1
#define false 0

typedef uint8_t bool;
extern uint8_t g_is_4gb;



// set bits [index + n - 1 : index] of x to v
uint32_t SetBits(uint32_t x, uint32_t index, uint32_t n, uint32_t v)
{
  uint32_t mask = (1 << n) - 1;
  mask <<= index;
  x &= ~mask;
  x |= (v << index);
  return x;
}


#define PCIX_CONF_BAR 0x48
#define PCI_BASE_ADDRESS_0 0x10
#define PCI_BASE_ADDRESS_1 0x14
#define PCI_BASE_ADDRESS_2 0x18
#define PCI_BASE_ADDRESS_3 0x1c
#define PCI_BASE_ADDRESS_4 0x20
#define PCI_BASE_ADDRESS_5 0x24


inline void wrmsr(unsigned reg, uint32_t low, uint32_t high)
{
  asm(
    "wrmsr"
    : : "c"(reg), "a"(low), "d"(high));
}

#define MTRRphysBase_MSR(reg) (0x200 + 2 * (reg))
#define MTRRphysMask_MSR(reg) (0x200 + 2 * (reg) + 1)
#define PAGE_SHIFT 12

// base, size are in pages; size *must* be power of 2 - I didn't realize this and notice memory bandwidth crawl to a halt
// base must be aligned on size
void SetMTRR(unsigned index, uint32_t base, uint32_t size, unsigned type)
{
  if (size == 0) {
    /* The invalid bit is kept in the mask, so we simply clear the
       relevant mask register to disable a range. */
    wrmsr(MTRRphysMask_MSR(index), 0, 0);
  } else  {
    wrmsr(MTRRphysBase_MSR(index), base << PAGE_SHIFT | type, (base & 0xf00000) >> (32 - PAGE_SHIFT));
    wrmsr(MTRRphysMask_MSR(index), -size << PAGE_SHIFT | 0x800, (-size & 0xf00000) >> (32 - PAGE_SHIFT));
  }
}

void SetBridgeMemoryRange(uint32_t pci_base, bool prefetchable, uint32_t base, uint32_t size)
{
  // note: bits[15:4] are bits 31:20 of full address - lower 4 bits unused
  uint32_t r = pci_base | (prefetchable ? PCI_PREF_MEMORY_BASE : PCI_MEMORY_BASE);
  uint16_t v = grub_pci_read_word(r);
  v |= (base & 0xfff00000) >> 16;
  grub_pci_write_word(r, v);
  r = pci_base | (prefetchable ? PCI_PREF_MEMORY_LIMIT : PCI_MEMORY_LIMIT);
  v = grub_pci_read_word(r);
  v |= ((base + size - 1) & 0xfff00000) >> 16;
  grub_pci_write_word(r, v);
}

void SetCardBridgeMemoryRange(uint32_t pci_base, bool prefetchable, uint32_t base, uint32_t size)
{
  grub_pci_write(pci_base | (prefetchable ? PCI_CB_MEMORY_BASE_0 : PCI_CB_MEMORY_BASE_1), base);
  grub_pci_write(pci_base | (prefetchable ? PCI_CB_MEMORY_LIMIT_0 : PCI_CB_MEMORY_LIMIT_1), (base + size - 1) & 0xfffff000);
}

// PCI spec states base must be aligned on region size to make address decoding easier (no subtracting addresses)
void SetDeviceMemoryBase(uint32_t pci_base, uint32_t reg, uint32_t base)
{
  uint32_t v = grub_pci_read(pci_base | reg);
  v &= 0xf;
  v |= (base & ~0xf);
  grub_pci_write(pci_base | reg, v);
}


uint8_t CacheOn(void)
{
  uint32_t cr0;
  asm("mov %%cr0, %0" : "=r"(cr0));
  return ((cr0 >> 30) & 0x1) == 0;
}

void wbinvd(void)
{
  asm volatile ("wbinvd");
}

void enable_cache(void)
{
  uint32_t cr0;
  asm("mov %%cr0, %0" : "=r"(cr0));
  cr0 &= 0x9fffffff;
  asm("mov %0, %%cr0" : : "r"(cr0));
}

void disable_cache(void)
{
  /* Disable and write back the cache */
  uint32_t cr0;
  asm("mov %%cr0, %0" : "=r"(cr0));
  cr0 |= 0x40000000;
  wbinvd();
  asm("mov %0, %%cr0" : : "r"(cr0));
  wbinvd();
}

#define MTRR_TYPE_UNCACHABLE 0
#define MTRR_TYPE_WRCOMB     1
#define MTRR_TYPE_WRTHROUGH  4
#define MTRR_TYPE_WRPROT     5
#define MTRR_TYPE_WRBACK     6

#define TOLUD 0x9c

GRUB_MOD_INIT (4gb)
{
  uint32_t mch_base = PCI_ADDRESS(0, 0, 0, 0),
    pcix_bridge0_base = PCI_ADDRESS(0, 1, 0, 0),  // root port
    pcix_bridge2_base = PCI_ADDRESS(0, 0x1c, 1, 0),
    geforce_base = PCI_ADDRESS(1, 0, 0, 0),
    audio_base = PCI_ADDRESS(0, 0x1b, 0, 0),
    usb_ehci_base = PCI_ADDRESS(0, 0x1d, 7, 0),
    south_bridge_base = PCI_ADDRESS(0, 0x1e, 0, 0),
    broadcom_base = PCI_ADDRESS(3, 0, 0, 0),
    realtek_8139_base = PCI_ADDRESS(5, 1, 0, 0),
    cardbus_bridge_base = PCI_ADDRESS(5, 4, 0, 0),
    firewire_base = PCI_ADDRESS(5, 6, 0, 0),
    sd_controller_base = PCI_ADDRESS(5, 6, 1, 0),
    mmc_controller_base = PCI_ADDRESS(5, 6, 2, 0),
    memory_stick_base = PCI_ADDRESS(5, 6, 3, 0),
    picture_card_base = PCI_ADDRESS(5, 6, 4, 0);

  g_is_4gb = true;   // tell grub_mmap_iterate to report more RAM

  disable_cache();     // do we really need to disable?
  grub_pci_write_byte(mch_base | TOLUD, 0xe0);

  // todo: this doesn't set MTRR on other core - apparently, issuing IPIs to do this seems pretty complicated
  SetMTRR(0, 0, 0x80000, MTRR_TYPE_WRBACK);
  SetMTRR(1, 0x80000, 0x40000, MTRR_TYPE_WRBACK);
  SetMTRR(2, 0xc0000, 0x20000, MTRR_TYPE_WRBACK);
  SetMTRR(3, 0xc0000 - 0x100, 0x100, MTRR_TYPE_UNCACHABLE);
  SetMTRR(4, 0xe0000 - 0x100, 0x100, MTRR_TYPE_UNCACHABLE);
  enable_cache();

  uint32_t pcix_conf_bar = grub_pci_read(mch_base | PCIX_CONF_BAR);
  pcix_conf_bar = SetBits(pcix_conf_bar, 26, 6, 0x3e);
  pcix_conf_bar = SetBits(pcix_conf_bar, 1, 2, 0x2);

  // need to write 2x because bits[2:1] need to be set before bits 27:26
  // can be written
  grub_pci_write(mch_base | PCIX_CONF_BAR, pcix_conf_bar);
  grub_pci_write(mch_base | PCIX_CONF_BAR, pcix_conf_bar);

  // root bus devices
  SetDeviceMemoryBase(audio_base, PCI_BASE_ADDRESS_0, 0xf0500000);
  SetDeviceMemoryBase(usb_ehci_base, PCI_BASE_ADDRESS_0, 0xf0504000);

  // PCIX root bridge
  SetBridgeMemoryRange(pcix_bridge0_base, true, 0xe0000000, 0x10000000);
  SetBridgeMemoryRange(pcix_bridge0_base, false, 0xf1000000, 0x2000000);

  SetDeviceMemoryBase(geforce_base, PCI_BASE_ADDRESS_0, 0xf2000000);
  SetDeviceMemoryBase(geforce_base, PCI_BASE_ADDRESS_1, 0xe0000000);
  SetDeviceMemoryBase(geforce_base, PCI_BASE_ADDRESS_3, 0xf1000000);

  // PCIX bridge 2
  SetBridgeMemoryRange(pcix_bridge2_base, false, 0xf0200000, 0x100000);
  SetBridgeMemoryRange(pcix_bridge2_base, true, 0xf0000000, 0x100000);
  
  SetDeviceMemoryBase(broadcom_base, PCI_BASE_ADDRESS_0, 0xf0200000);
  SetDeviceMemoryBase(broadcom_base, PCI_BASE_ADDRESS_2, 0xf0000000);

  // southbridge
  SetBridgeMemoryRange(south_bridge_base, false, 0xf0100000, 0x100000);
  SetBridgeMemoryRange(south_bridge_base, true, 0xf4000000, 0x4000000);
  
  SetDeviceMemoryBase(realtek_8139_base, PCI_BASE_ADDRESS_1, 0xf0100000);
  SetDeviceMemoryBase(sd_controller_base, PCI_BASE_ADDRESS_0, 0xf0100400);
  SetDeviceMemoryBase(firewire_base, PCI_BASE_ADDRESS_0, 0xf0100800);
  SetDeviceMemoryBase(mmc_controller_base, PCI_BASE_ADDRESS_0, 0xf0101000);
  SetDeviceMemoryBase(memory_stick_base, PCI_BASE_ADDRESS_0, 0xf0101400);
  SetDeviceMemoryBase(picture_card_base, PCI_BASE_ADDRESS_0, 0xf0101800);

  // cardbus is attached to southbridge
  SetCardBridgeMemoryRange(cardbus_bridge_base, true, 0xf4000000, 0x2000000);
  SetCardBridgeMemoryRange(cardbus_bridge_base, false, 0xf6000000, 0x2000000);

  volatile uint8_t *p;

  // DSDT
  p = (uint8_t *)0xbfee85b5;
  p[9] = 0x3b;    // checksum
  *(uint32_t *)&p[0x18f5] = 0xf8000000;  // pcix ext conf base
  *(uint32_t *)&p[0x18f9] = 0x04000000;  // pcix ext conf size
  *(uint32_t *)&p[0x1961] = 0xf8000000;
  *(uint32_t *)&p[0x1965] = 0x04000000;

  // ACPI MCFG table
  p = (uint8_t *)0xbfeecd58;
  p[9] = 0x48;   // checksum
  *(uint32_t *)&p[0x2c] = 0xf8000000;   // pcix ext conf base
  p[0x37] = 63;      // pcix ext conf last bus
  
  p = (uint8_t *)0xbfeecf3c;    // DBGP table
  p[9] = 0x99;
  *(uint32_t *)&p[0x2c] = 0xf0100800;    // 1394 MMIO  
}

GRUB_MOD_FINI (4gb)
{
}
--------------------------------------------kern/i386/pc/mmap.c------------------------------------------
#include <grub/machine/init.h>
#include <grub/machine/memory.h>
#include <grub/err.h>
#include <grub/types.h>
#include <grub/i386/pc/memory.h>
#include <stdint.h>

struct Region
{
  uint32_t base, size, type;
};

struct Region g_regions[] =
{
  {0,0x9f800, GRUB_MACHINE_MEMORY_AVAILABLE},
  {0x9f800, 0x800, GRUB_MACHINE_MEMORY_RESERVED},
  {0xdc000, 0x8000, GRUB_MACHINE_MEMORY_RESERVED},
  {0xe8000, 0x18000, GRUB_MACHINE_MEMORY_RESERVED},
  {0x100000, 0xbfde0000, GRUB_MACHINE_MEMORY_AVAILABLE},
  {0xbfee0000, 0xd000, GRUB_MACHINE_MEMORY_NVS},
  {0xbfeed000, 0x13000, GRUB_MACHINE_MEMORY_NVS}, 
  {0xbff00000, 0x100000, GRUB_MACHINE_MEMORY_RESERVED},
  {0xe0000000, 0x10000000, GRUB_MACHINE_MEMORY_RESERVED},
  {0xfec00000, 0x10000, GRUB_MACHINE_MEMORY_RESERVED},
  {0xfed00000, 0x400, GRUB_MACHINE_MEMORY_RESERVED},
  {0xfed14000, 0x4000, GRUB_MACHINE_MEMORY_RESERVED},
  {0xfed18000, 0x1000, GRUB_MACHINE_MEMORY_RESERVED},
  {0xfed19000, 0x1000, GRUB_MACHINE_MEMORY_RESERVED},
  {0xfed1c000, 0x4000, GRUB_MACHINE_MEMORY_RESERVED},
  {0xfed20000, 0x70000, GRUB_MACHINE_MEMORY_RESERVED},
  {0xfee00000, 0x1000, GRUB_MACHINE_MEMORY_RESERVED},
  {0xff000000, 0x1000000, GRUB_MACHINE_MEMORY_RESERVED}
};

uint8_t g_is_4gb = 0;

grub_err_t
grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t))
{
  int i;
  if (g_is_4gb)
  {
    g_regions[8].base = 0xf8000000;
    g_regions[8].size = 0x4000000;
  }

  for (i = 0; i < 8; ++i)
    hook(g_regions[i].base, g_regions[i].size, g_regions[i].type);

  if (g_is_4gb)
  {
    hook(0xc0000000, 0x20000000 - 0x100000, GRUB_MACHINE_MEMORY_AVAILABLE);
    hook(0xdff00000, 0x100000, GRUB_MACHINE_MEMORY_RESERVED);
  }
  for (i = 8; i < 18; ++i)
    hook(g_regions[i].base, g_regions[i].size, g_regions[i].type);
  return 0;
}
---------------------------------------------loader/i386/pc/chainloader.c-----------------------------------------------
(insert code into grub_chainloader_cmd() )

static void *preb_handle = 0;   // yale: can't duplicate or else preboot_hook gets called twice
                                   // causing unload_uneeded_dl to unload endlessly
  if (!preb_handle)
  {
    grub_err_t err = malloc_hook();    // register's int15 hook automatically
    if (err)
      grub_printf("can't allocate hook\n");
  }
---------------------------------------------how to mod BIOS (Lenovo 3000 N100)-----------------------------------------------
1. Open the Phoenix WPH file in a hex editor and find the following code.
(note: dissassembly below is of ROMEXEC0.ROM, so offsets will be different)

Code: Select all

000043DE  B09D              mov al,0x9d
000043E0  BB7950            mov bx,0x5079
000043E3  E9D8FE            jmp word 0x42be       read SMM
000043E6  80CC10            or ah,0x10             replace with NOP
000043E9  BB8250            mov bx,0x5082
000043EC  E9D5FE            jmp word 0x42c4
2. replace the or with nops
3. Unpack the modified WPH with Phoenix BIOS editor. Then Repack again (you need to make a trivial change and undo before the repack button becomes available).
4. Flash with the repacked WPH.
Last edited by Uncle Joe on Thu Aug 13, 2009 12:21 pm, edited 1 time in total.

yak
ThinkPadder
ThinkPadder
Posts: 1256
Joined: Thu Dec 06, 2007 3:17 pm
Location: NRW, Germany

Re: Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

#49 Post by yak » Thu Aug 13, 2009 7:47 am

Unfortunately there's no attachment option on this forum.

Could you please enclose the code in

Code: Select all

 tags? This way the indentation will be preserved.

A fellow member of this forum, Zender, has a lot of experience modifying ThinkPad BIOSes. He uses this to add otherwise unsupported wireless cards to the whitelist. More about this in [url=http://forum.thinkpads.com/viewtopic.php?f=29&t=55837]this thread[/url].
ThinkPad™ X201 / AFFS-120
i5-560M 2.67Ghz, 8GB RAM, Samsung 840 Pro 256GB SSD, Win 8 Pro 64-bit, UltraBase X200, ThinkPad Compact USB Keyboard,
Dell U2713HM (2560x1440, IPS), ExpressCard USB 3.0 (2 ports, flush), Nexus 7+10

Uncle Joe
Posts: 26
Joined: Thu Aug 13, 2009 1:58 am
Location: Vienna, VA

Re: Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

#50 Post by Uncle Joe » Thu Aug 13, 2009 1:35 pm

"Unfortunately there's no attachment option on this forum."

I'll post the complete code on my website later.

I still don't know how many people out there are willing to go this far for an extra 512Mb RAM (more or less, depending on memory used by peripherals). To build a usable solution for end users, I
need help with the following:

1. Method for running fixup code. I see the following possibilities:
a. grub2 - like I said earlier, the problem with this is that you need to install from GNU/Linux. I could create a bootable CD for this purpose. I don't know if
Windows only users will need to create a partition for grub2 files. Maybe the grub modules can be placed on NTFS.

b. boot loader - this probably will work best for people who don't have Linux, but the main problem is I highly doubt this code can fit into a 512 byte sector.
1 solution would be to create a small partition to hold the entire code. Another would be to find a static place to put the overflow code on an NTFS partition.
The most complicated would be to try and read from NTFS.
c. BIOS code injection - help from Zender and anyone else who knows how to do this will be appreciated.

Supporting multiple methods shouldn't be a problem because the same core code will be used.

2. Hardware configuration for each computer to be supported (probably any machine with i945 chipset)
PCI memory ranges from msinfo32 on Windows or lspci -v on Linux.
Existing e820 memory map - just save dmesg from Linux
MTRR values - /proc/mtrr

Meanwhile, for those of you with a Lenovo 3000 N100, you can use my mod by doing the following.
I only tested it on my type 0768, model E2U and I just realized the 3000 N100 has many variants, so I'm not sure if my
patch will work on them all. The BIOS patch should because all 3000 N100s use the same BIOS (but do they all use i945?).
At worst, the PCI remapping will be wrong, but the OS probably will fix it up anyways.


1. Flash your bios with this http://www.cc.gatech.edu/~yzhang67/NEW.WPH. I used WinPhlash.
I didn't have any problems on my 1st try, but you should prepare for the worst and make a bios recovery disk in case
you brick the BIOS. You have been warned :!:

2. Burn the grub2 boot disk I made: http://www.cc.gatech.edu/~yzhang67/grub.iso.
3. Boot from it. You should see a grub2 menu. The Vista option only works if Windows is installed on the 1st partition of 1st hard disk.
Most users probably still have the recovery partition as the 1st (I deleted mine), so you'll have to edit the boot command line by pressing e

and changing the line "root (hd0,1)" to "root (hd0,2)". Then press ctrl-x to boot.
If you're using GNU/Linux, then I assume you know what to do. See the grub2 wiki for help.
4. Enjoy

dozer
Sophomore Member
Posts: 209
Joined: Thu Jan 25, 2007 9:28 pm
Location: Grants Pass, Oregon

Re: Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

#51 Post by dozer » Tue Aug 18, 2009 3:47 am

Uncle Joe, thanks VERY much for digging into this, and posting your results. 8)

Because the same BIOS file works on many variants of T60 with different option-loadings, I have to assume that the BIOS and/or the OS can 'insert' the various option-cards where they'll work fine.

So in theory a single modded ROM binary -should- work for many people.

Running counter to the above is your mention of losing ACPI/sleep functionality. That shouldn't have happened.

I think the first thing to do is figure out why that happened, and fix that problem.

That would allow the simplest of all possible methods to use this fix.....we all just flash our bios with UJ's binary. 8)

Otherwise, if we have to start applying patches at boot-time, then things get messier; as you've already discusses a little bit.

ps; I too urge you to contact Zender. He's been digging in the lenovo bios for several years now; and with some success.

Again....thanks! :)

Richard

PS on edit; I'm real curious how this works with an integrated-graphics mainboard. Presumably such a board can be set to use only 32mb or perhaps even less of "graphics RAM". If so, could we then get nother 200mb over the ATI-mainboard fix? That'd be a pretty significant gain, so worth checking on in regards to the intel-gpu mainboards.
WANTED! - Battery Diags/Reset Software; please PM me!
WTB: Good 9-cell T60 batt
WTB: Frankenpad T60 15" UXGA w/T61-Intel & internal modem
T60p, 2623-ddu, uxga, Intel-GPU || T61, 6465-01U 15.4" sxga || R60 9457-W37 14"xga

jack_b_uta
Posts: 19
Joined: Wed Aug 19, 2009 1:05 pm
Location: Enter your correct location ASAP

Re: Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

#52 Post by jack_b_uta » Fri Aug 21, 2009 2:00 pm

Any luck with this. I would desperately like to try this out. Have a 3000 N100, 0689-A7U that has 2*2GB sticks in it. Vista 64 sees 4GB but can use only 3.

Uncle Joe
Posts: 26
Joined: Thu Aug 13, 2009 1:58 am
Location: Vienna, VA

Re: Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

#53 Post by Uncle Joe » Fri Aug 21, 2009 5:25 pm

You're in luck and I'm glad to see people still interested. It's unfortunate I didn't see this in 2007 when more people were using T60s and 3000 N100s. When I got my 3000 N100 in spring 2007, I thought its 1Gb was plenty.

According to http://www.buy.com/prod/lenovo-3000-n10 ... 98920.html, your model uses a GMA 950, which unlike the Geforce 7300, doesn't need 256Mb memory mapped IO space. I'm guessing you'll be able to use ~3840Mb RAM.

As I said before, suspend/resume gets broken when my patch is applied, so I have a grub2 boot loader menu for choosing whether to apply the patch or not. I think supporting your model should be simple. The only hurdle is installing the grub2 boot loader. I've decided the best way to install grub2 without requiring GNU/Linux to be installed is to make a modified systemrescuecd http://www.sysresccd.org/Sysresccd-manu ... emRescueCd with grub2. However, the main risk is I don't know if the grub2 files can be installed onto NTFS or if it has to be on Ext2. If it has to be on Ext2, then you'll have to create a new partition (>= 2Mb) and format it as Ext2.

The other concern is flashing your BIOS. Although I'm confident my patched BIOS works for all 3000 N100 models (support page says all N100s use same BIOS and I only deleted 1 instruction in BIOS), I cannot guarantee it won't make your computer unbootable. In the past few days, I've been experimenting with injecting my fixup code into the BIOS and I've bricked my laptop >= 5 times. Luckily I am able to recover the old BIOS it by booting to crisis recovery mode. You can find how to make a crisis recovery disk elsewhere. Just know the quirks for the 3000 N100:

1. press fn + b to activate crisis recovery
2. floppy drive needs to be only USB device connected (not really necessary - I guess the recovery code thinks floppy is always device 0)
3. After unzipping crisis-recovery-disk-creator.zip, replace phlash16.exe with phlash1b.exe (others might work, but I haven't tried).

I'll probably get this done in a few days. Meanwhile, you can help by giving me your hardware info:
1. burn systemrescuecd
2. boot it and at menu, type rescue64 <enter>
3. "startx" (starts GUI)
4. open a console and "dmesg > /tmp/e820_map" (reports e820 memory map)
5. "/sbin/lspci -v > /tmp/pci" (reports PCI configuration)
6. send /tmp/e820_map and /tmp/pci to me

Uncle Joe
Posts: 26
Joined: Thu Aug 13, 2009 1:58 am
Location: Vienna, VA

Re: Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

#54 Post by Uncle Joe » Sun Aug 23, 2009 12:43 am

Well, I guess I had more time than I expected. I've built a CD for testing and installing my mod. Get it here: http://www.cc.gatech.edu/~yzhang67/sysrescue_grub2.iso (will be uploaded in a few hours after this post). First, make sure you've flashed your BIOS with my modified one: http://www.cc.gatech.edu/~yzhang67/NEW.WPH. Then burn the CD and boot it.

The CD will automatically load my fixups. At the menu you should see these choices:

Windows
Windows 2
Debian
rescue
rescue64

You should test if my fixes work by choosing Windows or Windows 2, depending on which partition Windows is installed. Then open calculator -> about calculator and check if physical memory is > 3Gb. If it didn't increase, then most likely there's a problem with my fixups.

If it works, then you can choose to install my mod onto your hard disk. Reboot to the CD, and this time choose rescue or rescue64. When you get to the command line, execute "/mnt/cdrom/grub_install/install" (this installs grub2 to /grub on your Windows disk). Then, execute "reboot" and take out the CD.

After rebooting, you should see this grub2 menu:
Windows
Windows 2
Enable 4gb (click to enable my fixes)

To customize this menu, edit c:\grub\grub.cfg (see grub2 wiki).

Notes:

*Installing grub2 will overwrite your disk's master boot record. To uninstall, see here: http://support.microsoft.com/kb/927392 (I just use the Vista Upgrade Any Time DVD that came with my N100).

*I've inserted a check in my fixup code to see if there's a Geforce 7300. With a Geforce 7300, ~3584Mb RAM is set up. Without it, ~3840Mb is set up. This is a crude check, but should work for models using GMA 950. If you have a peripheral that needs a huge MMIO range, then there could be a conflict. That's why I said I needed hardware information for the different N100s.

*My mod is only intended for 3000 N100s. It should be able to be trivially extended to T60s by just using a different BIOS patch, but I need someone with a T60 who's willing to try the BIOS.

Enjoy your extra RAM :D

Uncle Joe
Posts: 26
Joined: Thu Aug 13, 2009 1:58 am
Location: Vienna, VA

Re: Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

#55 Post by Uncle Joe » Sun Aug 23, 2009 6:12 pm

Well, I wasn't able to upload my original CD image because 250Mb exceeds my limit. After stripping it of everything except the kernel and initrd, it's down to 14Mb. The directions remain the same, except you won't see the rescue64 option and instead of executing "reboot" you need to hold down the power button.

jack_b_uta
Posts: 19
Joined: Wed Aug 19, 2009 1:05 pm
Location: Enter your correct location ASAP

Re: Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

#56 Post by jack_b_uta » Mon Aug 24, 2009 4:14 pm

I am sorry I was not able to answer before. Was out of town over the weekend and just got back in.

I will give it a shot and post the results here. The steps as I understand them are

1) Flash BIOS using current OS (XP Pro.)
2) Reboot using systemrescuecd. Boot to the CD.
3) I have Windows XP installed on Disk(0) Partition(0) so the first GRUB option should work.
4) Boot to Windows.
5) Check available RAM to see if the MOD worked.

Question

When you say Suspend / resume will break, is it the same as the Standby / Resume option? Or is it the hibernate feature?


I will also post my System Specs here tonight.

Uncle Joe
Posts: 26
Joined: Thu Aug 13, 2009 1:58 am
Location: Vienna, VA

Re: Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

#57 Post by Uncle Joe » Mon Aug 24, 2009 5:32 pm

Reboot using systemrescuecd. Boot to the CD.
- to clarify, use my sysrescue_grub2.iso, not the original, which is 250Mb. However, use the original to save dmesg and lspci when you get the chance.

Other than that, you're good to go. I never tested this on Windows XP, but I don't think this is a problem. The only problem I foresee is Windows not booting because the PCI peripherals aren't configured properly (e.g. overlap with RAM space) since I don't know which peripherals you have. I think Windows should reconfigure them. If this happens, don't worry, it's not permanent. Just reboot without the CD and report any error messages you saw.

When I say suspend/resume breaks, I mean suspend to RAM or sleep on Vista (wakes up in a few seconds). Hibernate (suspend to disk) still works. I guess hibernate is less dependent on ACPI / SMM code than sleep.

jack_b_uta
Posts: 19
Joined: Wed Aug 19, 2009 1:05 pm
Location: Enter your correct location ASAP

Re: Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

#58 Post by jack_b_uta » Tue Aug 25, 2009 10:15 am

Does not look good. XP keeps blue screening when I try to flash NEW.WPH. I am using the Windows XP pro and WinPhlash. I tried using the WinPHlash from all the Lenovo 3000 N100 BIOS released, but each bluescreened.I also tried using WinPHlash from Y410, but that failed with a Checksum error. Any suggestions?

Another thing

I tried to boot off of your system rescue disk, but nothing shows up, the screen flashes and system restarts

Uncle Joe
Posts: 26
Joined: Thu Aug 13, 2009 1:58 am
Location: Vienna, VA

Re: Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

#59 Post by Uncle Joe » Tue Aug 25, 2009 1:25 pm

Are you using 64bit XP? 2 years ago, someone claimed WinPhlash doesn't work on 64 bit Windows http://www.eyt.ca/blog/item/135/. Maybe you can try WinPhlash64. If that doesn't work, I can add a DOS boot option to the CD with phlash16.

I don't know what's causing the CD to reboot, but I've seen it before when I tried it on an older desktop. I think it's a grub2 issue because it also happens when I try to boot the CD from a virtual machine. I'll look into it.

jack_b_uta
Posts: 19
Joined: Wed Aug 19, 2009 1:05 pm
Location: Enter your correct location ASAP

Re: Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

#60 Post by jack_b_uta » Tue Aug 25, 2009 1:47 pm

Nope its XP 32 Bit. I have an eval of 64 Bit Vista running on a different partiton but I doubt that is the problem. I will try to create a DOS bootable USB and use WinPhlash16.

Uncle Joe
Posts: 26
Joined: Thu Aug 13, 2009 1:58 am
Location: Vienna, VA

Re: Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

#61 Post by Uncle Joe » Wed Aug 26, 2009 10:04 am

Well, I've found what's causing grub2 to crash when running the CD in a VM. It's because I hard coded a e820 physical memory map that assumes there's 4gb. Grub uses the memory at the highest accessible address, so if the memory doesn't exist, it won't function. Since you have 4gb, I'm guessing the problem is Grub is trying to use memory reserved for GMA 950, since I didn't mark that region as reserved.

TOP OF RAM = 0xf0000000
SMRAM 1 Mb (below top)
FRAMEBUFFER 8 Mb (below SRAM)

I've created a new sysrescue_grub2.iso. If it still doesn't work, send me the dmesg dump so I can find out what your configuration really is.

Also, I've created a DOS boot disk for flashing http://www.cc.gatech.edu/~yzhang67/phlash.iso to save you some trouble.

jack_b_uta
Posts: 19
Joined: Wed Aug 19, 2009 1:05 pm
Location: Enter your correct location ASAP

Re: Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

#62 Post by jack_b_uta » Wed Aug 26, 2009 11:16 am

I did try using a Bootable Floppy (borrowed a USB external floppy drive from a buddy). I got to the point where I was able to get Phlash16.exe to run in Dos mode and it started up. (Had to rename NEW.WPH to BIOS.WPH. Phlash16.exe errored out saying "Models dont match" or something to that effect. I think the BIOS has a Header of some sorts, to identify what model it goes to. Maybe your mod is shifting that to a position where Phlash16 does not look.

Uncle Joe
Posts: 26
Joined: Thu Aug 13, 2009 1:58 am
Location: Vienna, VA

Re: Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

#63 Post by Uncle Joe » Wed Aug 26, 2009 11:28 am

That is very strange. Can you try flashing the original 3.12 BIOS at http://www-307.ibm.com/pc/support/site. ... MIGR-67008. I assumed this should work for all 3000 N100s.

Actually, I think I know why it's not working. There are actually 2 BIOSes that come with that URL. I use DL01108A for my laptop. When you run AdRomLdr, does it choose DL00206A.WPH? If that's the case, then I would need to mod that BIOS instead.

Uncle Joe
Posts: 26
Joined: Thu Aug 13, 2009 1:58 am
Location: Vienna, VA

Re: Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

#64 Post by Uncle Joe » Wed Aug 26, 2009 1:04 pm

I assume your laptop does use the other BIOS file. A most grievous mistake. Here's the modded DL00206A.WPH Image. I've also slipped it into phlash.iso, the DOS boot disk (execute "phlash16 DL00206A.WPH" or "phlash16 DL01108A.WPH"). Although I can't test the BIOS, I'm pretty sure it will work because I found and patched an identical instruction sequence.

jack_b_uta
Posts: 19
Joined: Wed Aug 19, 2009 1:05 pm
Location: Enter your correct location ASAP

Re: Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

#65 Post by jack_b_uta » Wed Aug 26, 2009 2:02 pm

That BIOS flash worked. Still see the Total Memory in BIOS as 3072, but the Version number has changed to V2.06. The system rescue CD still does not boot. It looks like it wants to boot, and the machine restarts. Standby works. I can click standby from Windows shutdown menu, or simply close the lid to put the system to standby.

I'll try sleep feature and report back

Uncle Joe
Posts: 26
Joined: Thu Aug 13, 2009 1:58 am
Location: Vienna, VA

Re: Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

#66 Post by Uncle Joe » Wed Aug 26, 2009 2:15 pm

Good, it works.
Still see the Total Memory in BIOS as 3072
This is expected, and doesn't mean much since I don't apply the fix ups until after BIOS initialization. All the BIOS patch does is disable locking the memory controller configuration.

Like I said earlier, I suspect the e820 memory map I semi hard-coded into the Grub boot loader is wrong and causing Grub to use invalid memory. Get the real systemrescuecd, run it, and send me dmesg so I can see the memory map and PCI devices:

1. At command prompt, "dmesg > /tmp/dmesg"
2. "mkdir /mnt1"
3. "mount /dev/sda1 /mnt1 -tntfs-3g" this should be your windows drive (try sda2, etc if doesn't work)
4. "cp /tmp/dmesg /mnt1"
5. "umount /mnt1"
6. Reboot and post dmesg here and delete it from C:\

jack_b_uta
Posts: 19
Joined: Wed Aug 19, 2009 1:05 pm
Location: Enter your correct location ASAP

Re: Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

#67 Post by jack_b_uta » Thu Aug 27, 2009 2:20 pm

Sorry for the delay...I am having to do all the weekend chores during the week since I was out over the last weekend. Anyways here is the output of dmsg and I also listed lspci.
Since the output of dmesg is quite long I have pasted the PCI devices and memory map info below. Please let me know if you need more.

--------------DMESG Begin----------------------
Initializing cgroup subsys cpuset
Initializing cgroup subsys cpu
Linux version 2.6.29.06-std123 (root@catalyst) (gcc version 4.3.3 (Gentoo 4.3.3-r2 p1.1, pie-10.1.5) ) #1 SMP Thu Aug 6 19:24:58 UTC 2009
KERNEL supported cpus:
Intel GenuineIntel
AMD AuthenticAMD
NSC Geode by NSC
Cyrix CyrixInstead
Centaur CentaurHauls
Transmeta GenuineTMx86
Transmeta TransmetaCPU
UMC UMC UMC UMC
BIOS-provided physical RAM map:
BIOS-e820: 0000000000000000 - 000000000009f800 (usable)
BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved)
BIOS-e820: 00000000000dc000 - 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 - 00000000bf690000 (usable)
BIOS-e820: 00000000bf690000 - 00000000bf700000 (ACPI NVS)
BIOS-e820: 00000000bf700000 - 00000000c0000000 (reserved)
BIOS-e820: 00000000e0000000 - 00000000f0000000 (reserved)
BIOS-e820: 00000000fec00000 - 00000000fec10000 (reserved)
BIOS-e820: 00000000fed00000 - 00000000fed00400 (reserved)
BIOS-e820: 00000000fed14000 - 00000000fed1a000 (reserved)
BIOS-e820: 00000000fed1c000 - 00000000fed90000 (reserved)
BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
BIOS-e820: 00000000ff000000 - 0000000100000000 (reserved)
DMI present.
last_pfn = 0xbf690 max_arch_pfn = 0x100000
x86 PAT enabled: cpu 0, old 0x7040600070406, new 0x7010600070106
kernel direct mapping tables up to 373fe000 @ 7000-d000
RAMDISK: 7f35a000 - 7ffff304
Allocated new RAMDISK: 00c89000 - 0192e304
Move RAMDISK from 000000007f35a000 - 000000007ffff303 to 00c89000 - 0192e303
ACPI: RSDP 000F6540, 0024 (r2 LENOVO)
ACPI: XSDT BF693BAE, 0084 (r1 PTLTD XSDT 37 LTP 0)
ACPI: FACP BF699D6E, 00F4 (r3 INTEL CALISTGA 37 ALAN 1)
FADT: X_PM1a_EVT_BLK.bit_width (16) does not match PM1_EVT_LEN (4)
ACPI: DSDT BF69598D, 436D (r1 LENOVO TP-61 37 INTL 20050624)
ACPI: FACS BF69AFC0, 0040
ACPI: APIC BF699E62, 0068 (r1 INTEL CALISTGA 37 LOHR 5A)
ACPI: HPET BF699ECA, 0038 (r1 INTEL CALISTGA 37 LOHR 5A)
ACPI: MCFG BF699F02, 003C (r1 INTEL CALISTGA 37 LOHR 5A)
ACPI: TCPA BF699F3E, 0032 (r1 Phoeni x 37 TL 0)
ACPI: APIC BF699F70, 0068 (r1 PTLTD APIC 37 LTP 0)
ACPI: BOOT BF699FD8, 0028 (r1 PTLTD $SBFTBL$ 37 LTP 1)
ACPI: SSDT BF69533E, 064F (r1 SataRe SataPri 1000 INTL 20050624)
ACPI: SSDT BF694CAC, 0692 (r1 SataRe SataSec 1000 INTL 20050624)
ACPI: SSDT BF6941E0, 025F (r1 PmRef Cpu0Tst 3000 INTL 20050624)
ACPI: SSDT BF69413A, 00A6 (r1 PmRef Cpu1Tst 3000 INTL 20050624)
ACPI: SSDT BF693C32, 0508 (r1 PmRef CpuPm 3000 INTL 20050624)
ACPI: BIOS bug: multiple APIC/MADT found, using 0
ACPI: If "acpi_apic_instance=2" works better, notify linux-acpi@vger.kernel.org
ACPI: Local APIC address 0xfee00000
2178MB HIGHMEM available.
883MB LOWMEM available.
mapped low ram: 0 - 373fe000
low ram: 00000000 - 373fe000
bootmap 00008000 - 0000ee80
(9 early reservations) ==> bootmem [0000000000 - 00373fe000]
#0 [0000000000 - 0000001000] BIOS data page ==> [0000000000 - 0000001000]
#1 [0000001000 - 0000002000] EX TRAMPOLINE ==> [0000001000 - 0000002000]
#2 [0000006000 - 0000007000] TRAMPOLINE ==> [0000006000 - 0000007000]
#3 [0000400000 - 0000c83d2c] TEXT DATA BSS ==> [0000400000 - 0000c83d2c]
#4 [0000c84000 - 0000c89000] INIT_PG_TABLE ==> [0000c84000 - 0000c89000]
#5 [000009f800 - 0000100000] BIOS reserved ==> [000009f800 - 0000100000]
#6 [0000007000 - 0000008000] PGTABLE ==> [0000007000 - 0000008000]
#7 [0000c89000 - 000192e304] NEW RAMDISK ==> [0000c89000 - 000192e304]
#8 [0000008000 - 000000f000] BOOTMAP ==> [0000008000 - 000000f000]
found SMP MP-table at [c00f65d0] 000f65d0
Zone PFN ranges:
DMA 0x00000000 -> 0x00001000
Normal 0x00001000 -> 0x000373fe
HighMem 0x000373fe -> 0x000bf690
Movable zone start PFN for each node
early_node_map[2] active PFN ranges
0: 0x00000000 -> 0x0000009f
0: 0x00000100 -> 0x000bf690
On node 0 totalpages: 783919
free_area_init_node: node 0, pgdat c0aebb00, node_mem_map c192f000
DMA zone: 32 pages used for memmap
DMA zone: 0 pages reserved
DMA zone: 3967 pages, LIFO batch:0
Normal zone: 1736 pages used for memmap
Normal zone: 220470 pages, LIFO batch:31
HighMem zone: 4358 pages used for memmap
HighMem zone: 553356 pages, LIFO batch:31
Using APIC driver default
ACPI: PM-Timer IO Port: 0x1008
ACPI: Local APIC address 0xfee00000
ACPI: LAPIC (acpi_id[0x00] lapic_id[0x00] enabled)
ACPI: LAPIC (acpi_id[0x01] lapic_id[0x01] enabled)
ACPI: LAPIC_NMI (acpi_id[0x00] high edge lint[0x1])
ACPI: LAPIC_NMI (acpi_id[0x01] high edge lint[0x1])
ACPI: IOAPIC (id[0x01] address[0xfec00000] gsi_base[0])
IOAPIC[0]: apic_id 1, version 32, address 0xfec00000, GSI 0-23
ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
ACPI: IRQ0 used by override.
ACPI: IRQ2 used by override.
ACPI: IRQ9 used by override.
Enabling APIC mode: Flat. Using 1 I/O APICs
Using ACPI (MADT) for SMP configuration information
ACPI: HPET id: 0x8086a201 base: 0xfed00000
SMP: Allowing 2 CPUs, 0 hotplug CPUs
nr_irqs_gsi: 24
PM: Registered nosave memory: 000000000009f000 - 00000000000a0000
PM: Registered nosave memory: 00000000000a0000 - 00000000000dc000
PM: Registered nosave memory: 00000000000dc000 - 0000000000100000
Allocating PCI resources starting at c2000000 (gap: c0000000:20000000)
NR_CPUS:32 nr_cpumask_bits:32 nr_cpu_ids:2 nr_node_ids:1
PERCPU: Allocating 40960 bytes of per cpu data
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 777793
Kernel command line: initrd=initram.igz BOOT_IMAGE=rescuecd
Enabling fast FPU save and restore... done.
Enabling unmasked SIMD FPU exception support... done.
Initializing CPU#0
CPU 0 irqstacks, hard=c0bc0000 soft=c0ba0000
PID hash table entries: 4096 (order: 12, 16384 bytes)
Extended CMOS year: 2000
Fast TSC calibration using PIT
Detected 1995.216 MHz processor.
Console: colour VGA+ 80x25
console [tty0] enabled
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
allocated 15680320 bytes of page_cgroup
please try cgroup_disable=memory option if you don't want
Memory: 3072084k/3136064k available (4958k kernel code, 62744k reserved, 2368k data, 436k init, 2230856k highmem)
virtual kernel memory layout:
fixmap : 0xffc56000 - 0xfffff000 (3748 kB)
pkmap : 0xff400000 - 0xff800000 (4096 kB)
vmalloc : 0xf7bfe000 - 0xff3fe000 ( 120 MB)
lowmem : 0xc0000000 - 0xf73fe000 ( 883 MB)
.init : 0xc0b30000 - 0xc0b9d000 ( 436 kB)
.data : 0xc08d7a94 - 0xc0b27cc8 (2368 kB)
.text : 0xc0400000 - 0xc08d7a94 (4958 kB)
Checking if this processor honours the WP bit even in supervisor mode...Ok.
SLUB: Genslabs=12, HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
hpet clockevent registered
HPET: 3 timers in total, 0 timers will be used for per-cpu timer
Calibrating delay loop (skipped), value calculated using timer frequency.. 3990.43 BogoMIPS (lpj=1995216)
Security Framework initialized
--------------DMESG End------------------------

------------lspci BEGIN--------------------------
00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GT Express Memory Controller Hub (rev 03)
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03)
00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)
00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 02)
00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 02)
00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 02)
00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 02)
00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 02)
00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 02)
00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e2)
00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 02)
00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Controller (rev 02)
00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 02)
03:00.0 Network controller: Broadcom Corporation BCM4328 802.11a/b/g/n (rev 01)
05:01.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
05:04.0 CardBus bridge: ENE Technology Inc CB1410 Cardbus Controller (rev 01)
05:06.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller
05:06.1 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 19)
05:06.2 System peripheral: Ricoh Co Ltd R5C843 MMC Host Controller (rev 0a)
05:06.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 05)
05:06.4 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev ff)
------------lspci END----------------------------

Uncle Joe
Posts: 26
Joined: Thu Aug 13, 2009 1:58 am
Location: Vienna, VA

Re: Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

#68 Post by Uncle Joe » Fri Aug 28, 2009 2:56 am

Here's a new CD http://www.cc.gatech.edu/~yzhang67/sysrescue_grub2.iso. I've added some debug messages that you need to press a key to get past. If it crashes before you get to the menu, tell me the last message you see.
Sorry for the delay
Quite the opposite for me. If you're wondering why I have nothing better to do, I'm waiting to start my job with 3M in 2 weeks.

jack_b_uta
Posts: 19
Joined: Wed Aug 19, 2009 1:05 pm
Location: Enter your correct location ASAP

Re: Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

#69 Post by jack_b_uta » Fri Aug 28, 2009 7:51 am

Uncle Joe wrote:Here's a new CD http://www.cc.gatech.edu/~yzhang67/sysrescue_grub2.iso. I've added some debug messages that you need to press a key to get past. If it crashes before you get to the menu, tell me the last message you see.
Sorry for the delay
Quite the opposite for me. If you're wondering why I have nothing better to do, I'm waiting to start my job with 3M in 2 weeks.
:) Lol. I see you posted this at 3:23 am today. Thanks for all your efforts!! I am on my way to work, but will give this a shot and post back.

jack_b_uta
Posts: 19
Joined: Wed Aug 19, 2009 1:05 pm
Location: Enter your correct location ASAP

Re: Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

#70 Post by jack_b_uta » Fri Aug 28, 2009 10:13 am

No luck. The display gets all messed up, and it leaves a snow field on the screen.

Uncle Joe
Posts: 26
Joined: Thu Aug 13, 2009 1:58 am
Location: Vienna, VA

Re: Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

#71 Post by Uncle Joe » Fri Aug 28, 2009 7:09 pm

Sorry about that. Doing this system level programming on my own machine was already difficult to debug, so you can imagine the difficulty of doing it remotely.

Anyways, I've uploaded a new CD. It displays even more prompts and debugging info. It corrects 1 major mistake. Previously, I assumed the GMA950 only consumes 8Mb RAM and doesn't occupy any PCI address space. That's wrong. The 8Mb is only for the VGA frame buffer. It also occupies a 256Mb PCI range, so unfortunately, you can only use ~3584Mb RAM, unlike 3840Mb I said earlier :(

In my opinion, this is a bad design because the 256Mb PCI range is a waste - it's just an alias to main RAM instead of a separate RAM http://www.techpowerup.com/articles/ove ... vidcard/43. I guess the contiguous view provided by the 256Mb makes programming easier and allows the address translation to be off loaded to the GMA 950.

It might be possible to get more by reducing the 256Mb aperture (hinted in 945 documentation) or disabling other PCI ranges like the 64Mb PCIX configuration space.

This time, note that there's an option that asks you to press y to copy the 8Mb VGA frame buffer. If the display corrupts, you can try saying y. If things still don't work, send me (yzhang1985@gmail.com) the debug messages up to the point of failure. I'd recommend taking a picture.

jack_b_uta
Posts: 19
Joined: Wed Aug 19, 2009 1:05 pm
Location: Enter your correct location ASAP

Re: Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

#72 Post by jack_b_uta » Mon Aug 31, 2009 10:36 am

No luck. I sent you an email with the screenshots.

Uncle Joe wrote:Sorry about that. Doing this system level programming on my own machine was already difficult to debug, so you can imagine the difficulty of doing it remotely.
No need to explain dude. I know what this involves. Appreciate you taking the time to do it.

Uncle Joe
Posts: 26
Joined: Thu Aug 13, 2009 1:58 am
Location: Vienna, VA

Re: Why 3.0GB, not 3.25 or even 3.5? [Updated with Answer]

#73 Post by Uncle Joe » Mon Aug 31, 2009 9:35 pm

OK. I expected the screen was garbling when I set TOLUD since that switches the memory used for the VGA frame buffer to a new uninitialized location, which explains the garbage you see. I'm thinking maybe the computer is still functional and only the screen needs to be refreshed. Have you tried pressing enter a few more times to see if the screen goes back to normal or any disk activity from loading Windows (pressing enter several times should choose the Windows menu option)?

Post Reply
  • Similar Topics
    Replies
    Views
    Last post

Return to “ThinkPad T60/T61 Series”

Who is online

Users browsing this forum: No registered users and 29 guests