Name: mirage-block-ramdisk
Owner: MirageOS
Description: A simple in-memory BLOCK device
Created: 2015-11-03 12:06:51.0
Updated: 2016-11-28 19:01:59.0
Pushed: 2017-11-25 03:31:17.0
Homepage: null
Size: 33
Language: OCaml
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A simple in-memory BLOCK device.
Please see the API documentation.
In a top-level like utop:
equire "io-page.unix";;
equire "mirage-block";;
equire "mirage-block-ramdisk";;
equire "lwt.syntax";;
t t_or_error = Ramdisk.create ~name:"hello" ~size_sectors:1024L ~sector_size:512;;
t_or_error : [ `Error of Ramdisk.error | `Ok of Ramdisk.t ] = `Ok <abstr>
t t = Mirage_block.Error.ok_exn t_or_error;;
t : Ramdisk.t = <abstr>
t page = Io_page.(to_cstruct (get 1));;
page : Ramdisk.page_aligned_buffer =
struct.buffer = <abstr>; off = 0; len = 4096}
t result_or_error = Ramdisk.read t 0L [ page ];;
result_or_error : [ `Error of Ramdisk.error | `Ok of unit ] = `Ok ()