Skip to content

File Driver to create a device /dev/one like the /dev/zero

Notifications You must be signed in to change notification settings

tinmarino/dev_one

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

File Driver to create a device /dev/one like the /dev/zero

QuickStart

When installed, running:

cat /dev/one | hexdump -v

Prints:

0000000 ffff ffff ffff ffff ffff ffff ffff ffff

Install

Download file and generate keys

git clone https://github.com/tinmarino/dev_one.git DevOne && cd DevOne  # 1/ Download
sudo make key     # 2 Generate key for signing
sudo reboot now   # 3 Reboot and enable Mok
  # 1. A blue screen (MOK manager) will appear
  # 2. Choose "Enroll MOK"
  # 3. Choose "Continue"
  # 4. Choose "Yes" (when asked "Enroll the key")
  # 5. Enter the password you gave at make sign
  # 6. Choose "Reboot" (again)

Install module in system

sudo make full

In case you want a fast development life cycle, here is how to load module once

make build        # 4 Compile
sudo make sign    # 5 Sign driver module to permit MOK enforcement (security)
sudo make user_load    # 6 Load
sudo make user_create  # 7 Create /dev/one
make test         # 8 Test if all is ok

As usual, to clean your work, run sudo make clean

Util

# Installed modules, see #7
lsmod  # List modules
sudo modprobe one  # Load one driver => creates /dev/one
sudo depmod  # Re-create the module dependency list
sudo modprobe -r one  # Load one driver => removes /dev/one

# Keys
sudo mokutil --list-new  # List key that will be added at boot
sudo mokutil --reset  # Delete future keys
sudo cat /proc/keys  # View your installed keys
dmesg -wH  # Kernel log like tail -f

Source

Licence

This project, DevOne, is licensed under the GPL v2.0 or later Copyright © 2020-2022 Martin Tourneboeuf (https://tinmarino.github.io)

About

File Driver to create a device /dev/one like the /dev/zero

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published