Gene Cumm
2011-Feb-05 22:31 UTC
[syslinux] [PATCH][git-pull] memdisk/setup.c: Limit available RAM hack
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"). -- -Gene
H. Peter Anvin
2011-Feb-06 07:19 UTC
[syslinux] [PATCH][git-pull] memdisk/setup.c: Limit available RAM hack
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=. 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. -hpa -- H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf.