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 : ?disk_signature:int32 -> Partition.t list -> (t, string) result

make ?disk_signature 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).

The optional argument disk_signature specifies the disk signature to be written in the MBR. If disk_signature is not provided, the default value of 0l is used.

val marshal : Cstruct.t -> t -> unit
val unmarshal : Cstruct.t -> (t, string) 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

OCaml

Innovation. Community. Security.