Skip to content

rikyoz/LinuxMailslotsModule

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Linux Mailslots Module

Windows mailslots for the Linux kernel

GitHub release MSVC version Architectures License

FeaturesBuildingUsageLicense

This project provides a simple and easy to use Linux kernel module implementing a service similar to Windows mailslots, i.e. a driver for special device files accessible according to FIFO policy.

Developed for the course of Advanced Operating Systems and Virtualization (AOSV) taken in the A.Y. 2016/2017 for the Master Degree in Engineering in Computer Science (MSE-CS) at Sapienza University of Rome. The original project specification can be found here.

Features

The module is a Linux driver for special device files supporting the following features:

  • FIFO (First In First Out) access policy semantic (via open/close/read/write services).
  • Atomic message read/write, i.e. any segment read from or written to the file stream is seen as an independent data unit, a message, and it is posted/delivered atomically (all or nothing).
  • Support to multiple instances accessible concurrently by active processes/threads.
  • Blocking/Non-Blocking runtime behaviour of I/O sessions (tunable via open or ioctl commands)
  • Runtime configuration (via ioctl) of the following parameters:
    • Maximum message size (configurable up to an absolute upper limit).
    • Maximum mailslot storage size which is dynamically reserved to any individual mailslot.
  • Compile-time configuration of the following parameters:
    • Range of device file minor numbers supported by the driver (default: [0-255]).
    • Number of mailslot instances (default: 256).

Building

The project provides a Makefile and can be compiled using the make command line utility.

Usage

Once built, the module can be manually installed using the insmod mailslot.ko command (or via the install.sh utility shell script, which installs the module and creates also 3 mailslots files in the /dev/ directory). Mailslot files can be created using the mknod command (for example usages, please see the install.sh script),

In order to uninstall the module, the rmmod mailslot command must be used, as well as mailslot files can be removed using the rm command (if the installation script was used, the module can also be uninstalled using the provided uninstall.sh shell script, which removes also the 3 mailslots files created during the installation).

License (GPL v2)

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Copyright © 2017 - 2018 Riccardo Ostani (@rikyoz)