Felix Lee [Tue, 2 Jan 2024 09:10:26 +0000 (17:10 +0800)]
Merge branch 'master' of https://github.com/sysprog21/lkmpg
Jim Huang [Fri, 22 Dec 2023 13:22:32 +0000 (21:22 +0800)]
Proofread
Jim Huang [Fri, 22 Dec 2023 13:02:18 +0000 (21:02 +0800)]
Proofread
Jim Huang [Fri, 22 Dec 2023 12:53:21 +0000 (20:53 +0800)]
syscall-steal: Refine comment
Jim Huang [Fri, 22 Dec 2023 12:37:37 +0000 (20:37 +0800)]
Enforce consistent name scheme
Jim Huang [Fri, 22 Dec 2023 12:33:10 +0000 (20:33 +0800)]
Merge pull request #244 from keytouch/fix_syscall
Fix compilation due to syscall module name conflict
keytouch [Fri, 22 Dec 2023 03:46:46 +0000 (11:46 +0800)]
syscall_steal: rename sys_call_table to fix compile error
sys_call_table is already declared in arch/x86/include/asm/syscall.h but of
cource not exported by the kernel.
before this commit, gcc complains as follows:
/usr/src/linux-headers-6.1.0-16-common/arch/x86/include/asm/syscall.h:21:29:
note: previous declaration of 'sys_call_table' with type 'long int (*
const[])(const struct pt_regs *)'
21 | extern const sys_call_ptr_t sys_call_table[];
keytouch [Thu, 21 Dec 2023 14:12:24 +0000 (22:12 +0800)]
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.
Felix Lee [Fri, 17 Nov 2023 13:52:27 +0000 (21:52 +0800)]
Merge branch 'master' of https://github.com/sysprog21/lkmpg
Amit Dhingra [Mon, 23 Oct 2023 18:31:57 +0000 (20:31 +0200)]
Fixed Typo (#243)
Close #242
Kuan-Wei Chiu [Sun, 8 Oct 2023 09:14:09 +0000 (17:14 +0800)]
Fix typo (#240)
Jim Huang [Sat, 7 Oct 2023 14:51:17 +0000 (22:51 +0800)]
Merge pull request #239 from mechanicalamit/sched_workqueue_patches
Replace schedule_work with queue_work
Amit Dhingra [Sat, 7 Oct 2023 14:32:26 +0000 (16:32 +0200)]
Replace schedule_work with queue_work
schedule_work adds work to global workqueue. In this example, we create a local workqueue. Use the local workqueue by calling queue_work(), instead of putting work on the global workqueue.
Jim Huang [Sat, 7 Oct 2023 09:22:32 +0000 (17:22 +0800)]
Merge pull request #238 from visitorckw/fix-grammar-error
Fix grammar
Kuan-Wei Chiu [Sat, 7 Oct 2023 09:15:19 +0000 (17:15 +0800)]
Fix grammar
The verb 'suggest' is used with the gerund form.
Jim Huang [Sat, 7 Oct 2023 09:12:27 +0000 (17:12 +0800)]
Merge pull request #237 from heartofrain/master
Revise the depiction of return type of proc_create().
heartofrain [Sat, 7 Oct 2023 08:50:23 +0000 (16:50 +0800)]
Revise the depiction of return type of proc_create().
Jim Huang [Sat, 7 Oct 2023 01:19:04 +0000 (09:19 +0800)]
Merge pull request #236 from mechanicalamit/lkmpgtex-tasklet
Change word in tasklet description
Amit Dhingra [Fri, 6 Oct 2023 21:13:09 +0000 (23:13 +0200)]
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.
Jim Huang [Thu, 28 Sep 2023 18:28:23 +0000 (02:28 +0800)]
Merge pull request #235 from mechanicalamit/atomic-patches
Add newline to last pr_info to force dmesg to flush
Amit Dhingra [Thu, 28 Sep 2023 15:26:46 +0000 (15:26 +0000)]
Add newline to last pr_info to force dmesg to flush
dmesg only flushes when it encounter a newline. Without a newline, the line
is held in memory pending another printk. In this particular example
(example_atomic.c), the last pr_info in atomic_bitwise() prints when
another printk happens (either by another module, or __exit for this
module.
This can be confusing to new learner. This patch adds a newline to the last
pr_info forcing dmesg to print to the screen when the module is loaded.
Jim Huang [Thu, 28 Sep 2023 06:55:52 +0000 (14:55 +0800)]
Merge pull request #234 from mechanicalamit/completions-simplify
Simplify code by removal of outer struct encapsulating struct completions
Amit Dhingra [Tue, 26 Sep 2023 20:37:55 +0000 (20:37 +0000)]
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.
Felix Lee [Sat, 23 Sep 2023 13:55:13 +0000 (21:55 +0800)]
change layout for titlepage and contentoftable
Felix Lee [Sat, 23 Sep 2023 05:22:19 +0000 (13:22 +0800)]
add Improve attractiveness section
Felix Lee [Sat, 23 Sep 2023 03:18:32 +0000 (11:18 +0800)]
add Felix Lee to AuthorShip section
Felix Lee [Sat, 23 Sep 2023 02:44:56 +0000 (10:44 +0800)]
add Felix Lee to authors and fix LaTeX command in source file
Felix Lee [Sat, 23 Sep 2023 02:18:07 +0000 (10:18 +0800)]
upgrade all chapters in manual
Felix Lee [Sat, 23 Sep 2023 01:40:10 +0000 (09:40 +0800)]
upgrade introduction section to chapter
Jim Huang [Mon, 18 Sep 2023 03:30:54 +0000 (11:30 +0800)]
CI: Only perform extensive checks on source file changes
Jim Huang [Sun, 17 Sep 2023 18:06:51 +0000 (02:06 +0800)]
Exclude generated files
Jim Huang [Sun, 17 Sep 2023 18:05:28 +0000 (02:05 +0800)]
CI: Bump dependency versions
Jim Huang [Sun, 17 Sep 2023 10:24:27 +0000 (18:24 +0800)]
Explicitly mention 6.x kernels
Amit Dhingra [Sun, 17 Sep 2023 10:23:45 +0000 (12:23 +0200)]
Remove module * parameter from class_create() in chardev2.c (#228)
From v6.4, class_create() does not have module *
Same fix as commit
0addb868dc55 to chardev.c
Jim Huang [Sun, 17 Sep 2023 10:11:00 +0000 (18:11 +0800)]
Merge pull request #226 from mechanicalamit/ioctl.c-patches
Correct name/location for ioctl-number.rst
Chih-En Lin [Sun, 17 Sep 2023 10:09:48 +0000 (18:09 +0800)]
CI: Fix "unreplaced" warnings by using git source (#229)
Because of sparse-latest.tar.gz has not been updated since 06-Sep-2021,
we are encoutering an old bug,
0e1aae55e49c ("fix "unreplaced" warnings
caused by using typeof() on inline functions") [1], that has been fixed
in the newest version. So, let's switch to the git source tree [2]
instead of using sparse-latest.tar.gz [3].
[1] https://git.kernel.org/pub/scm/devel/sparse/sparse.git/commit/?id=
0e1aae55e49cad7ea43848af5b58ff0f57e7af99
[2] git://git.kernel.org/pub/scm/devel/sparse/sparse.git
[3] http://www.kernel.org/pub/software/devel/sparse/dist/sparse-latest.tar.gz
Amit Dhingra [Mon, 4 Sep 2023 17:59:31 +0000 (17:59 +0000)]
Correct name/location for ioctl-number.rst
ioctl-number.rst in Documentation has been renamed and moved
See commits
-
049500715e7
-
08536105d93
Jim Huang [Mon, 4 Sep 2023 02:01:30 +0000 (10:01 +0800)]
Merge pull request #225 from visitorckw/master
Fix typo and remove duplicated words
Kuan-Wei Chiu [Sun, 3 Sep 2023 20:58:31 +0000 (04:58 +0800)]
Fix typo
Kuan-Wei Chiu [Sun, 3 Sep 2023 20:53:07 +0000 (04:53 +0800)]
Remove duplicated words
Jim Huang [Sun, 3 Sep 2023 07:33:52 +0000 (15:33 +0800)]
Merge pull request #224 from fourcolor/master
Fix typo
Shih-Sheng Yang [Sun, 3 Sep 2023 05:06:13 +0000 (13:06 +0800)]
Fix typo
Amit Dhingra [Sat, 2 Sep 2023 18:24:35 +0000 (20:24 +0200)]
Remove module * parameter from class_create() (#222)
From v6.4, class_create() does not have module *
See commit 11ba11 :
> driver core: class: remove module * from class_create()
>
> The module pointer in class_create() never actually did anything,
> and it shouldn't have been requred to be set as a parameter even
> if it did something. So just remove it and fix up all callers of the
> function in the kernel tree at the same time.
Jim Huang [Sat, 2 Sep 2023 14:48:12 +0000 (22:48 +0800)]
Merge pull request #223 from visitorckw/master
Fix typo
Kuan-Wei Chiu [Sat, 2 Sep 2023 11:57:53 +0000 (19:57 +0800)]
Fix typo
Capitalized the first letter in a sentence.
Jim Huang [Fri, 1 Sep 2023 01:00:29 +0000 (09:00 +0800)]
Merge pull request #221 from visitorckw/master
Fix typo
visitorckw [Thu, 31 Aug 2023 20:32:57 +0000 (04:32 +0800)]
Fix typo
Jim Huang [Mon, 14 Aug 2023 17:41:08 +0000 (01:41 +0800)]
Merge pull request #219 from eeeXun/archlinux
Update dependencies for Arch Linux
eeeXun [Mon, 14 Aug 2023 16:25:14 +0000 (00:25 +0800)]
Update dependencies for Arch Linux
Jim Huang [Fri, 11 Aug 2023 02:38:18 +0000 (10:38 +0800)]
Refine contributor list
Jim Huang [Thu, 10 Aug 2023 07:27:11 +0000 (15:27 +0800)]
Proofread
Jim Huang [Thu, 10 Aug 2023 07:05:19 +0000 (15:05 +0800)]
Always use Debian GNU/Linux explicitly
Jim Huang [Thu, 10 Aug 2023 07:02:31 +0000 (15:02 +0800)]
Proofread
Jim Huang [Thu, 10 Aug 2023 06:47:42 +0000 (14:47 +0800)]
Update contributor list
Jim Huang [Thu, 10 Aug 2023 06:39:31 +0000 (14:39 +0800)]
Proofread
Jim Huang [Thu, 10 Aug 2023 06:31:33 +0000 (14:31 +0800)]
Update contributor list
Jim Huang [Thu, 10 Aug 2023 02:26:11 +0000 (10:26 +0800)]
Proofread
Jim Huang [Thu, 10 Aug 2023 02:06:39 +0000 (10:06 +0800)]
Proofread
Jim Huang [Thu, 10 Aug 2023 02:00:50 +0000 (10:00 +0800)]
Proofread
Jim Huang [Thu, 10 Aug 2023 01:32:45 +0000 (09:32 +0800)]
Merge pull request #218 from linD026/master
kbleds: Replace magic with driver_name
Chih-En Lin [Thu, 10 Aug 2023 00:41:13 +0000 (08:41 +0800)]
kbleds: Replace magic with driver_name
Since the commit
5052df99d3bc ("tty: remove TTY_DRIVER_MAGIC") [1],
the magic field no longer exists in the tty_driver. Instead of
printing the magic field, use the driver_name field.
[1] https://lore.kernel.org/linux-doc/
20220907231109.htnfxzmr6wkuhn2v@tarta.nabijaczleweli.xyz/
Close #216
Close #217
Jim Huang [Sun, 23 Jul 2023 13:17:38 +0000 (21:17 +0800)]
Merge pull request #213 from keytouch/master
procfs: Remove unnecessary cleanup on proc_create failure
keytouch [Sun, 23 Jul 2023 10:41:46 +0000 (18:41 +0800)]
procfs: Remove unnecessary cleanup on proc_create failure
Jim Huang [Sat, 8 Jul 2023 04:11:00 +0000 (12:11 +0800)]
Merge pull request #212 from tylerfanelli/dnf_notes
headers: Update header installation for Fedora
Tyler Fanelli [Sat, 8 Jul 2023 03:58:30 +0000 (23:58 -0400)]
headers: Update header installation for Fedora
Sam Erickson [Wed, 5 Jul 2023 15:14:49 +0000 (10:14 -0500)]
static_key: Include <linux/jump_label.h> (#210)
Chih-En Lin [Wed, 5 Jul 2023 01:44:21 +0000 (09:44 +0800)]
examples: Add missing __init/__exit (#209)
Close #207
Jim Huang [Tue, 4 Jul 2023 23:56:03 +0000 (07:56 +0800)]
Merge pull request #208 from samuelerickson977/master
include linux/init.h in bottomhalf.c
Sam Erickson [Tue, 4 Jul 2023 15:10:18 +0000 (10:10 -0500)]
include linux/init.h in bottomhalf.c
Jim Huang [Mon, 3 Jul 2023 21:37:06 +0000 (05:37 +0800)]
Merge pull request #206 from ekangmonyet/master
Cleanup redundant workflow step, fix release body and timestamp
Ekang Monyet [Mon, 3 Jul 2023 01:47:24 +0000 (09:47 +0800)]
Delete old release and retag latest commit
This ensures the latest commit message and timestamp can be correctly
included in the release.
Ekang Monyet [Mon, 3 Jul 2023 01:32:35 +0000 (09:32 +0800)]
Revert "Delete existing release asset before releasing"
This reverts commit
7ee66c559ff12c254d04c65c54325acbb655133a.
Jim Huang [Tue, 2 May 2023 02:58:15 +0000 (10:58 +0800)]
Merge pull request #200 from lyctw/static_key
Introduce static key in optimizations section
Peter Lin [Mon, 1 May 2023 08:15:58 +0000 (16:15 +0800)]
Introduce static key in optimizations section
This patch introduces static key technique and adds a kernel module
to demostrate how to use static key to optimize an almost unlikely
branch, the module can interact with userspace thru a character device.
Signed-off-by: Peter Lin <peterlin@qilai.dev>
Jim Huang [Mon, 1 May 2023 15:48:53 +0000 (23:48 +0800)]
Merge pull request #202 from linD026/master
CI: Switch Smatch source code to GitHub mirror
Chih-En Lin [Mon, 1 May 2023 15:26:17 +0000 (23:26 +0800)]
CI: Switch Smatch source code to GitHub mirror
Since the Smatch repository is unavailable recently [1], let's switch
to GitHub mirror, https://github.com/error27/smatch.git [2], instead
of using https://repo.or.cz/smatch.git.
[1] https://lore.kernel.org/all/Y1qf7w%2Fjo8FH5I8G@kadam/
[2] https://lore.kernel.org/all/
20220810105926.GS3460@kadam/
Jim Huang [Thu, 27 Apr 2023 03:28:05 +0000 (11:28 +0800)]
Merge pull request #198 from linD026/master
Remove sleep_on family
Chih-En Lin [Thu, 27 Apr 2023 02:20:48 +0000 (10:20 +0800)]
Remove sleep_on family
Since the commit
b8780c363d80 ("sched: remove sleep_on() and friends
"), the description about sleep_on is incorrect and the example code has
been fixed by replacing it with wait_event family. Let's also fix the
description to match the corrected code.
Jim Huang [Sun, 26 Mar 2023 01:21:53 +0000 (09:21 +0800)]
Fix macOS prerequisites
Jim Huang [Fri, 24 Mar 2023 04:23:24 +0000 (12:23 +0800)]
Merge pull request #193 from linD026/master
procfs: Enforce Linux naming style
Chih-En Lin [Fri, 24 Mar 2023 03:36:33 +0000 (11:36 +0800)]
procfs: Enforce Linux naming style
Jim Huang [Tue, 14 Mar 2023 01:01:22 +0000 (09:01 +0800)]
Merge pull request #189 from linD026/master
Improve the compatibility and fix the missing header
linD026 [Mon, 13 Mar 2023 23:59:42 +0000 (07:59 +0800)]
completion: Improve the compatibility with v5.17+
Since v5.17-rc1, particularly after the commit
cead1855266 ("exit:
Rename complete_and_exit to kthread_complete_and_exit"),
complete_and_exit() is renamed to kthread_complete_and_exit().
Close #188
linD026 [Mon, 13 Mar 2023 23:51:00 +0000 (07:51 +0800)]
chardev2: Fix missing header for {get, put}_user
Jim Huang [Thu, 23 Feb 2023 13:58:20 +0000 (21:58 +0800)]
Merge pull request #187 from linD026/master
Relocate Archlinux code snippet to avoid confusion
Chih-En Lin [Thu, 23 Feb 2023 12:53:27 +0000 (20:53 +0800)]
Relocate Archlinux code snippet to avoid confusion
Close #185
Jim Huang [Thu, 23 Feb 2023 12:33:11 +0000 (20:33 +0800)]
Merge pull request #186 from ashevche/kernel.h
Discourage kernel.h usage and other header cleanups
Andy Shevchenko [Thu, 23 Feb 2023 10:41:23 +0000 (12:41 +0200)]
treewide: Replace kernel.h by printk.h
The kernel.h should be discouraged for use.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Andy Shevchenko [Wed, 22 Feb 2023 15:43:27 +0000 (17:43 +0200)]
treewide: Clean up the headers
The rule of thumb is to include the headers we are the direct user of.
In particular, if we need an atomic API, we include <linux/atomic.h>.
On the other hand we should not use headers for no reason. In particular,
if we are not doing any IRQ job, why is the <linux/irq.h> included?
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Andy Shevchenko [Tue, 21 Feb 2023 21:03:25 +0000 (23:03 +0200)]
devicemodel: Remove duplicate owner assignment
platform_driver_register() macro already does the correct assignment for
the owner of the driver.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Jim Huang [Sun, 25 Dec 2022 12:24:10 +0000 (20:24 +0800)]
Merge pull request #184 from linD026/master
syscall: Use openat() instead of open()
linD026 [Sun, 25 Dec 2022 05:31:01 +0000 (13:31 +0800)]
syscall: Use openat() instead of open()
Since sys_open is deprecated and some architectures don't support it.
We switch the implementation to sys_openat.
Moreover, in some architectures like x86-64, the prototype of syscall,
for example, openat(), might have been changed to struct pt_regs [1]
but we cannot promise that so support the two types
(sys_openat and pt_regs).
Also, to prevent other untraced tasks print out the information, add
the uid checking in our_sys_openat().
[1] https://lore.kernel.org/lkml/
20180405095307.3730-1-linux@dominikbrodowski.net/
Close #159
Jim Huang [Sun, 25 Dec 2022 04:50:15 +0000 (12:50 +0800)]
Merge pull request #183 from linD026/master
example/syscall: Fix typo and unmatch types
linD026 [Sun, 25 Dec 2022 04:33:52 +0000 (12:33 +0800)]
example/syscall: Fix typo and unmatch types
Jim Huang [Mon, 12 Dec 2022 17:11:45 +0000 (01:11 +0800)]
Merge pull request #182 from lyctw/master
Add error message when sha256 algorithm is not supported
Peter Lin [Mon, 12 Dec 2022 14:55:06 +0000 (22:55 +0800)]
Add error message when sha256 algorithm is not supported
It failed silently when crypto_alloc_tfm() failed, so add an error
message to inform the developer to enable sha256 algorithm support.
Signed-off-by: Yu Chien Peter Lin <peterlin.tw@pm.me>
Jim Huang [Sun, 11 Dec 2022 08:49:44 +0000 (16:49 +0800)]
Merge pull request #181 from lyctw/master
Fix typo in interrupt handlers section
Peter Lin [Sun, 11 Dec 2022 06:45:42 +0000 (14:45 +0800)]
Fix typo in interrupt handlers section
%s/assembler/assembly language/
Signed-off-by: Yu Chien Peter Lin <peterlin.tw@pm.me>
Jim Huang [Fri, 9 Dec 2022 22:21:02 +0000 (06:21 +0800)]
CI: Bump validation host versioning
The CI is now running on Ubuntu 22.04-LTS along with gcc-11 and
clang-format-12 .
Jim Huang [Fri, 9 Dec 2022 22:11:09 +0000 (06:11 +0800)]
CI: Bump dependency versions