[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
initrd getting overwritten with 1G memory and grub
From: |
Pradeep Kanyar |
Subject: |
initrd getting overwritten with 1G memory and grub |
Date: |
Wed, 09 Jan 2002 14:45:58 -0800 |
Hi,
I am new to grub and I am facing a problem. With 512MB RAM on my system,
I can boot linux using grub without any problems. We use a compact flash
based linux system that fits in a 8M flash, and we use an initrd based
ramdisk which in principle usually occupies half the memory on the
system.
When I moved to 1G of memory, linux (2.4.10) complained that
-----
initrd extends beyond end of memory (0x3bfff000 > 0x38000000)
disabling initrd
-----
I have the HIGH_MEM option turned on in my linux kernel.
After going through the code to some extent, I noticed that the
INITRD_START setup by grub has a flaw?
in function load_initrd()
....
if (moveto + len >= LINUX_INITRD_MAX_ADDRESS)
moveto = (LINUX_INITRD_MAX_ADDRESS - len) & 0xfffff000;
....
In my case it turns out,
LINUX_INITRD_MAX_ADDRESS = 0x3C000000
len = 0x3E80000
So, the INITRD_START that is passed on to linux seems to be 3817F000.
With HIGHMEM turned on, I think linux expects the INITRD_START to be
below the 0x38000000 address (as the upper 127M is reserved for HIGHMEM).
However, the above values put the INITRD_START beyond the 0x38000000 value.
To fix this, I made a small change in the load_initrd() function
....
if (moveto + len >= LINUX_INITRD_MAX_ADDRESS)
moveto = (LINUX_INITRD_MAX_ADDRESS_2 - len) & 0xfffff000;
....
Where
LINUX_INITRD_MAX_ADDRESS_2 = 0x38000000
That seemed to do the trick, and linux booted nicely. However, I have
a question. If I move to 4G RAM on my system, I think I'll end up having
the same problem again, and I'll need to readjust.
Has anyone seen this problem? If you could please suggest on a clean way
to fix this, it would be of great help to me....
Thanks,
Pradeep
- initrd getting overwritten with 1G memory and grub,
Pradeep Kanyar <=