package mbr-format

All checked builds pass
  1. Overview
  2. Docs
A simple library for manipulating Master Boot Records

Install

dune-project
 Dependency

Authors

Maintainers

Sources

mbr-format-2.0.0.tbz
sha256=af317bbdba9e7a3c10c36216a711937e02fb44b4f107cf68372315e7544bbf50
sha512=881cc5a77882e21006d4c25f0375a97e08c8f13faadc434c88020ac705245ed114dbc33945530553a416a051e31066ad009b115e002489dadda7b05e68a7c7c8

Description

Added to opam-repository:

README

ocaml-mbr

A simple library for manipulating Master Boot Records. The primary purposes of this library are:

  1. to create bootable disk images creating mirage kernels
  2. for mirage kernels to read the partition tables on attached disks

Usage

Define a single partition as follows:

    let disk_length_bytes = Int32.(mul (mul 16l 1024l) 1024l) in
    let disk_length_sectors = Int32.(div disk_length_bytes 512l) in

    let start_sector = 2048l in
    let length_sectors = Int32.sub disk_length_sectors start_sector in
    let partition = Mbr.Partition.make ~active:true ~ty:6 start_sector length_sectors in
    let mbr = Mbr.make [ partition ] in

You can write the MBR to sector zero of a block device B as follows:

    B.connect id >>= fun device ->
    let sector = Cstruct.create 512 in
    Mbr.marshal sector mbr;
    B.write device 0L [ sector ] >>= fun () ->
    ...

To do items

  • Implement tools to manipulate MBR-formatted disk images to construct, inspect or fill partitions that can later be used in Mirage unikernels.

Dependencies (3)

  1. cstruct >= "6.0.0"
  2. dune >= "3.4.0"
  3. ocaml >= "4.08.0"

Dev Dependencies (3)

  1. alcotest with-test
  2. fmt with-test
  3. cstruct dev & >= "6.2.0"

Optional Dependencies

None

Conflicts (1)

  1. result < "1.5"

Build status

Results of building mbr-format 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
2.0.0 (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