Lesson 07#101
Open
megaparanoik wants to merge 6 commits into
Open
Conversation
Signed-off-by: alex <eelleekk@gmail.com>
Signed-off-by: alex <eelleekk@gmail.com>
Signed-off-by: alex <eelleekk@gmail.com>
Signed-off-by: alex <eelleekk@gmail.com>
Signed-off-by: Androsov Aleksandr <eelleekk@gmail.com>
Signed-off-by: Androsov Aleksandr <eelleekk@gmail.com>
562bc35 to
b42a20f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added a sysfs module code based on sysfs module from Lesson 05.
To build the module you should first export the BUILD_KERNEL environment variable, that points to a kernel directory.
The sysfs module creates own class case_converter in /sys/class
The class includes such attributes: alphabetic, converted, numeric, processed, used which give the work statistic of the module.
The buffer attribute is an RW exchange buffer.
The module provides different memory management models, a certain model is selected using the "mode" param while the module loaded.
mode=0 (1st item Readme.) - Slab memory allocator with a single slab-buffer, which allocates at writing into the buffer attribute and releases at reading from the buffer attribute.
mode=1 (2nd item Readme) - Slab memory allocator with multiplay slab-buffers, which allocated at each writing into the buffer attribute and released at unloading the module.
mode=2 (3rd item Readme) - Memory pool with predefined reserved buffers based on slab allocator. All module functionality corresponds to mode=1
mode=3 (4th item Readme) - Memory pool with resizable buffers based on slab allocator.