mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-28 12:34:26 +01:00
done3
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -8,6 +8,7 @@
|
|||||||
.tmp_versions
|
.tmp_versions
|
||||||
/rootfs_overlay/etc/init.d/S99
|
/rootfs_overlay/etc/init.d/S99
|
||||||
Module.symvers
|
Module.symvers
|
||||||
|
README.html
|
||||||
modules.order
|
modules.order
|
||||||
trace*
|
trace*
|
||||||
|
|
||||||
|
|||||||
16
README.adoc
16
README.adoc
@@ -1748,6 +1748,22 @@ then `dtc a.dts` gives:
|
|||||||
};
|
};
|
||||||
....
|
....
|
||||||
|
|
||||||
|
=== Directory structure
|
||||||
|
|
||||||
|
:leveloffset: +3
|
||||||
|
|
||||||
|
include::buildroot_patches/README.adoc[]
|
||||||
|
|
||||||
|
include::global_patch_dir/README.adoc[]
|
||||||
|
|
||||||
|
include::kernel_module/README.adoc[]
|
||||||
|
|
||||||
|
include::kernel_module/user/README.adoc[]
|
||||||
|
|
||||||
|
include::rootfs_overlay/README.adoc[]
|
||||||
|
|
||||||
|
:leveloffset: -3
|
||||||
|
|
||||||
=== Maintainers
|
=== Maintainers
|
||||||
|
|
||||||
==== Contributing
|
==== Contributing
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Buildroot patches
|
= buildroot_patches
|
||||||
|
|
||||||
Every `.patch` file in this directory gets applied to Buildroot before anything else is done.
|
Every `.patch` file in this directory gets applied to Buildroot before anything else is done.
|
||||||
|
|
||||||
7
global_patch_dir/README.adoc
Normal file
7
global_patch_dir/README.adoc
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
= global_patch_dir
|
||||||
|
|
||||||
|
This directory has the following structure:
|
||||||
|
|
||||||
|
....
|
||||||
|
package-name/00001-do-something.patch
|
||||||
|
....
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
# global_patch_dir
|
|
||||||
|
|
||||||
This directory has the following structure:
|
|
||||||
|
|
||||||
package-name
|
|
||||||
00001-do-something.patch
|
|
||||||
42
kernel_module/README.adoc
Normal file
42
kernel_module/README.adoc
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
= kernel_module
|
||||||
|
|
||||||
|
. link:module_init.c[]
|
||||||
|
. Debugging
|
||||||
|
.. link:hello.c[]
|
||||||
|
.. link:hello2.c[]
|
||||||
|
.. link:panic.c[]
|
||||||
|
. Module utils
|
||||||
|
.. link:params.c[]
|
||||||
|
.. link:vermagic.c[]
|
||||||
|
.. link:vermagic_fail.c[]
|
||||||
|
.. link:module_version.c[]
|
||||||
|
. Pseudo filesystems
|
||||||
|
.. link:debugfs.c[]
|
||||||
|
.. link:procfs.c[]
|
||||||
|
.. link:sysfs.c[]
|
||||||
|
.. link:fops.c[]
|
||||||
|
.. link:ioctl.c[]
|
||||||
|
.. link:poll.c[]
|
||||||
|
.. link:mmap.c[]
|
||||||
|
.. link:anonymous_inode.c[]
|
||||||
|
.. link:seq_file.c[]
|
||||||
|
.. link:seq_file_inode.c[]
|
||||||
|
. Asynchronous
|
||||||
|
.. link:workqueue_cheat.c[]
|
||||||
|
.. link:sleep.c[]
|
||||||
|
.. link:kthread.c[]
|
||||||
|
.. link:kthreads.c[]
|
||||||
|
.. link:schedule.c[]
|
||||||
|
.. link:timer.c[]
|
||||||
|
.. link:work_from_work.c[]
|
||||||
|
.. link:irq.c[]
|
||||||
|
. Module dependencies
|
||||||
|
.. link:dep.c[]
|
||||||
|
.. link:dep2.c[]
|
||||||
|
.. link:character_device.c[]
|
||||||
|
.. link:character_device_create.c[]
|
||||||
|
.. link:virt_to_phys.c[]
|
||||||
|
. Hardware device drivers
|
||||||
|
.. link:pci_min.c[]
|
||||||
|
.. link:pci.c[]
|
||||||
|
.. link:platform_device.c[]
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
# Kernel module
|
|
||||||
|
|
||||||
1. [module_init](module_init.c)
|
|
||||||
1. Debugging
|
|
||||||
1. [hello](hello.c)
|
|
||||||
1. [hello2](hello2.c)
|
|
||||||
1. [panic](panic.c)
|
|
||||||
1. Module utils
|
|
||||||
1. [params](params.c)
|
|
||||||
1. [vermagic](vermagic.c)
|
|
||||||
1. [vermagic_fail](vermagic_fail.c)
|
|
||||||
1. [module_version](module_version.c)
|
|
||||||
1. Pseudo filesystems
|
|
||||||
1. [debugfs](debugfs.c)
|
|
||||||
1. [procfs](procfs.c)
|
|
||||||
1. [sysfs](sysfs.c)
|
|
||||||
1. [fops](fops.c)
|
|
||||||
1. [ioctl](ioctl.c)
|
|
||||||
1. [poll](poll.c)
|
|
||||||
1. [mmap](mmap.c)
|
|
||||||
1. [anonymous_inode](anonymous_inode.c)
|
|
||||||
1. [seq_file](seq_file.c)
|
|
||||||
1. [seq_file_single](seq_file_inode.c)
|
|
||||||
1. Asynchronous
|
|
||||||
1. [workqueue_cheat](workqueue_cheat.c)
|
|
||||||
1. [sleep](sleep.c)
|
|
||||||
1. [kthread](kthread.c)
|
|
||||||
1. [kthreads](kthreads.c)
|
|
||||||
1. [schedule](schedule.c)
|
|
||||||
1. [timer](timer.c)
|
|
||||||
1. [work_from_work](work_from_work.c)
|
|
||||||
1. [irq](irq.c)
|
|
||||||
1. Module dependencies
|
|
||||||
1. [dep](dep.c)
|
|
||||||
1. [dep2](dep2.c)
|
|
||||||
1. [character_device](character_device.c)
|
|
||||||
1. [character_device_create](character_device_create.c)
|
|
||||||
1. [virt_to_phys](virt_to_phys.c)
|
|
||||||
1. Hardware device drivers
|
|
||||||
1. [pci_min](pci_min.c)
|
|
||||||
1. [pci](pci.c)
|
|
||||||
1. [platform_device](platform_device.c)
|
|
||||||
26
kernel_module/user/README.adoc
Normal file
26
kernel_module/user/README.adoc
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
= user
|
||||||
|
|
||||||
|
Userland C programs used to test our kernel modules.
|
||||||
|
|
||||||
|
`sh` programs are simpler, and installed by copying directly with an overlay.
|
||||||
|
|
||||||
|
C programs require cross compiling, but give us more control over system calls.
|
||||||
|
|
||||||
|
These programs can also be compiled and used on host.
|
||||||
|
|
||||||
|
. Standalone
|
||||||
|
.. link:hello.c[]
|
||||||
|
.. link:myinsmod.c[]
|
||||||
|
.. link:myrmmod.c[]
|
||||||
|
.. link:usermem.c[]
|
||||||
|
... link:pagemap_dump.c[]
|
||||||
|
.. inits
|
||||||
|
.... link:sleep_forever.c[]
|
||||||
|
.... link:poweroff.c[]
|
||||||
|
.... link:init_dev_kmsg.c[]
|
||||||
|
.. link:uio_read.c[]
|
||||||
|
.. link:rand_check.c[]
|
||||||
|
. Module tests
|
||||||
|
.. link:anonymous_inode.c[]
|
||||||
|
.. link:poll.c[]
|
||||||
|
.. link:ioctl.c[]
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
# User
|
|
||||||
|
|
||||||
Userland C programs used to test our kernel modules.
|
|
||||||
|
|
||||||
`sh` programs are simpler, and installed by copying directly with an overlay.
|
|
||||||
|
|
||||||
C programs require cross compiling, but give us more control over system calls.
|
|
||||||
|
|
||||||
These programs can also be compiled and used on host.
|
|
||||||
|
|
||||||
1. Standalone
|
|
||||||
1. [hello](hello.c)
|
|
||||||
1. [myinsmod](myinsmod.c)
|
|
||||||
1. [myrmmod](myrmmod.c)
|
|
||||||
1. [usermem](usermem.c)
|
|
||||||
1. [pagemap_dump](pagemap_dump.c)
|
|
||||||
1. inits
|
|
||||||
1. [sleep_forever](sleep_forever.c)
|
|
||||||
1. [poweroff](poweroff.c)
|
|
||||||
1. [init_dev_kmsg](init_dev_kmsg.c)
|
|
||||||
1. [uio_read](uio_read.c)
|
|
||||||
1. [rand_check](rand_check.c)
|
|
||||||
1. Module tests
|
|
||||||
1. [anonymous_inode](anonymous_inode.c)
|
|
||||||
1. [poll](poll.c)
|
|
||||||
1. [ioctl](ioctl.c)
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
# rootfs_overlay
|
= rootfs_overlay
|
||||||
|
|
||||||
This directory copied into the target filesystem.
|
This directory copied into the target filesystem.
|
||||||
|
|
||||||
We use it to for things like:
|
We use it to for things like:
|
||||||
|
|
||||||
- customized configuration files
|
* customized configuration files
|
||||||
- userland module test scripts
|
* userland module test scripts
|
||||||
Reference in New Issue
Block a user