[syslinux] [PATCH][git-pull] memdisk/setup.c: Limit available RAM hack

Gene Cumm gene.cumm at gmail.com
Sun Feb 6 08:49:28 PST 2011


On Sun, Feb 6, 2011 at 02:19, H. Peter Anvin <hpa at zytor.com> wrote:
> On 02/05/2011 02:31 PM, Gene Cumm wrote:
>> git://git.zytor.com/users/genec/syslinux.git
>>
>> Branch memdisk-maxmem-for-hpa
>>
>> This is a preliminary hack to introduce a new option that will allow
>> an end-user to limit the amount of available RAM as returned by any
>> call that MEMDISK touches.  This works by adding additional memory
>> reservation(s) (through insertrange()) to reserve the memory between
>> the specified address and the top of RAM.
>>
>> For now, the parameter is int15maxres (implement INT15h MAX by
>> reservation) and is specified in bytes.  I welcome feedback on its
>> functionality, default unit (ie 1 byte versus 1024 bytes or even unit
>> of 1024 bytes but must be divisible by 4), more appropriate names for
>> the parameter and function name.  Eventually I think it would be
>> better to be more flexible in how the memory limit is specified (ie
>> "256M" rather than "268435456").
>>
>
> Yes, we should use suffixes like the mem=XXX option in Linux.  For that
> matter, we might as well call it mem=.

I was actually considering "mem=", "maxmem=" and "memmax=" but I felt
that it might require more discussion.  This only affects the INT15h
calls that MEMDISK takes care of and does not move the INITRD below
that limit or take care of some of the other INT15h calls that also
seem to reflect something about memory but seem to be less commonly
used.

Now that I looked at the core and com32/lib/syslinux/load_linux.c, it
appears "mem=" would be the right choice (long-term) as the core and
linux.c32 will utilize this option for kernel/initrd loading.

Based on this, if I changed the code to use "mem=", core and linux.c32
would load the kernel/initrd lower and MEMDISK would report the memory
as non-existant/unavailable.  Is there anything else that should be
done by MEMDISK?

> The right way to do this is to convert all RAM areas above the limit
> into reserved areas in e820 using insertrange().  However, it is
> important that areas with other memory types don't get modified, in
> particular types 3 and 4.

I might have misread but I thought that MEMDISK's insertrange() would
do something like this.

-- 
-Gene




More information about the Syslinux mailing list