doc(lab02): start doc for ex7
This commit is contained in:
@@ -150,7 +150,7 @@ license: GPL
|
||||
description: Module skeleton
|
||||
author: Klagarge <remi@heredero.ch>
|
||||
author: Fastium <fastium.pro@proton.me>
|
||||
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
|
||||
//-------------------
|
||||
|
||||
Reference in New Issue
Block a user