Commit Graph

313 Commits

Author SHA1 Message Date
linD026
06b75942cc
Fix incorrect major number registration in chardev (#77)
chardev2.c demonstrates the ioctl operation with static major
number MAJOR_NUM, but there also exists "Major," the dynamic
one, which results in registration and deregistration on different
device. Once the module remove, it cannot insert again:

  $ sudo insmod chardev2.ko
  $ sudo rmmod chardev2
  $ cat /proc/devices
  Character devices:
  ...
  100 char_dev
  $ sudo insmod chardev2.ko
  insmod: ERROR: could not insert module chardev2.ko: Device or resource busy

This patch removed the use of dynamic major number.
2021-08-26 03:16:17 +08:00
Jim Huang
c97348d2d5
Merge pull request #75 from tuckerpo/fix/errno_assignment
Fix: errno assignment should be comparison.
2021-08-24 23:22:32 +08:00
Tucker Polomik
a183cc72f0 Fix: errno assignment should be comparison. 2021-08-24 11:16:25 -04:00
Jim Huang
ecfe9606de Get rid of the initial 0 that shows up in every (sub)section
Every section and subsection number can be eliminated by adding the
renewcommand.

Suggested by Lars Engebretsen.
2021-08-24 19:02:16 +08:00
Jim Huang
9d39f658c7
Merge pull request #74 from brdbkr/master
Fixed typo
2021-08-24 14:08:24 +08:00
Brad Baker
8012508508 Fixing typo 2021-08-24 00:15:47 -04:00
Jim Huang
fe3db9f939
Merge pull request #70 from fennecJ/patch
Adapt recent kernel changes
2021-08-24 03:41:14 +08:00
fennecJ
870b26fa2d Update several example code for newer kernel
Known issues with current example code:
If you using newer kernel(e.g linux 5.11.x) to compile the example code,
you may meet following error:
1. syscall.c:83:50: error: ‘ksys_close’ undeclared;
2. cryptosk.c:17:24: error: field ‘sg’ has incomplete type
3. cryptosk.c:143:9: error: implicit declaration of function
‘get_random_bytes’
4. error: macro "DECLARE_TASKLET" passed 3 arguments, but takes just 2

Solutions/workaround:
1. In syscall.c, replace #include <linux/syscalls.h> with
#include <linux/fdtable.h> and replace  ksys_close with close_fd
if the kernel version >= 5.11. [1][2]
2. Add #include <linux/scatterlist.h> into cryptosk.c
3. Add #include <linux/random.h> into cryptosk.c
4. In bottomhalf.c and example_tasklet.c, replace DECLARE_TASKLET
with DECLARE_TASKLET_OLD and dispose third argument(0L). [3]

[1] - https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1572bfdf21d4d50e51941498ffe0b56c2289f783
[2] - https://www.mail-archive.com/meta-arago@arago-project.org//msg11939.html
[3] - https://patchwork.kernel.org/project/kernel-hardening/patch/20200716030847.1564131-3-keescook@chromium.org/
2021-08-23 21:30:43 +08:00
Jim Huang
bd8342bc14
Merge pull request #69 from gagachang/master
Update path to kernel v5.x
2021-08-21 19:27:08 +08:00
gagachang
9827e32e4d Update some file path to kernel v5.x+ in example/kbleds.c
1. drivers/char/vt_ioctl.c -> drivers/tty/vt/vt_ioctl.c
2. drivers/char/keyboard.c -> drivers/tty/vt/keyboard.c
2021-08-21 14:51:37 +08:00
Jim Huang
22e50f3ce9 Use recent kernel build messages 2021-08-20 01:05:51 +08:00
Jim Huang
f7e2186e6b Revise the version magic descriptions for recent kernels 2021-08-20 01:02:20 +08:00
Jim Huang
3c742b0c7c Fix wording 2021-08-20 00:29:43 +08:00
Jim Huang
e47258cd19 Neither latexmk nor dvipng is required
The package texlive-bin from extra also contains a dvipng binary.

Close #58
2021-08-18 20:43:51 +08:00
Jim Huang
9a19fde915
Merge pull request #67 from fennecJ/master
Add pdf download link in html only
2021-08-17 17:37:08 +08:00
fennecj
fe8dd00e2c Add PDF download link in html only
Close #64
2021-08-17 17:35:36 +08:00
Jim Huang
2db805da2c Check coding style in CI 2021-08-17 13:07:06 +08:00
Jim Huang
48cb100473
Merge pull request #66 from CyrilBrulebois/master
Proofreading and small improvements
2021-08-17 08:56:55 +08:00
Cyril Brulebois
98aa78e4d2 Adjust link to ioctl-number.rst 2021-08-16 21:54:03 +02:00
Cyril Brulebois
c43c01db31 Improve wording (avoid a send/sent repetition along the way) 2021-08-16 21:54:03 +02:00
Cyril Brulebois
08b6de2cde Use an https:// link for LWN 2021-08-16 21:54:03 +02:00
Cyril Brulebois
8861d1ead7 Improve wording (statistics seem gathered, not stat-ed) 2021-08-16 21:54:03 +02:00
Cyril Brulebois
4d5649fc08 Improve wording (there's only one kernel) 2021-08-16 21:54:03 +02:00
Cyril Brulebois
3e05439b6d Add emphasis for the y/m values 2021-08-16 21:54:03 +02:00
Cyril Brulebois
b5ab7c5e88 Fix various typos 2021-08-16 21:54:03 +02:00
Cyril Brulebois
d85944d107 Mention pr_info() rather than KERN_INFO
The latter might have been used along with printk() in an earlier
version, but pr_info() is getting used consistently so adjust the
#include comments accordingly.

For the avoidance of doubt, pr_info() actually comes from printk.h,
which gets #include'd by kernel.h.
2021-08-16 21:53:22 +02:00
fennecJ
467cc83cc7
Improve the descriptions about reference count (#62)
The term "reference count" would be better than "use count."
In addition, the usage of module_refcount(THIS_MODULE) was appended
for the reference counter query.
2021-08-17 00:23:22 +08:00
Jim Huang
53d071eb16
Merge pull request #63 from fennecJ/patch2
Fix typo
2021-08-17 00:11:37 +08:00
fennecj
99faf5ed0f Fix typo 2021-08-16 23:48:04 +08:00
Jim Huang
4acc65b740 Use \verb for the identifiers starting with "--" 2021-08-16 21:21:10 +08:00
Jim Huang
b497b6a34e Remove never implemented MODULE_SUPPORTED_DEVICE
MODULE_SUPPORTED_DEVICE is remove from upstream since March 17, 2021.
See linux.git commit 6417f03

Reported by Niklas Lantau <niklaslantau@gmail.com>
Close #61
2021-08-16 20:19:35 +08:00
Chih-Yu Chen
c8238430b2
Avoid incorrectly separated words (#55)
This patch fixed some typos and added the missing punctuation.
2021-08-16 18:45:43 +08:00
Jim Huang
fd69ad9d05
Merge pull request #60 from fennecJ/patch
Fix grammar and typo
2021-08-16 17:24:26 +08:00
fennecj
15e44bffa8 Fix grammar and typo 2021-08-16 00:47:23 +08:00
Jim Huang
964f14dda6 Annotate more directories/files 2021-08-13 01:02:21 +08:00
Jim Huang
4c137c305c
Merge pull request #57 from fennecJ/patch
Fix typo
2021-08-13 00:53:24 +08:00
fennecj
990358d75a Fix typo 2021-08-13 00:52:33 +08:00
Jim Huang
1da7086da0
Merge pull request #56 from bbenno/fix/typo
Fix typo: concurent -> concurrent
2021-08-13 00:28:37 +08:00
Benno Bielmeier
8ba0b0085d
Fix typo: concurent -> concurrent 2021-08-12 07:43:38 +00:00
Jim Huang
f426661923
Merge pull request #54 from fennecJ/patch
Fix typo
2021-08-11 21:01:07 +08:00
fennecj
b656755300 Fix typo 2021-08-11 18:34:23 +08:00
Jim Huang
8d7caa7fc9 Make insmod/rmmod more consistent 2021-08-11 15:08:08 +08:00
Jim Huang
28abb0eca7
Merge pull request #53 from fennecJ/patch
Fix incorrect path
2021-08-10 18:24:17 +08:00
fennecj
e87998c224 Fix incorrect path
There should be a space between uname and -r
2021-08-10 18:22:33 +08:00
Jim Huang
b23168befe
Merge pull request #51 from ChinYikMing/fix-init-mesg
Fix init message
2021-08-10 00:55:56 +08:00
ChinYikMing
ad4ac48eec Fix init message 2021-08-10 00:48:19 +08:00
Jim Huang
6b6083fca2 Remove out-of-date information 2021-08-09 23:59:59 +08:00
Jim Huang
b002e43bb8 Annotate NULL 2021-08-09 23:57:30 +08:00
Jim Huang
cb6267e3b6 Fix wording 2021-08-09 23:46:37 +08:00
Jim Huang
e800505b8f Point to corresponding kernel header 2021-08-09 23:26:01 +08:00