Errata
Last updated 12/31/00
The errata listed on this page lists every
error of any type of which I am aware. If you see one that
is not on this page, I would appreciate knowing about it --
send a message to nutt@cs.colorado.edu.
Page 27, Line 25: Change
"with a linked list of pointers. ..."
to
"with an array of pointers. ..."
Page 84, Line 7: Change "... since the beginning of epoch."
to
"... since the beginning of the epoch."
Page 98, Line 25: Change
"... In general, to find out what symbols are exported"
to
"... In general, to find out what kernel functions are exported"
Page 100-102:
The description of the struct dir_entry data
structure is not quite right for either 2.0.36 nor 2.2.12.
In 2.0.36, there was no read() function, just
a get_info(); so there should not be a
read_proc() function in the struct dir_entry
definition for 2.0.36. In 2.2.12, things were different,
as you can see by looking at .../include/linux/proc_fs.h;
more fields were added to struct dir_entry, including
a read_proc() function that had the same arguments as the
get_info() in 2.0.36. The conclusion is that the
discussion of the get_info() function is correct,
but needs to be applied to the read_proc() field
instead of the get_info() field in 2.2.12, i.e.
the read_proc() function is called by the read()
system call for the module. Finally, note that
if no read_proc() function is defined in Version 2.2.x,
the default function is the get_info() function.
This discussion can be corrected with the following edits:
- Page 100, replace Lines 31-32 by:
int (*read_proc)(char *page, char **start, off_t off,
int count, int *eof, void *data);
int (*write_proc)(struct file *file, const char *buffer,
unsigned long count, void *data);
int (*readlink_proc)(struct proc_dir_entry *de, char *page);
unsigned int count; /* use count */
int deleted; /* delete flag */
};
- Page 101, Lines 11 and 13: Replace get_info by
read_proc
- Page 101, replace Lines 15-21 by:
read_proc(
char *page,
char **start,
off_t off,
int count,
int *eof,
void *data
);
- Page 101, Lines 22-27: Replace the parameter names that appear in
this paragraph by the new names for the read_proc function:
sys_buffer becomes page,
my_buffer becomes start,
file_pos becomes off,
and
my_buffer_length becomes count.
- Page 101, Line 25: Change "... pseudo file position;" to
"... pseudo file offset position;"
- Page 101, Line 27: Insert "The eof flag is set by
read_proc() when it encounters an end of file condition."
before "The last argument ..."
- Page 101, insert the following new paragraph after Line 27:
"In earlier versions of Linux the get_info() function
was called by the read() system call. To make old code
be compatible with the new declaration, the default value for
read_proc is get_info (meaning that if no
read_proc is declared, the system will use the get_info
function instead).
- Page 102, Line 12: Change the NULL parameter to
NULL,
NULL,
0,
0
Page 105, insert after Line 12:
"The Mandrake kernel distribution requires an
additional argument, -D_LOOSE_KERNEL_NAMES before it
will handle kernel symbols properly."
Page 108, Line 36: Change
.rept NR.syscall_igo
to
.rept NR_syscalls_190
Page 109, insert after Line 33:
...
.rept NR_syscalls-191
.long SYMBOL_NAME(sys_ni_call)
Page 113, replace Lines 26-34 by:
"If a block of user-space memory is to be written by the kernel,
it is necessary to use the put_user(int x, void *ptr)
function to write the information. The x parameter is
the number of bytes to be written, and the ptr pointer
is the address to be written.
The verify_area() and put_user() function
prototypes and related manifest constants are defined in
include/asm/uaccess.h, so you must have
#include <asm/uaccess.h>
in your program that references user memory."
Page 114, insert after Line 26:
If printk() is not printing to your console, you can
fined the messages embedded in
the system log -- /var/log/messages.
Page 115, insert after Line 14:
#include <asm/uaccess.h>
Page 115, Line 17: Change
int write_ok;
to
int write_failed;
Page 130, Insert after the "Problem Statement" heading:
Part A
Write a program that creates and uses -- reads and writes -- multiple
blocks of shared memory.
Part B
Page 144, Line 1: Change
"... For example, you should"
to
"... For example, you could"
Page, 161, Line 3: Change
"..., since they all have a priority of zero."
to
"..., since they all have a static priority of zero, meaning that
they are all in the same queue (a dynamic priority is used to discriminate
among the processes within a given queue as described next).
Page, 173, Line 27: Change
fl = module_inregister_chrdev(majorNumber, "foo");
to
flag = module_unregister_chrdev(majorNumber, "foo");
Page, 192, Lines 3-4 of Figure 2.14: Change
0x0b 0x0c Sectors per cluster (discussed in Exercise 11)
0x0d 0x0f Reserved sectors for the boot record
to
0x0b 0x0c Bytes per sector
0x0d 0x0d Sectors per cluster
0x0e 0x0f Reserved sectors for the boot record
Page, 199, Line 25: Change
int dest, lent;
to
int dest, len;
Page, 200, Line 1: Change
int dest, lent;
to
int dest, len;