cvs commit: src/sys/boot/i386/loader main.c

John Baldwin jhb at
Tue Dec 20 07:29:03 PST 2005

On Monday 19 December 2005 11:32 pm, Maxim Sobolev wrote:
> John Baldwin wrote:
> > On Monday 19 December 2005 01:32 pm, Maxim Sobolev wrote:
> >> John Baldwin wrote:
> >>> On Monday 19 December 2005 04:26 am, Maxim Sobolev wrote:
> >>>> sobomax     2005-12-19 09:26:42 UTC
> >>>>
> >>>>   FreeBSD src repository
> >>>>
> >>>>   Modified files:
> >>>>     sys/boot/i386/loader main.c
> >>>>   Log:
> >>>>   If LOADER_BZIP2_SUPPORT is defined allocate heap in the 1MB-4MB
> >>>> range to provide enough room for decompression (up to 2.5MB is
> >>>> necessary). This should be safe to do since we load i386 kernels after
> >>>> 8MB mark now, so that 16MB is the minimum amount of RAM necessary to
> >>>> even boot FreeBSD.
> >>>
> >>> Err, I thought we loaded PAE kernels at 2MB and non-PAE kernels at 4MB
> >>> to skip the first PSE page (PSE pages are 2MB on PAE).
> >>
> >> You are right, my mistake, sorry. In any case memory in the range
> >> 1MB-4MB can be used by default.
> >
> > Errm, no it can't.  PAE kernels (and amd64 kernels I think) are both
> > loaded at 2MB, so that only leaves memory in the range 1MB-2MB.
> I see, did not know about amd64 (PAE is less a concern for me since it's
> not a default kernel). What do you think about the following patch:
> It moves heap to the top of the extended memory and teaches
> i386_copyin() to avoid messing up this region, so that in low memory
> situation it will just fail, not trash heap.

So, if I understand correctly, you're now sticking the heap at the last 3MB of 
RAM.  FYI, as long as you have a PPro or newer you can test booting a PAE 
kernel.  You don't have to have > 4GB of RAM. So, you can test this locally 
to see if you can boot a PAE kernel (bzipped at that!) before committing.

John Baldwin <jhb at>  <><
"Power Users Use the Power to Serve"  =

More information about the cvs-src mailing list