1. Overview
  2. Docs
In-memory BLOCK device for MirageOS

Install

dune-project
 Dependency

Authors

Maintainers

Sources

mirage-block-ramdisk-0.6.tbz
sha256=81a40f3e923385ec304164e2b8984acddd01c496590260b305bc077e57056850
sha512=aa8aabb18c81cb6cdec404d404809faeb28be55f24f044aaca333f34ea2bbc2c064cfec3b32fef55e614a945bcd458b96d5c46067d454e188672ad6eeaa6b4b7

Description

  • Can be dynamically resized
  • Supports querying sparseness information

Tags

org:mirage

Added to opam-repository:

README

mirage-block-ramdisk

A simple in-memory BLOCK device.

Please see the API documentation.

Features

  • Can be dynamically resized
  • Supports querying sparseness information

Example usage

In a top-level like utop:

# #require "io-page.unix";;
# #require "mirage-block";;
# #require "mirage-block-ramdisk";;
# #require "lwt.syntax";;

# lwt t_or_error = Ramdisk.create ~name:"hello" ~size_sectors:1024L ~sector_size:512;;
val t_or_error : [ `Error of Ramdisk.error | `Ok of Ramdisk.t ] = `Ok <abstr>

# let t = Mirage_block.Error.ok_exn t_or_error;;
val t : Ramdisk.t = <abstr>

# let page = Io_page.(to_cstruct (get 1));;
val page : Ramdisk.page_aligned_buffer =
  {Cstruct.buffer = <abstr>; off = 0; len = 4096}

# lwt result_or_error = Ramdisk.read t 0L [ page ];;
val result_or_error : [ `Error of Ramdisk.error | `Ok of unit ] = `Ok ()

Dependencies (6)

  1. lwt
  2. mirage-block >= "2.0.0"
  3. io-page >= "2.4.0"
  4. cstruct >= "6.0.0"
  5. dune
  6. ocaml >= "4.06.0"

Dev Dependencies (3)

  1. fmt with-test & >= "0.8.7"
  2. mirage-block-combinators with-test
  3. alcotest with-test

Conflicts

None

Build status

Results of building mirage-block-ramdisk with each compiler on check.ci.ocaml.org, run of against opam-repository 7cdc698. All results for this package.

Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.

Version OCaml 4.11 OCaml 4.14 OCaml 5.2 OCaml 5.4 OCaml 5.5
0.6 (this version) good good good good good
  • good Package successfully built
  • partial One of the dependencies failed to build
  • bad Package failed to build
  • n/a Package is not available in this environment
  • internal Internal failure