From 3373fb5eb66c8e69e0c3cad3e2893e0ed73959aa Mon Sep 17 00:00:00 2001 From: jserv Date: Sun, 29 Aug 2021 17:45:55 +0000 Subject: [PATCH] deploy: d3bde7daed9d946a3f7f23929a878be860236d85 --- index.html | 123 ++++++++++++++++++++++------------------------ lkmpg-for-ht.css | 8 +-- lkmpg-for-ht.html | 123 ++++++++++++++++++++++------------------------ 3 files changed, 124 insertions(+), 130 deletions(-) diff --git a/index.html b/index.html index c8b1f82..6b3b4a9 100644 --- a/index.html +++ b/index.html @@ -20,7 +20,7 @@

The Linux Kernel Module Programming Guide

Peter Jay Salzman, Michael Burian, Ori Pomerantz, Bob Mottram, Jim Huang

-
August 26, 2021
+
August 29, 2021
@@ -3940,70 +3940,67 @@ tty. 11 12static void print_string(char *str) 13{ -14    struct tty_struct *my_tty; -15    const struct tty_operations *ttyops; +14    /* The tty for the current task */ +15    struct tty_struct *my_tty = get_current_tty(); 16 -17    /* The tty for the current task, for 2.6.6+ kernels */ -18    my_tty = get_current_tty(); -19    ttyops = my_tty->driver->ops; -20 -21    /* If my_tty is NULL, the current task has no tty you can print to (i.e., -22     * if it is a daemon). If so, there is nothing we can do. -23     */ -24    if (my_tty) { -25        /* my_tty->driver is a struct which holds the tty's functions, -26         * one of which (write) is used to write strings to the tty. -27         * It can be used to take a string either from the user's or -28         * kernel's memory segment. -29         * -30         * The function's 1st parameter is the tty to write to, because the -31         * same function would normally be used for all tty's of a certain -32         * type. -33         * The 2nd parameter is a pointer to a string. -34         * The 3rd parameter is the length of the string. -35         * -36         * As you will see below, sometimes it's necessary to use -37         * preprocessor stuff to create code that works for different -38         * kernel versions. The (naive) approach we've taken here does not -39         * scale well. The right way to deal with this is described in -40         * section 2 of -41         * linux/Documentation/SubmittingPatches -42         */ -43        (ttyops->write)(my_tty,       /* The tty itself */ -44                        str,          /* String                 */ -45                        strlen(str)); /* Length */ -46 -47        /* ttys were originally hardware devices, which (usually) strictly -48         * followed the ASCII standard. In ASCII, to move to a new line you -49         * need two characters, a carriage return and a line feed. On Unix, -50         * the ASCII line feed is used for both purposes - so we can not -51         * just use \n, because it would not have a carriage return and the -52         * next line will start at the column right after the line feed. -53         * -54         * This is why text files are different between Unix and MS Windows. -55         * In CP/M and derivatives, like MS-DOS and MS Windows, the ASCII -56         * standard was strictly adhered to, and therefore a newline requirs -57         * both a LF and a CR. -58         */ -59        (ttyops->write)(my_tty, "\015\012", 2); -60    } -61} -62 -63static int __init print_string_init(void) -64{ -65    print_string("The module has been inserted.  Hello world!"); -66    return 0; -67} -68 -69static void __exit print_string_exit(void) -70{ -71    print_string("The module has been removed.  Farewell world!"); -72} +17    /* If my_tty is NULL, the current task has no tty you can print to (i.e., +18     * if it is a daemon). If so, there is nothing we can do. +19     */ +20    if (my_tty) { +21        const struct tty_operations *ttyops = my_tty->driver->ops; +22        /* my_tty->driver is a struct which holds the tty's functions, +23         * one of which (write) is used to write strings to the tty. +24         * It can be used to take a string either from the user's or +25         * kernel's memory segment. +26         * +27         * The function's 1st parameter is the tty to write to, because the +28         * same function would normally be used for all tty's of a certain +29         * type. +30         * The 2nd parameter is a pointer to a string. +31         * The 3rd parameter is the length of the string. +32         * +33         * As you will see below, sometimes it's necessary to use +34         * preprocessor stuff to create code that works for different +35         * kernel versions. The (naive) approach we've taken here does not +36         * scale well. The right way to deal with this is described in +37         * section 2 of +38         * linux/Documentation/SubmittingPatches +39         */ +40        (ttyops->write)(my_tty,       /* The tty itself */ +41                        str,          /* String                 */ +42                        strlen(str)); /* Length */ +43 +44        /* ttys were originally hardware devices, which (usually) strictly +45         * followed the ASCII standard. In ASCII, to move to a new line you +46         * need two characters, a carriage return and a line feed. On Unix, +47         * the ASCII line feed is used for both purposes - so we can not +48         * just use \n, because it would not have a carriage return and the +49         * next line will start at the column right after the line feed. +50         * +51         * This is why text files are different between Unix and MS Windows. +52         * In CP/M and derivatives, like MS-DOS and MS Windows, the ASCII +53         * standard was strictly adhered to, and therefore a newline requirs +54         * both a LF and a CR. +55         */ +56        (ttyops->write)(my_tty, "\015\012", 2); +57    } +58} +59 +60static int __init print_string_init(void) +61{ +62    print_string("The module has been inserted.  Hello world!"); +63    return 0; +64} +65 +66static void __exit print_string_exit(void) +67{ +68    print_string("The module has been removed.  Farewell world!"); +69} +70 +71module_init(print_string_init); +72module_exit(print_string_exit); 73 -74module_init(print_string_init); -75module_exit(print_string_exit); -76 -77MODULE_LICENSE("GPL"); +74MODULE_LICENSE("GPL");

