Re: Not enough memory when entering CLI

Joshua Oreman <[email protected]> Tue, 27 Oct 2009 12:58:01 -0400
Newsgroups gmane.network.etherboot.user
Message-ID <[email protected]>
On Tue, Oct 27, 2009 at 12:46 PM, Itay Gazit <[email protected]> wrote:
> Joshua,
>
> I agree, the memory map probably have not been initialized by the time I
> tried to enter CLI during POST.
>
> Still I have open question:
> How gPXE gain the 16MB memory region? what do I need to change in order to
> have 20MB?
>
> This is not the only machine that has problem entering the CLI. We should
> get to the bottom of it. I am willing to help with troubleshooting.

The solution is in my previous email:

Don't try to enter the CLI during POST. Enter the CLI when gPXE is
invoked as a boot device, i.e. when the prompt says "Press Ctrl-B for
the gPXE command prompt". If the confusion of having two prompts is
too great for you or your users, edit arch/i386/prefix/romprefix.S and
change the ROM_BANNER_TIMEOUT line near the top to

#define ROM_BANNER_TIMEOUT 0

gPXE thinks you have 16MB of memory because, during POST, your BIOS
supplies complete junk when gPXE asks it for a memory count. This is
not uncommon. Perhaps the POST-time prompt should provide only a
limited subset of gPXE's functionality, but that has not yet been
implemented. If you insist upon breaking into gPXE before the system
is fully initialized, the following patch will cause it to ignore the
junk and fall back on int 15,88h, which is a legacy interface that can
report up to 64MB of memory; hopefully your BIOS can at least get that
right. Again, use DEBUG=memmap to see what it's deciding on.

diff --git a/src/arch/i386/firmware/pcbios/memmap.c
b/src/arch/i386/firmware/pcbios/memmap.c
index 8a30dba..ae9f8f3 100644
--- a/src/arch/i386/firmware/pcbios/memmap.c
+++ b/src/arch/i386/firmware/pcbios/memmap.c
@@ -105,7 +105,7 @@ static unsigned int extmemsize_e801 ( void ) {
         * would leave no address space available for 32-bit PCI
         * BARs).
         */
-       if ( extmem == ( 0x400000 - 0x400 ) ) {
+       if ( extmem >= ( 0x400000 - 0x400 ) ) {
                DBG ( "INT 15,e801 reported whole 4GB; assuming insane\n" );
                return 0;
        }

Let me know if this solves your problem.

-- Josh

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference