bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug #17346] GNU mach can't handle 4GB memory


From: Samuel Thibault
Subject: Re: [bug #17346] GNU mach can't handle 4GB memory
Date: Mon, 20 Nov 2006 13:26:17 +0100
User-agent: Mutt/1.5.11

Hi,

olafBuddenhagen@gmx.net, le Mon 20 Nov 2006 12:16:41 +0100, a écrit :
> On Mon, Nov 20, 2006 at 12:56:49AM +0000, Barry deFreese wrote:
> 
> >     if ((memsize >= 0x400000))
> >       memsize = (0x400000-1);
> >  
> >     phys_last_addr = 0x100000 + (memsize * 0x400);

Oops, I forgot that 0x100000 was added there...

> Basically this is right, though the -1 is pretty pointless:

Its not.

> 0x400000 translates to 1 GiB + 1 MiB.

Nope, it translates to 4GiB + 1MiB, which results to 1MiB (because of
the 4GiB modulus).

> If you want to be precise, make it 0x400000-0x400 (exactly 1 GiB);

No, exactly 4GiB, which is what we intended to do in the first place.

Maybe a safer algorithm would be to use

        vm_size_t memsize = 0x400 + boot_info.mem_upper;
        
        if (memsize >= 0x400000)
                /* avoid overflow */
                memsize = 0x400000-1;
        
        phys_last_addr = memsize * 0x400;

Samuel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]