On 10/31/2011 11:35 AM, preetam m.n wrote:
Thank you Tim.

On Mon, Oct 31, 2011 at 11:35 PM, Tim Bird <tim.b...@am.sony.com <mailto:tim.b...@am.sony.com>> wrote:

    'init' and other kernel command line arguments are documented in the
    file: Documentation/kernel_parameters.txt, in the kernel source
    directory.


One other thing, just for information's sake...

The command line passed to the kernel is printed by
the kernel on startup, and is available in the kernel
log buffer (not to be confused with the Android
system log).  There are usually several other Android-specific
items in the kernel command line.

After a kernel has booted, you can see the kernel
command line, along with other kernel startup messages)
using 'dmesg'.  Here's a sample from my Sony Android
tablet S:

Kernel command line: nvmem=64M@448M mem=1024M@0M vmalloc=192M video=tegrafb console=ttyS0,115200n8 usbcore.old_scheme_first=1 lp0_vec=8192@0x1c404000 odmdata=0x300c0040 androidboot.bootloader=0x00000008 tegraboot=sdmc gpt

(Hmmm.  I just noticed that on this device, it doesn't use the 'init=/init'
argument. I think it might just symlink /sbin/init to /init, or maybe they've
modified the kernel to default to /init instead of /sbin/init.
You can find the code in the kernel that does the start of the first
program in <kernel_src>/init/main.c in the routine init_post().

Some of the items that you might see in the kernel command line
(specifically some of the items prefixed with 'android')
are not actually parameters to the kernel.

Some of them are set by the bootloader, but used by Android user-space
programs.  If the kernel does not recognize a parameter, it just
ignores it.  The Android system uses this to pass items from the
bootloader to other parts of the system.  The kernel command line
shows up in user space in /proc/cmdline, and some other
android programs look there to find parameters that are used to
control various runtime features.  For example, init looks there
to find out if it should do data collection for bootchart.

This system is a different use for the kernel command line than
I've seen before, and is pretty interesting.
 -- Tim

--
unsubscribe: android-kernel+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-kernel

Reply via email to