204 Commits

Author SHA1 Message Date
Cheng-Yang Chou
58990f6b45 Clarify tasklet limitations and deprecation plans
Improve wording and grammar in the tasklet section. Reflect current
discussion on tasklet deprecation and correct Linux kernel casing.
2025-04-18 06:57:59 +08:00
wurrrrrrrrrr
64353ac7ef Fix incorrect tense in sentence.
Replaced "when a user read" with "when a user reads" for correct grammar.
2025-04-15 18:09:15 +08:00
Chia-Hao Chiu
bf7afe8ca6 Fix grammar in virtual input device driver section
Change "The drivers needs" to "The driver needs" to correct a
subject-verb disagreement and improve readability.
2025-04-14 17:09:20 +08:00
Cheng-Yang Chou
45f58318ba Fix incorrect plural form of IRQ
Replaced "IRQ's" with "IRQs" to use correct grammar.
2025-04-12 13:01:47 +08:00
Cheng-Yang Chou
2ac8dacee6 Rephrase informal example in module section
Replaced the informal message with a formal description to improve
tone and maintain consistency in documentation.
2025-04-12 12:26:16 +08:00
Cheng-Yang Chou
2d3ec07a63 Update kernel header install command for clarity
Remove the redundant 'kmod' installation since it is already
installed earlier. Also replace the hardcoded kernel version
with 'uname -r' to improve portability and compatibility with
modern Linux distributions.
2025-04-12 02:12:25 +08:00
Jim Huang
9ca77904b8
Merge pull request #297 from EricccTaiwan/sda
Some checks failed
build-deploy-assets / build (push) Has been cancelled
deploy-github-page / build (push) Has been cancelled
status-checks / validate (push) Has been cancelled
Update device file example from hda to sda
2025-04-10 14:50:14 +08:00
Cheng-Yang Chou
9e4311d755 Fix formatting of unsigned int major
Wrap the type and name in \cpp|...| for consistency with
other parameters in the sentence.
2025-04-10 11:37:11 +08:00
Cheng-Yang Chou
b1a444883b Update device file example from hda to sda
Update outdated /dev/hda[1-3] device file example to /dev/sda[1-3]
to match modern Linux systems. Adjust major number from 3 to 8
accordingly and remove outdated reference to IDE devices.
2025-04-09 20:56:13 +08:00
Jim Huang
918e87e078
Merge pull request #296 from EricccTaiwan/fix-2
Some checks failed
build-deploy-assets / build (push) Has been cancelled
deploy-github-page / build (push) Has been cancelled
status-checks / validate (push) Has been cancelled
Fix grammar in IRQ flag usage description
2025-04-09 06:36:54 +08:00
Cheng-Yang Chou
75071ec7e1 Fix grammar in IRQ flag usage description
Replaced "for specify" with "to specify" in the explanation of
IRQ flags.
2025-04-09 04:48:08 +08:00
Cheng-Yang Chou
f68ceb947b Remove duplicate word in IRQ flag comment
A repeated "the" appeared in a sentence describing legacy IRQ
flags.
2025-04-09 04:43:42 +08:00
Yu-Chun Lin
11e1064883 Clarify usage differences between spinlock functions
Explain the behavior and use cases of spin_lock(), spin_lock_irq(),
, spin_lock_irqsave() and spin_lock_bh().
2025-04-04 09:52:00 +08:00
Jim Huang
e061eaf5e3
Merge pull request #290 from jeremy90307/master
Add an LED driver example using GPIO
2025-03-10 21:50:57 +08:00
Jeremy90307
0beffd5b70 Add an LED driver example using GPIO
Use GPIO to control LED on/off and add related GPIO knowledge.

Test detail:

- Tested on Raspberry Pi 5B with Raspberry Pi OS (Debian 12, Linux
  version 6.12.1-v8-16k+)

- Verify that LED example compiles and loads successfully

- Verify that LED turns on and off sucessfully
2025-03-10 21:40:58 +08:00
Andrew Kreimer
1bb3f64bc1
Fix a typo
There is an extra "the", remove it.
2025-02-04 21:03:19 +02:00
Integral
6d9d12717a
Remove unnecessary sudo
In some commands such as "lsmod", root permission is not required.
2024-11-11 18:32:47 +08:00
Integral
56c16b9ba0
Replace make with $(MAKE) in Makefile
According to GNU Make Manual,

