Subject: Some ramdisk and initrd questions...

From: "Steven J. Hill" <[email-masked]>
Date: Tue, 14 Mar 2000 14:44:45 -0500

Greetings.

I am booting the 2.3.51 kernel on my development board and the following is
the fixup code I run since my bootloader is not yet passing options to the
kernel:

static void __init
fixup_l7200(struct machine_desc *desc, struct param_struct *params,
             char **cmdline, struct meminfo *mi)
{
        ROOT_DEV = MKDEV(RAMDISK_MAJOR,0);
        setup_ramdisk( 1, 0, 0, 8192 );
        setup_initrd( __phys_to_virt(0xf1000000), 0x0018057d );
}

I upload my kernel and ramdisk image and below is what I get:

***********************************************************************
Serial driver version 4.92 (2000-1-27) with no serial options enabled
RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize
RAMDISK: Compressed image found at block 0
Freeing initrd memory: 1537k freed
NetWinder Floating Point Emulator V0.95 (c) 1998-1999 Rebel.com
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 4k init
kmod: failed to exec /sbin/modprobe -s -k char-major-4, errno = 2
Warning: unable to open an initial console.
kmod: failed to exec /sbin/modprobe -s -k binfmt-464c, errno = 2
kmod: failed to exec /sbin/modprobe -s -k binfmt-464c, errno = 2
Kernel panic: No init found.  Try passing init= option to kernel.
***********************************************************************

First, I have no idea why it is looking to load a module for the
serial port when I do not have it compiled as a module and obviously
I am pushing data over it. Any ideas on this?

Second, is it really necessary to use 'initrd' if I want to have a
ramdisk located in RAM and do not plan on mounting a "real" root
filesystem after it loads the initrd image? My understanding is that
the original purpose of initrd was to provide a small start up ramdisk
to load kernel modules so that booting could continue on to mount the
real working root filesystem. If I only want what is in my ramdisk, why
do I have to bother with initrd? Won't making a call to setup_ramdisk
above with the starting address in memory of my ramdisk do just fine?
I am still digging through the code to understand things better, so
please be patient. Also, if anyone has a ramdisk they would like to share,
all the better :). Thanks.

-Steve        

-- 
 Steven J. Hill - Embedded SW Engineer
 Public Key: 'finger [email-masked]'
 FPR1: E124 6E1C AF8E 7802 A815
 FPR2: 7D72 829C 3386 4C4A E17D

unsubscribe: body of `unsubscribe linux-arm' to [email-masked]
++        Please use [email-masked] for           ++
++                        kernel-related discussions.                      ++

---

From: Russell King - ARM Linux Admin <[email-masked]>
Date: Wed, 15 Mar 2000 08:01:38 +0000 (GMT)

> Warning: unable to open an initial console.

The above two lines are trying to tell you that it is unable to open
a console.  The kernel will try to open the console using /dev/console.
Check that your console has major,minor set to 5,1 in the ram disk.

> Kernel panic: No init found.  Try passing init= option to kernel.

binfmt-464c is the code for the ELF binary format.  Did you compile
ELF support into the kernel?  It appears that it isn't in there.

> above with the starting address in memory of my ramdisk do just fine?

Please remember that the conventional ramdisk is normally loaded from
floppy in this case, not from RAM.  The way the ramdisks work, the
ramdisk data is not stored in a contiguous chunk either, so loading it
into the kernel is going to be non-trivial.
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |        Russell King       [email-masked]      --- ---
  | | | |            http://www.arm.linux.org.uk/            /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |                                                     ---  |
    +-+-+ -------------------------------------------------  /\\\  |

---------------------------------------------------------------------------------------------------
*** sorry, missing articles, archive broke  -- rmk ***