clarification on some trivial boot-time parms stuff

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

 



  i'm still following the logic (and i use the word "logic" in the
loosest possible sense :-) of how boot-time kernel parameters are
processed and i want to start simple and just clarify a couple things
that should be spectacularly trivial but, really, i just don't trust
the documentation anymore so i'll ask.

  from init/main.c, we have a couple declarations of variables to hold
the entire boot command line:

...
/* Untouched command line saved by arch-specific code. */
char __initdata boot_command_line[COMMAND_LINE_SIZE];
/* Untouched saved command line (eg. for /proc) */
char *saved_command_line;
...

  so, to clarify:

1) boot_command_line is to hold *exactly* -- byte for byte -- the
command line as it is presented initially, correct?  no pre-parsing,
no quiet cleanup, but absolutely verbatim, is that right?


2) since that same variable is tagged with "__initdata", it is
de-allocated after booting is complete, yes?  which means that, by the
time booting is complete, everything of value that was passed in must
have been extracted and either processed or stored elsewhere.


3) the pointer "saved_command_line" is also advertised as referring to
the untouched command line, which made me wonder why that data wasn't
just left where it was in the first place, but as i read it, the sole
benefit to this is that boot_command_line allocates a fixed array of
length COMMAND_LINE_SIZE, whereas the exact copy of that information
will be copied (via strcpy) into just enough space to hold it and
pointed to by saved_command line.  in short, the only reason is to
save some space and, except for that, the contents will still be
byte-for-byte identical.


  is all that fairly accurate?

rday
-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://crashcourse.ca
========================================================================

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