Skip to content

Commit 80d903f

Browse files
committed
Fix grammar mistakes
1 parent 42155aa commit 80d903f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lkmpg.tex

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ \subsection{Before We Begin}
170170
However, most stock Linux distribution kernels come with modversioning enabled.
171171
If difficulties arise when loading the modules due to versioning errors, consider compiling a kernel with modversioning turned off.
172172

173-
\item Using X Window System.
173+
\item Using the X Window System.
174174
It is highly recommended to extract, compile, and load all the examples discussed in this guide from a console.
175175
Working on these tasks within the X Window System is discouraged.
176176

@@ -208,7 +208,7 @@ \section{Headers}
208208
\end{codebash}
209209

210210
The following command provides information on the available kernel header files.
211-
Then for example:
211+
Then, for example:
212212
\begin{codebash}
213213
sudo apt-get install linux-headers-`uname -r`
214214
\end{codebash}
@@ -264,7 +264,7 @@ \subsection{The Simplest Module}
264264
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
265265
\end{code}
266266
267-
In \verb|Makefile|, \verb|$(CURDIR)| can set to the absolute pathname of the current working directory(after all \verb|-C| options are processed, if any).
267+
In \verb|Makefile|, \verb|$(CURDIR)| can be set to the absolute pathname of the current working directory (after all \verb|-C| options are processed, if any).
268268
See more about \verb|CURDIR| in \href{https://www.gnu.org/software/make/manual/make.html}{GNU make manual}.
269269

270270
And finally, just run \verb|make| directly.
@@ -292,7 +292,7 @@ \subsection{The Simplest Module}
292292
echo $(PWD)
293293
\end{code}
294294
295-
Then, we can use \verb|-p| flag to print out the environment variable values from the Makefile.
295+
Then, we can use the \verb|-p| flag to print out the environment variable values from the Makefile.
296296
297297
\begin{verbatim}
298298
$ make -p | grep PWD
@@ -806,13 +806,13 @@ \subsection{Name Space}
806806
\subsection{Code space}
807807
\label{sec:codespace}
808808
Memory management is a very complicated subject and the majority of O'Reilly's \href{https://www.oreilly.com/library/view/understanding-the-linux/0596005652/}{Understanding The Linux Kernel} exclusively covers memory management!
809-
We are not setting out to be experts on memory managements, but we do need to know a couple of facts to even begin worrying about writing real modules.
809+
We are not setting out to be experts on memory management, but we do need to know a couple of facts to even begin worrying about writing real modules.
810810

811811
If you have not thought about what a segfault really means, you may be surprised to hear that pointers do not actually point to memory locations.
812812
Not real ones, anyway.
813813
When a process is created, the kernel sets aside a portion of real physical memory and hands it to the process to use for its executing code, variables, stack, heap and other things which a computer scientist would know about.
814814
This memory begins with 0x00000000 and extends up to whatever it needs to be.
815-
Since the memory space for any two processes do not overlap, every process that can access a memory address, say 0xbffff978, would be accessing a different location in real physical memory! The processes would be accessing an index named 0xbffff978 which points to some kind of offset into the region of memory set aside for that particular process.
815+
Since the memory space for any two processes does not overlap, every process that can access a memory address, say 0xbffff978, would be accessing a different location in real physical memory! The processes would be accessing an index named 0xbffff978 which points to some kind of offset into the region of memory set aside for that particular process.
816816
For the most part, a process like our Hello, World program can't access the space of another process, although there are ways which we will talk about later.
817817

818818
The kernel has its own space of memory as well. Since a module is code which can be dynamically inserted and removed in the kernel (as opposed to a semi-autonomous object), it shares the kernel's codespace rather than having its own.
@@ -1148,7 +1148,7 @@ \section{The /proc File System}
11481148

11491149
Because we don't get called when the file is opened or closed, there's nowhere for us to put \cpp|try_module_get| and \cpp|module_put| in this module, and if the file is opened and then the module is removed, there's no way to avoid the consequences.
11501150

1151-
Here a simple example showing how to use a \verb|/proc| file.
1151+
Here is a simple example showing how to use a \verb|/proc| file.
11521152
This is the HelloWorld for the \verb|/proc| filesystem.
11531153
There are three parts: create the file \verb|/proc/helloworld| in the function \cpp|init_module|, return a value (and a buffer) when the file \verb|/proc/helloworld| is read in the callback function \cpp|procfile_read|, and delete the file \verb|/proc/helloworld| in the function \cpp|cleanup_module|.
11541154

@@ -1294,7 +1294,7 @@ \section{sysfs: Interacting with your module}
12941294
Attributes can be exported for kobjects in the form of regular files in the filesystem.
12951295
Sysfs forwards file I/O operations to methods defined for the attributes, providing a means to read and write kernel attributes.
12961296

1297-
An attribute definition in simply:
1297+
A simple attribute definition:
12981298

12991299
\begin{code}
13001300
struct attribute {
@@ -1322,7 +1322,7 @@ \section{sysfs: Interacting with your module}
13221322
void device_remove_file(struct device *, const struct device_attribute *);
13231323
\end{code}
13241324

1325-
To read or write attributes, \cpp|show()| or \cpp|store()| method must be specified when declaring the attribute.
1325+
To read or write attributes, the \cpp|show()| or \cpp|store()| method must be specified when declaring the attribute.
13261326
For the common cases \src{include/linux/sysfs.h} provides convenience macros (\cpp|__ATTR|, \cpp|__ATTR_RO|, \cpp|__ATTR_WO|, etc.) to make defining attributes easier as well as making code more concise and readable.
13271327

13281328
An example of a hello world module which includes the creation of a variable accessible via sysfs is given below.

0 commit comments

Comments
 (0)