From b1a1d6af60cff09f294880eebec43c4152cc193f Mon Sep 17 00:00:00 2001 From: fastium Date: Wed, 1 Apr 2026 13:07:06 +0200 Subject: [PATCH] doc(lab02): start doc for ex7 --- doc/lab-01_02.typ | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/doc/lab-01_02.typ b/doc/lab-01_02.typ index 5d156ac..0941329 100644 --- a/doc/lab-01_02.typ +++ b/doc/lab-01_02.typ @@ -150,7 +150,7 @@ license: GPL description: Module skeleton author: Klagarge author: Fastium -depends: +depends: name: mymodule vermagic: 5.15.148 SMP preempt mod_unload aarch64 parm: text:charp @@ -332,13 +332,13 @@ for (int i = 0; i < elements; i++) { "temperature" = -1991 dot "register value" / 10 + 223000 $ - The chip ID can be verified in ```/proc/iomem```. - The register value of the temperature can be verified in the file: ```/sys/class/thermal/thermal_zone0/temp```. + The chip ID can be verified in ```/proc/iomem```. + The register value of the temperature can be verified in the file: ```/sys/class/thermal/thermal_zone0/temp```. The MAC address can be verified with ``` ifconfig```. ] ) -The resources are savec in a struct: +The resources are savec in a struct: ```c static struct resource* resources[3] = {[0] = 0,}; ``` @@ -384,6 +384,15 @@ Easy exercice, a thread in the kernet is a `struct task_struct*` that can be cre ] ) +This exercice make 2 threads in concurrency with wait queue. Here the queue ware declare +statically with the macro `DECLARE_WAIT_QUEUE_HEAD`. Then for this exercice we use an atomic +trigger with 2 queues. It important that the trigger is atomic or protected by mutex because +there is concurrency. The wait queues are used to wait until the trigger has changed to keep +synchronization between the threads. + +It is very important to add `kthread_should_stop()` as a condition to wake up queue, because if there is +a problem during the implementation, we cannot kill the code. + //------------------- // Exercise 8: Interrupts //-------------------