ramdisk question...Please respond. Thanks

May 05, 2005 1 Replies

Hi, I am a newbie to linux . I am using x86 architecture with 1GB ram.



when i compile the kernel, i get this bvmlinux.out executable.



My requirement is that i need to boot my board with ramdisk. so this is what i did,



I have loaded the bvmlinix.out at 0x100000 and ramdisk at 0x20000000.



I have modified the kernel code to hardcode the address of the ramdisk to the kernel. Then i ask BIOS to jump to location 0x100000.



{ Note that i am not using any bootloader and the BIOS switch the processor to protected mode and has some more instructions(not sure what they are)



before it jumps to the kernel}


********************************************************
[ This is what is modified in the code:

in arch/i386/kernel/setup.c ==> function: setup_memory(void)



{

....



i have removed all the code under #defined CONFIG_BLK_DEVINITRD



and replaced with the fiollowing line:



initrd_start = 0x20000000



}

function: setup_arch(char ** cmdline_p)



{

...



//I have added below line



rd_image_start = 0x20000000;


setup_memory-region(); //This is already present in the code



..



}

in init/main.c:: function: start_kernel(void)



{

...



calibrate_delay(); // This is existing code



i have removed all the code under #defined CONFIG_BLK_DEVINITRD



and replaced with the fiollowing line:



initrd_start = phys_to_virt(0x20000000);



mem_init(); //This is existing code



}
]


With all the above changes, i am able to mount the ramdisk properly. But the kernel is panic'ing as it could not find "/sbin/init"



i have all the required files in the ramdisk.i even tried with init=/bin/sh. still the kernel panics.


I believe somewhere kernel might be using the memory where the ramdisk is located. This is because if i increase my ram to 2GB then



i could reach the shell.



Can you please tell me what is that i am missing?



Thanks a lot in advance,



Uday


Please explain

1) What the hell is bvmlinux.out file - is this is a standard kernel, you might do better to fill in the missing links with the reader if not ! 2) Whats the hardware ? 3) Why the modifications to the load address - if its a 386 or above then the virtual mapping is likely to get it right without any mods. 4) init=/bin/bash is safer as /bin/sh is a symlink in most systems 5) Have you done mkinitrd - Is the initrd file present, compressed correctly ? 5) Most standard PC BIOS jump to the loader (kernel in this case) in 'real mode'

Jon

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required