freedombone | home server system which enables you to run
kandi X-RAY | freedombone Summary
kandi X-RAY | freedombone Summary
Once imagined as a space of liberation, the internet today is a rabble of corporate monopolies, oppressive governments and hate mobs. Much of its empowering potential has faded or been trampled. But perhaps there is a way forward. Freedombone is a home server system which enables you to run your own internet services, individually or as a household. It includes all of the things you'd expect such as email, chat, VoIP, wikis, blogs, social networks, and more. You can run Freedombone on an old laptop or single board computer. You can also run it on an onion address. Reclaim the internet, one server at a time. See the website for installation instructions and other information. It's also available via a Tor browser on
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of freedombone
freedombone Key Features
freedombone Examples and Code Snippets
Community Discussions
Trending Discussions on freedombone
QUESTION
I'm currently getting familiar with device drivers, and am reading the Linux Kernel Module Programming Manual. I coded the example in section 6.5, the char_dev.c character device driver. The manual states that, although it is not a strict contract between the user and the kernel, device files should be stores in the /dev directory. Firstly, I add the char_dev.c's object file to the makefile, creating the module char_dev.ko file. Once this is done, I save the .ko module file in the /dev directory. This is where I'm a bit lost. Previously, the simple modules I've been working with have been directly insmod'd and rmmod'd to and form the kernel in a separate directory I created. The char_dev.c device driver should, if it is opened, print out a message stating that it's already been opened N times by the user. It doesn't support any write() operations, and as far as I can tell, it's read() operation doesn't do anything besides copy the message generated from opening the device from kernel space to userspace and return how many bytes are read.
The manual states that through cat'ing /proc/devices I can view it's device file, but doing this doesn't show any char_dev device driver with any kind of major or minor number assigned.
I don't explicitly load the module into the kernel, although I assume I should, but the manual doesn't explicitly say to do this.
Any help would be greatly appreciated as this is my first time writing a / working with device drivers.
...ANSWER
Answered 2021-May-14 at 04:05You're not supposed to place your module file in /dev
; it won't do anything useful by being there. You can put it wherever you want, but certainly you do have to insmod
it. That might be an accidental omission from the manual, or they thought it was obvious enough that they didn't need to say it.
What you're supposed to create in /dev
is a new special file, aka device file, with the major and minor numbers corresponding to whatever you used in your driver's source code, or whatever was automatically assigned by the kernel. You do this with the mknod
command: sudo mknod /dev/mydevice c 123 45
, where 123, 45
are the major and minor device numbers respectively. There's some explanation of this in Section 5.6 of the Guide. (Note that the example driver in the Guide apparently doesn't look at the minor number, so it can be anything you want.)
You should then be able to do something like sudo cat /dev/mydevice
and have your driver's read
function get called.
If there are unprivileged users on this machine, use the -m
flag to mknod
to give the special file more restrictive permissions so they can't access it, e.g. mknod -m 0700 /dev/mydevice c 123 45
.
Strictly speaking you don't have to create the special file in /dev
, and you could instead do mknod /other/dir/mydevice c 123 45
, but it may cause confusion.
Depending on how your distribution manages /dev
, the /dev
filesystem may not persist across reboots, so you might have to recreate your special file on each boot. It may be managed by a daemon such as udev
, and if you're going to use your device permanently, it has config files you can edit to ensure it adds your special file on boot. That is more a system administration than a programming topic, so head over to https://unix.stackexchange.com if you want to know more.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install freedombone
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page