Giter Site home page Giter Site logo

buse's Introduction

BUSE - A block device in userspace

This piece of software was inspired by FUSE, which allows the development of Linux file systems that run in userspace. The goal of BUSE is to allow virtual block devices to run in userspace as well. Currently BUSE is experimental and should not be used for production code.

Implementing a block device with BUSE is fairly straightforward. Simply fill struct buse_operations (declared in buse.h) with function pointers that define the behavior of the block device, and set the size field to be the desired size of the device in bytes. Then call buse_main and pass it a pointer to this struct. busexmp.c is a simple example example that shows how this is done.

The implementation of BUSE itself relies on NBD, the Linux network block device, which allows a remote machine to serve requests for reads and writes to a virtual block device on the local machine. BUSE sets up an NBD server and client on the same machine, with the server executing the code defined by the BUSE user.

Running the Example Code

BUSE comes with an example driver in busexmp.c that implements a 128 MB memory disk. To try out the example code, run make and then execute the following as root:

modprobe nbd
./busexmp /dev/nbd0

You should then have an in-memory disk running, represented by the device file /dev/nbd0. You can create a file system on the virtual disk, mount it, and start reading and writing files on it:

mkfs.ext4 /dev/nbd0
mount /dev/nbd0 /mnt

buse's People

Contributors

comatose avatar

Watchers

James Cloos avatar Jiajin Yin avatar

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.