GithubHelp home page GithubHelp logo

matt-merman / aos Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.88 MB

A Linux device driver implementing low and high priority flows of data

Makefile 1.51% C 64.66% Python 0.94% TeX 32.89%
driver kernel-driver kernel-module linux c

aos's Introduction

Multi-flow device file

Specification

This specification is related to a Linux device driver implementing low and high priority flows of data. Through an open session to the device file a thread can read/write data segments. The data delivery follows a First-in-First-out policy along each of the two different data flows (low and high priority). After read operations, the read data disappear from the flow. Also, the high priority data flow must offer synchronous write operations while the low priority data flow must offer an asynchronous execution (based on delayed work) of write operations, while still keeping the interface able to synchronously notify the outcome. Read operations are all executed synchronously. The device driver should support 128 devices corresponding to the same amount of minor numbers. The device driver should implement the support for the ioctl(..) service in order to manage the I/O session as follows:

  • setup of the priority level (high or low) for the operations
  • blocking vs non-blocking read and write operations
  • setup of a timeout regulating the awake of blocking operations

A few Linux module parameters and functions should be implemented in order to enable or disable the device file, in terms of a specific minor number. If it is disabled, any attempt to open a session should fail (but already open sessions will be still managed). Further additional parameters exposed via VFS should provide a picture of the current state of the device according to the following information:

  • enabled or disabled
  • number of bytes currently present in the two flows (high vs low priority)
  • number of threads currently waiting for data along the two flows (high vs low priority)

Running

#Compile kernel module (on /multi_flow/code/)
make all

#Clean objects file
make clean

#Insertion kernel module
sudo insmod multi_flow.ko

#Remove kernel module
sudo rmmod multi_flow.ko

#Compile user (on /multi_flow/code/user/)
make

#Run user 
sudo ./user /dev/test 240 1

#Show kernel module's parameters (i.e. enabled_device, hp_bytes, lp_bytes, hp_threads, lp_threads)
make show-device
make show-hp_bytes
make show-lp_bytes
make show-hp_threads
make show-lp_threads

#Disable a list of devices by index (file in /code/user/)
sudo python3 script.py 1 2 45 127

NOTICE: 240 identifies the major number for the driver. It could be different for each insertion. To see your, use dmesg command.

Implementation

Please see report.

aos's People

Contributors

matt-merman avatar

Watchers

 avatar

aos's Issues

Add pointer to the last memory_node

Description

Do not scan throughout the linked list in the write() procedure (file write.h). Instead, add a memory_node field to object_state pointers to the last node. In this way, the time to scan operation is enhanced.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.