Re: Kernel command line parameter?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chetan Nanda wrote:
Hi All,

I have to pass a new command line parameter to linux kernel at bootup time, I am using Intel x86 machine.
command line parsing does not depend on arch.

How will I go about this?
I have seen in kernel code many statements like:
__setup("str",fn);
You are asking two things (if I understand correctly)
1. How to add your own variable to kernel (and make use of it)
2. How cmdline args are parsed.

1. write a function
static int __init foobar_handler(char *cmd){}
and use get_options to parse the cmd string.

use the call,
__setup("foo", foobar_handler);
To setup the handler

2.Refer init/main.c, and kernel/params.c

Thanks,
Om.


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux