]> git.feebdaed.xyz Git - linuxyz.git/commitdiff
update kchr store
authorseantywork <seantywork@gmail.com>
Fri, 7 Nov 2025 03:44:42 +0000 (03:44 +0000)
committerseantywork <seantywork@gmail.com>
Fri, 7 Nov 2025 03:44:42 +0000 (03:44 +0000)
kchr-store/2025-1105.xyz.md

index 18974655483bfda345d7842e14313678e05006b7..f4002466cdda91acfc1c58f650f2a1b04fdb726a 100644 (file)
@@ -37,22 +37,30 @@ static struct file_operations fops = {
 };
 ```
 
-#
+# build kernel module and user prog
+
+```shell
+$ make
+$ cd ./user && make
+
+```
+
+# create character device script
 ```shell
 
-thy@ubuntu24-server:~/linuxyz/kchr-store$ sudo ./dev_create.sh 
+$ sudo ./dev_create.sh 
 dev node created
 ./user/chr_store
 ```
 
 ```shell
+# dmesg -wH
 [ +39.686846] chr_store: dev_major number: 239: init
 
 ```
-#
+# run with message
 ```shell
-thy@ubuntu24-server:~/linuxyz/kchr-store/user$ sudo ./u.out "hello from the other 
-side"
+$ sudo ./u.out "hello from the other side"
 cmd: [w/q] 
 main: file opened
 thread: failed to open: -1
@@ -61,6 +69,7 @@ thread: failed to open: -1
 ```
 
 ```shell
+# dmesg -wH
 [Nov 6 05:01] file opened: 1
 [  +1.000207] not possible to open: already occupied: 1
 [  +1.000239] not possible to open: already occupied: 1
@@ -71,7 +80,7 @@ thread: failed to open: -1
 
 ```
 
-#
+# closing without saving
 
 ```shell
 q
@@ -94,7 +103,7 @@ thread: closed file
 
 ```
 
-#
+# write to the device
 
 ```shell
 
@@ -114,7 +123,7 @@ thread: failed to open:
 
 ```
 
-#
+# to see if the other thread can read from device
 
 ```shell
 q
@@ -146,10 +155,10 @@ thread: closed file
 
 ```
 
-#
+# close file
 
 ```shell
-thy@ubuntu24-server:~/linuxyz/kchr-store$ sudo ./dev_destroy.sh 
+$ sudo ./dev_destroy.sh 
 dev node destroyed
 
 ```