Skip to content

srsly4/ramdrv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ramdrv

Linux kernel module driver for virtual RAM disk

Requirements

  • Linux Kernel 3.10+ (also headers)
  • CMake 3.0+

Compilation

At first you have to build kernel module. Make sure you had installed Linux headers before by (on Debian):

sudo apt-get install linux-headers-[VERSION]

To compile Kernel module:

cd kmod
make

Then, you have to build util library and ramctl, so in main directory:

cmake .
make

Usage

Module enabling

To enable compiled kernel module, type in the kmod directory:

sudo insmod ramdrv.ko
mknod /dev/ramdrv c 250 0

To disable module just type sudo rmmod ramdrv.

Creating ramdrive

In userprog directory type:

sudo ./ramctl create [sectors]

where sectors is your size of ramdrive (1 sector = 512 bytes).

Now you can format and mount your drive:

sudo mkdir /mnt/ramdrv
sudo mkfs -t ext2 /dev/ramdrv0
sudo mount /dev/ramdrv0 /mnt/ramdrv

And that's all, you can use your ramdrive now.

Deleting ramdrive

To delete exact ramdrive just type in userprog directory:

sudo ./ramctl delete 0

where 0 is the disk minor identifier (in this case - in ramdrv0)

About

Linux virtual RAM disk kernel module

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published