Library
Module
Module type
Parameter
Class
Class type
type t = private {
active : bool;
true means the partition is active, also known as bootable
*)first_absolute_sector_chs : Geometry.t;
the CHS address of the first data sector. This is only used by BIOSes with pre-LBA disks (< 1996). This will not be marshalled.
*)ty : int;
the advertised filesystem type
*)last_absolute_sector_chs : Geometry.t;
the CHS address of the last data sector. This is only used by BIOSes with pre-LBA disks (< 1996). This will not be marshalled.
*)first_absolute_sector_lba : int32;
the Logical Block Address (LBA) of the first data sector. This is the absolute sector offset of the first data sector.
*)sectors : int32;
the total number of sectors in the partition
*)}
a primary partition within the partition table
val sector_start : t -> int64
sector_start t
is the int64 representation of t.first_absolute_sector_lba
.
val size_sectors : t -> int64
size_sectors t
is the int64 representation of t.sectors
.
make ?active ?ty start length
creates a partition starting at sector start
and with length length
sectors. If the active flag is set then the partition will be marked as active/bootable. If partition type ty
is given then this will determine the advertised filesystem type, by default this is set to 6 (FAT16). ty
must be between 1 and 255.
make' ?active ?ty sector_start size_sectors
is make ?active ?ty
(Int64.to_int32 sector_start) (Int64.to_int32 size_sectors)
when both sector_start
and size_sectors
fit in int32. Otherwise Error _
.