Startup Parameters
Short Description
seriously interested in kernel programming, I recommend the list of kernel resources in. http://jungla.dit.upm.es/~jmseyas/linux/kernel/hackers-. docs.html. …
Website: cdrom.gnutemberg.org | Filesize: 602kb
Content
Chapter 6
Startup Parameters
In many of the previous examples, we had to hard-wire something into the kernel module,
such as the file name for /proc files or the major device number for the device so we
can have ioctl’s to it. This goes against the grain of the Unix, and Linux, philosophy
which is to write flexible program the user can customize.
The way to tell a program, or a kernel module, something it needs before it can start
working is by command line parameters. In the case of kernel modules, we don’t get argc
and argv-instead, we get something better. We can define global variables in the kernel
module and insmod will fill them for us.
In this kernel module, we define two of them: str1 and str2. All you need to
do is compile the kernel module and then run insmod str1=xxx str2=yyy. When
init module is called, str1 will point to the string ‘xxx’ and str2 to the string
‘yyy’.
In version 2.0 there is no type checking on these arguments . If the first character of
str1 or str2 is a digit the kernel will fill the variable…
Get the file Download here
Related Books:Related Searches: linux kernel hackers, command line parameters, kernel resources, startup parameters, kernel programming
Comments
Leave a Reply