Do you have a question? Post it now! No Registration Necessary
Subject
- Posted on
ramdisk question...Please respond. Thanks
- 05-05-2005
May 5, 2005, 11:06 pm

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
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

Re: ramdisk question...Please respond. Thanks

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
Site Timeline
- » function call
- — Next thread in » Embedded Linux
-
- » bootable floppy
- — Previous thread in » Embedded Linux
-
- » Crosscompiling for ARM: reloc type R_ARM_ABS32 is not supported for PIC - ...
- — Newest thread in » Embedded Linux
-
- » Re: Capacitors at RF
- — The site's Newest Thread. Posted in » Electronics Repair
-
- » Replacement for 741
- — The site's Last Updated Thread. Posted in » Electronics Design
-