In linux kernel code, i see some sub system has used proc file to perform such userspace-kernelspace communication, and some system has used sysfs files for same concern. So i just want to know, if i am going to write new linux kernel module or driver then how to choose virtual files? If you're writing a driver or a module that is not related to stuff already exported via procfs , you should use sysfs. So kernel developer community suggest to use SYS file system which is more advance and sophisticated.
Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. How to choose between "sys' and "proc" files in linux kernel Ask Question.
Asked 5 years, 11 months ago. Active 5 years, 5 months ago. Viewed times. As per my knowledge, In Linux file system, for information communication between user space and kernel space, two kind of virtual file systems are used. Please let me know if i misunderstood anything here. This is the default value. If a system is running security-sensitive applications that were started while Exec Shield was disabled, these applications must be restarted when Exec Shield is enabled in order for Exec Shield to take effect.
Be careful when raising this value, as queued messages between processes are stored in non-swappable kernel memory. Any increase in msgmax would increase RAM requirements for the system. The default is This file can only be altered by changing the kernel source and recompiling. By default, this file is set to Linux , and this value can only be changed by changing the kernel source and recompiling. By default, the value is set to 0 , which disables automatic rebooting after a panic.
Each error message reported by the kernel has a loglevel associated with it that defines the importance of the message. The loglevel values break down in this order:. The system is unusable. Action must be taken immediately. Each of these values defines a different rule for dealing with error messages.
The first value, called the console loglevel , defines the lowest priority of messages printed to the console.
Note that, the lower the priority, the higher the loglevel number. The second value sets the default loglevel for messages without an explicit loglevel attached to them. The third value sets the lowest possible loglevel configuration for the console loglevel. The last value sets the default value for the console loglevel.
By default, this value is However, the kernel supports much larger values than this. The System Request Key allows immediate input to the kernel through simple key combinations. For example, the System Request Key can be used to immediately shut down or restart a system, sync all mounted file systems, or dump important information to the console. Replace system request code with one of the following system request codes:.
Also called Secure Access Key SAK , it is often used to verify that the login prompt is spawned from init and not a trojan copy designed to capture user names and passwords. The system is unusable after issuing this System Request Key code. This feature is most beneficial when using a development kernel or when experiencing system freezes. The System Request Key feature is considered a security risk because an unattended console provides an attacker with access to the system. For this reason, it is turned off by default.
The first field in this file, such as 3 , relates to the number of times a kernel was built from the source base. This directory contains subdirectories concerning various networking topics. By altering the files within these directories, system administrators are able to adjust the network configuration on a running system.
The most important of these files are:. The other files only provide feedback on current settings. For example, to enable the System Request Key on a running kernel, type the command:. This changes the value for sysrq from 0 off to 1 on.
To correctly send new values to them, place a space character between each value passed with the echo command, such as is done in this example:.
0コメント