Recursive make commands should always use the variable MAKE, not
the explicit command name "make".
2024-11-11 13:57:43 +08:00
Andrew Kreimer
98201b85aa Fix typos via codespell
atleast -> at least
encouter -> encounter
2024-10-04 19:08:50 +03:00
Andrew Lin
84cc7fee1c
Fix typo (#265)
Change return-object programming to return-oriented programming.
2024-07-22 01:56:37 +08:00
Hao.Dong
950408472e
Add a hook on syscall using Kprobes under x86 (#260)
For x86 architecture, the system call table cannot be used to invoke
a system call after commit 1e3ad78 since v6.9. This commit has been
backported to long term stable kernels, like v5.15.154+, v6.1.85+,
v6.6.26+ and v6.8.5+[1]. In this case, thanks to Kprobes, a hook can be
used instead on the system call entry to intercept the system call.

[1] https://stackoverflow.com/a/78607015

Co-authored-by: Hao Dong <hao.dong.work@outlook.com>
2024-07-05 07:40:53 +08:00
jouae
74a450ba92
Fix a typo
Delete the duplicate word "otherwise"

Before and after:
otherwise, otherwise -> otherwise
2024-07-03 18:46:45 +08:00
Jim Huang
7bcc4fbf46
Merge pull request #263 from pao0626/command-permission-changes
Add sudo for file access permissions
2024-07-03 17:04:14 +08:00
HJ Pao
be16ad6710 Add sudo for file access permissions
Add sudo to commands in Chapter 8 for example module interaction.

The "myvariables" in the module are set with 0660 permissions
via __ATTR(), preventing direct user access.

Options to fix this:
1. Instruct users to use 'sudo' to read/write files.
2. Relax the permission settings to 0666.

This commit adopts the sudo method to maintain security constraints.
2024-07-03 16:31:53 +08:00
jouae
7a6dd1f582
Modify the descritions of seq_file and flowchart
7.4 The seq_file is missing the behavior that occurs when it
directly returns NULL after the start step.

Also, in the flowchart, the first decision where `return is NULL`
is `Yes` points to nothing, which is not defined in ISO 5807.

ISO 5807 section 10.3.1.2 states logic path of a decision,
"Each exit from a symbol be accompanied by the appropriate
condition values to show the logic path which it represents,
so that the conditions and the associated references are identified."

The behavior of pointing to nothing does not have associated
references and does not indicate the relation of this logic path.

Refs:
	1. The Liunx Kernel Module Programming Guide
	   7.4 Manage /proc file with seq_file
	2. ISO-5807-1985
2024-07-02 23:47:43 +08:00
cvvletter
0a27a0140f
Fix typo (#257) 2024-05-05 19:19:43 +08:00
yeh-sudo
617a1d4d52 Improve readibility
Add \cpp before |main()| to improve readibility so that it won't look
like "|main()|" in the paragraph.
2024-04-25 14:49:43 +08:00
Yo-Jung Lin
86b5e86e5b Refine description in request_threaded_irq usage 2024-04-21 01:09:32 +08:00
Yo-Jung Lin
8cd1c6a322 Refine wordings 2024-04-21 01:09:32 +08:00
Jim Huang
56f566abe6 Provide a tasklet-free example
Co-authored-by: Bob Mottram <bob@freedombone.net>
2024-04-21 01:09:28 +08:00
0xff07
3e472c84fd
Describe atomic context in spinlock section (#254)
Aquiring a spinlock makes the holder enter atomic context. Extra
attention is needed in atomic context. In particular, functions
that may sleep must not be used. Add this detail to the spinlock
section.
2024-04-16 21:25:46 +08:00
Jim Huang
f5893d8140 Remove the crypto section due to poor maintenance
The past content in the crypto section lacks informative descriptions,
and there should be a proper procedure to demonstrate how Linux
cryptography works. Due to poor maintenance, let's drop the section.
2024-04-16 05:39:11 +08:00
Jim Huang
d92fcd1ce4
Merge pull request #248 from vax-r/Fix_typos
Fix typo
2024-04-16 04:58:07 +08:00
weihsinyeh
6640ccdc0f
Fix unmatched quotation (#251) 2024-04-13 13:37:28 +08:00
Yo-Jung Lin
b9a10fe17b Replace SA_xxx IRQ flags with the IRQF_xxx ones
The SA_xxx flags has been removed for years. Nowadays the kernel uses
the IRQF_xxx flags to specify IRQ behaviors. Adjust the descriptions
in the book accordingly.
2024-04-09 19:39:18 +08:00
vax-r
a700043862 Fix typo
Correct "dynamicly" to "dynamically" and correct "initialised" to
"initialized".
2024-02-01 15:09:23 +08:00
Jim Huang
15f9a4999b Proofread 2023-12-22 21:22:32 +08:00
Jim Huang
e631ad9267 Proofread 2023-12-22 21:02:18 +08:00
Jim Huang
e61a0d6174 Enforce consistent name scheme 2023-12-22 20:40:27 +08:00
keytouch
a60e84a060 syscall: rename module name to syscall_steal
In Debian, the name syscall conflicts with this patch:
in debian kernel source tree:
debian/patches/features/x86/x86-make-x32-syscall-support-conditional.patch
mailing list url:
https://lore.kernel.org/lkml/1415245982.3398.53.camel@decadent.org.uk/T/#u
which introduces a parameter named syscall.x32. So change our name.
2023-12-22 20:14:42 +08:00
Amit Dhingra
3490cd7c41
Fixed Typo (#243)
Close #242
2023-10-24 02:31:57 +08:00
Jim Huang
b99354a02f
Merge pull request #238 from visitorckw/fix-grammar-error
Fix grammar
2023-10-07 17:22:32 +08:00
Kuan-Wei Chiu
c0abff2dea Fix grammar
The verb 'suggest' is used with the gerund form.
2023-10-07 17:15:19 +08:00
heartofrain
a8558121d9 Revise the depiction of return type of proc_create(). 2023-10-07 16:50:23 +08:00
Amit Dhingra
8150c1dead
Change word in tasklet description
The word 'defator' is unable to be found in a lexicon. Change the word
'defator' with 'drawbacks' which should imply the negative meaning intended
in the sentence.
2023-10-06 23:13:09 +02:00
Amit Dhingra
bf523b2332 Simplify code by removal of outer struct
Two struct completion(s) are encapsulated within another 'struct machine'.
Simplify the code by removing the outer struct and let the struct
completion(s) be self-standing.

Update description in tex to match code.
2023-09-28 06:02:39 +00:00
Kuan-Wei Chiu
ee617a1e53 Fix typo 2023-09-04 04:58:31 +08:00
Kuan-Wei Chiu
d45485f637 Remove duplicated words 2023-09-04 04:53:07 +08:00
Shih-Sheng Yang
34eb62045e
Fix typo 2023-09-03 13:06:13 +08:00
Kuan-Wei Chiu
292339e628 Fix typo
Capitalized the first letter in a sentence.
2023-09-02 19:57:53 +08:00