Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions 07_procfs/07_module_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
dmesg -c
insmod procfs_module.ko
echo "123456" > /sys/kernel/basic_struct/list
cat /sys/kernel/basic_struct/list
echo "1234567890263321564654654654679874964321356" > /sys/kernel/basic_struct/list
echo "Hello world!" > /sys/kernel/basic_struct/list
cat /sys/kernel/basic_struct/list
cat /proc/task07_module_entries/module_author
cat /proc/task07_module_entries/write_requests
cat /proc/task07_module_entries/read_requests
rmmod procfs_module.ko
dmesg
12 changes: 12 additions & 0 deletions 07_procfs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

KERNELDIR ?=/home/valenti/Development/Embedded/exercise8/build_orange_zero_image/build/linux-5.10.10/

ifneq ($(KERNELRELEASE),)
obj-m := procfs_module.o
else

all:
$(MAKE) CFLAGS_MODULE="-DDEBUG " -C $(KERNELDIR) M=$(PWD) modules
clean:
$(MAKE) -C $(KERNELDIR) M=$(PWD) clean
endif
6 changes: 6 additions & 0 deletions 07_procfs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@
* Build image for orange pi zero
* Attach console output from your development board


Reference links:
https://elixir.bootlin.com/linux/latest/source/samples/kobject/kobject-example.c#L131
https://elixir.bootlin.com/linux/latest/source/drivers/char/ds1620.c#L396
https://elixir.bootlin.com/linux/latest/source/drivers/staging/rtl8192u/r8192U_core.c#L602
https://elixir.bootlin.com/linux/latest/source/drivers/macintosh/via-pmu.c#L555
22 changes: 22 additions & 0 deletions 07_procfs/module_test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
$ sh 07_module_test.sh
[ 310.840684] ==BASIC_STRUCT==:Called list_store with count:7
[ 310.845063] ==BASIC_STRUCT==:Called list_show with copied pointer_offset:7
[ 310.845773] ==BASIC_STRUCT==:Called list_store with count:44
[ 310.845917] ==BASIC_STRUCT==:Called list_store with count:13
[ 310.850309] ==BASIC_STRUCT==:Called list_show with copied pointer_offset:64
[ 310.874785] ==BASIC_STRUCT==:Module unloaded
123456
123456
1234567890263321564654654654679874964321356
Hello world!
Module author: Valentyn Korniienko <valentyn.korniienko1@nure.ua>
Write requests: 3
Read requests: 2
[ 340.970209] ==BASIC_STRUCT==:Module ready
[ 340.971201] ==BASIC_STRUCT==:Called list_store with count:7
[ 340.975731] ==BASIC_STRUCT==:Called list_show with copied pointer_offset:7
[ 340.976451] ==BASIC_STRUCT==:Called list_store with count:44
[ 340.976597] ==BASIC_STRUCT==:Called list_store with count:13
[ 340.990634] ==BASIC_STRUCT==:Called list_show with copied pointer_offset:64
[ 341.006856] ==BASIC_STRUCT==:Module unloaded
$
Loading