package mbr-format

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
module Geometry : sig ... end
module Partition : sig ... end
type t = private {
  1. bootstrap_code : string;
  2. original_physical_drive : int;
  3. seconds : int;
  4. minutes : int;
  5. hours : int;
  6. disk_signature : int32;
  7. partitions : Partition.t list;
}
val make : Partition.t list -> (t, string) Stdlib.result

make partitions constructs an MBR given a desired list of primary partitions. An Error _ is returned if:

  • The number of partitions exceeds four,
  • Any of the partitions overlap with each other or the first sector,
  • More than one partition is marked as active (bootable).
val marshal : Cstruct.t -> t -> unit
val unmarshal : Cstruct.t -> (t, string) Stdlib.result
val sizeof : int

sizeof is the size of a master boot record in bytes (512 bytes)

val default_partition_start : int32

default sector offset for first partition