13.2 Flashing keyboard LEDs

diff --git a/lkmpg-for-ht.css b/lkmpg-for-ht.css index 2b2232c..913a12e 100644 --- a/lkmpg-for-ht.css +++ b/lkmpg-for-ht.css @@ -2497,13 +2497,13 @@ span#textcolor1982{color:rgb(0,127,0)} span#textcolor1983{color:rgb(0,0,255)} span#textcolor1984{color:rgb(43,145,175)} span#textcolor1985{color:rgb(43,145,175)} -span#textcolor1986{color:rgb(0,0,255)} +span#textcolor1986{color:rgb(0,127,0)} span#textcolor1987{color:rgb(0,0,255)} -span#textcolor1988{color:rgb(0,0,255)} +span#textcolor1988{color:rgb(0,127,0)} span#textcolor1989{color:rgb(0,127,0)} span#textcolor1990{color:rgb(0,127,0)} -span#textcolor1991{color:rgb(0,127,0)} -span#textcolor1992{color:rgb(0,127,0)} +span#textcolor1991{color:rgb(0,0,255)} +span#textcolor1992{color:rgb(0,0,255)} span#textcolor1993{color:rgb(0,0,255)} span#textcolor1994{color:rgb(0,127,0)} span#textcolor1995{color:rgb(0,127,0)} diff --git a/lkmpg-for-ht.html b/lkmpg-for-ht.html index c8b1f82..6b3b4a9 100644 --- a/lkmpg-for-ht.html +++ b/lkmpg-for-ht.html @@ -20,7 +20,7 @@

The Linux Kernel Module Programming Guide

Peter Jay Salzman, Michael Burian, Ori Pomerantz, Bob Mottram, Jim Huang

