From 7d7e971d893b6fe7353a985b64ad7e2386b293fb Mon Sep 17 00:00:00 2001 From: "ruben.otto" <ruben.otto@informatik.hs-fulda.de> Date: Fri, 14 Feb 2025 14:21:46 +0100 Subject: [PATCH] chore: add kernel communication docs --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d700e9d..affa7c9 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,13 @@ The daemon caches the data and waits until one of three conditions are met to se - A measurement with different data for a known measurement id is received If one of these conditions is met, the data is sent to the kernel module via the `data_t` struct that is defined in [`common/include/measurement.h`](common/include/measurement.h). -It contains a field for the pre-defined sender id, the count of measurements and the measurements themselves. +It contains a field for the pre-defined sender id, the count of measurements and a pointer to an array that holds the measurements. The sent data contains the latest received measurements for each measurement id. ### Kernel module +To receive data from the userspace, the kernel creates a character device under `/dev/sibyl` where the userspace daemon writes the data to. +The data that is written to the character device is a pointer to a `data_t` struct, on write the kernel copies the data the pointer points to into kernel space. + +When `data_t` is copied, it checkes if the pointer to the measurements array is not `NULL` and the count of measurements in `data_t` is not zero. +If both applies, it also copies the data from the array pointer to the kernel space. -- GitLab