mirror of
https://github.com/sysprog21/lkmpg.git
synced 2024-11-22 09:52:45 +08:00
Revise hello-5 and its output (#38)
For the example module hello_5, the book showed the incorrect output in corresponding with its execution results. In addition, this patch changes from myintArray[2] = {-1, -1} to myintArray[2] = {420, 420}, which help the readers distinguish from the kernel messages.
This commit is contained in:
parent
40f0ff3087
commit
5940dd9faa
|
@ -13,7 +13,7 @@ static short int myshort = 1;
|
|||
static int myint = 420;
|
||||
static long int mylong = 9999;
|
||||
static char *mystring = "blah";
|
||||
static int myintArray[2] = {-1, -1};
|
||||
static int myintArray[2] = {420, 420};
|
||||
static int arr_argc = 0;
|
||||
|
||||
/*
|
||||
|
|
12
lkmpg.tex
12
lkmpg.tex
|
@ -408,20 +408,24 @@ I would recommend playing around with this code:
|
|||
\begin{code}
|
||||
$ sudo insmod hello-5.ko mystring="bebop" myintArray=-1
|
||||
myshort is a short integer: 1
|
||||
myint is an integer: 20
|
||||
myint is an integer: 420
|
||||
mylong is a long integer: 9999
|
||||
mystring is a string: bebop
|
||||
myintArray is -1 and 420
|
||||
myintArray[0] = -1
|
||||
myintArray[1] = 420
|
||||
got 1 arguments for myintArray.
|
||||
|
||||
$ sudo rmmod hello-5
|
||||
Goodbye, world 5
|
||||
|
||||
$ sudo insmod hello-5.ko mystring="supercalifragilisticexpialidocious" myintArray=-1,-1
|
||||
myshort is a short integer: 1
|
||||
myint is an integer: 20
|
||||
myint is an integer: 420
|
||||
mylong is a long integer: 9999
|
||||
mystring is a string: supercalifragilisticexpialidocious
|
||||
myintArray is -1 and -1
|
||||
myintArray[0] = -1
|
||||
myintArray[1] = -1
|
||||
got 2 arguments for myintArray.
|
||||
|
||||
$ sudo rmmod hello-5
|
||||
Goodbye, world 5
|
||||
|
|
Loading…
Reference in New Issue
Block a user