-
August 26, 2021
+
August 29, 2021
@@ -3940,70 +3940,67 @@ tty. 11 12static void print_string(char *str) 13{ -14    struct tty_struct *my_tty; -15    const struct tty_operations *ttyops; +14    /* The tty for the current task */ +15    struct tty_struct *my_tty = get_current_tty(); 16 -17    /* The tty for the current task, for 2.6.6+ kernels */ -18    my_tty = get_current_tty(); -19    ttyops = my_tty->driver->ops; -20 -21    /* If my_tty is NULL, the current task has no tty you can print to (i.e., -22     * if it is a daemon). If so, there is nothing we can do. -23     */ -24    if (my_tty) { -25        /* my_tty->driver is a struct which holds the tty's functions, -26         * one of which (write) is used to write strings to the tty. -27         * It can be used to take a string either from the user's or -28         * kernel's memory segment. -29         * -30         * The function's 1st parameter is the tty to write to, because the -31         * same function would normally be used for all tty's of a certain -32         * type. -33         * The 2nd parameter is a pointer to a string. -34         * The 3rd parameter is the length of the string. -35         * -36         * As you will see below, sometimes it's necessary to use -37         * preprocessor stuff to create code that works for different -38         * kernel versions. The (naive) approach we've taken here does not -39         * scale well. The right way to deal with this is described in -40         * section 2 of -41         * linux/Documentation/SubmittingPatches -42         */ -43        (ttyops->write)(my_tty,       /* The tty itself */ -44                        str,          /* String                 */ -45                        strlen(str)); /* Length */ -46 -47        /* ttys were originally hardware devices, which (usually) strictly -48         * followed the ASCII standard. In ASCII, to move to a new line you -49         * need two characters, a carriage return and a line feed. On Unix, -50         * the ASCII line feed is used for both purposes - so we can not -51         * just use \n, because it would not have a carriage return and the -52         * next line will start at the column right after the line feed. -53         * -54         * This is why text files are different between Unix and MS Windows. -55         * In CP/M and derivatives, like MS-DOS and MS Windows, the ASCII -56         * standard was strictly adhered to, and therefore a newline requirs -57         * both a LF and a CR. -58         */ -59        (ttyops->write)(my_tty, "\015\012", 2); -60    } -61} -62 -63static int __init print_string_init(void) -64{ -65    print_string("The module has been inserted.  Hello world!"); -66    return 0; -67} -68 -69static void __exit print_string_exit(void) -70{ -71    print_string("The module has been removed.  Farewell world!"); -72} +17    /* If my_tty is NULL, the current task has no tty you can print to (i.e., +18     * if it is a daemon). If so, there is nothing we can do. +19     */ +20    if (my_tty) { +21        const struct tty_operations *ttyops = my_tty->driver->ops; +22        /* my_tty->driver is a struct which holds the tty's functions, +23         * one of which (write) is used to write strings to the tty. +24         * It can be used to take a string either from the user's or +25         * kernel's memory segment. +26         * +27         * The function's 1st parameter is the tty to write to, because the +28         * same function would normally be used for all tty's of a certain +29         * type. +30         * The 2nd parameter is a pointer to a string. +31         * The 3rd parameter is the length of the string. +32         * +33         * As you will see below, sometimes it's necessary to use +34         * preprocessor stuff to create code that works for different +35         * kernel versions. The (naive) approach we've taken here does not +36         * scale well. The right way to deal with this is described in +37         * section 2 of +38         * linux/Documentation/SubmittingPatches +39         */ +40        (ttyops->write)(my_tty,       /* The tty itself */ +41                        str,          /* String                 */ +42                        strlen(str)); /* Length */ +43 +44        /* ttys were originally hardware devices, which (usually) strictly +45         * followed the ASCII standard. In ASCII, to move to a new line you +46         * need two characters, a carriage return and a line feed. On Unix, +47         * the ASCII line feed is used for both purposes - so we can not +48         * just use \n, because it would not have a carriage return and the +49         * next line will start at the column right after the line feed. +50         * +51         * This is why text files are different between Unix and MS Windows. +52         * In CP/M and derivatives, like MS-DOS and MS Windows, the ASCII +53         * standard was strictly adhered to, and therefore a newline requirs +54         * both a LF and a CR. +55         */ +56        (ttyops->write)(my_tty, "\015\012", 2); +57    } +58} +59 +60static int __init print_string_init(void) +61{ +62    print_string("The module has been inserted.  Hello world!"); +63    return 0; +64} +65 +66static void __exit print_string_exit(void) +67{ +68    print_string("The module has been removed.  Farewell world!"); +69} +70 +71module_init(print_string_init); +72module_exit(print_string_exit); 73 -74module_init(print_string_init); -75module_exit(print_string_exit); -76 -77MODULE_LICENSE("GPL"); +74MODULE_LICENSE("GPL");

13.2 Flashing keyboard LEDs