2021-12-15 15:12:31 +00:00
|
|
|
(** An entry in the manifest representing a device. *)
|
2021-12-13 13:58:44 +00:00
|
|
|
type mft_entry =
|
2021-12-15 15:12:31 +00:00
|
|
|
| Dev_block_basic of string
|
|
|
|
| Dev_net_basic of string
|
2021-12-13 13:58:44 +00:00
|
|
|
|
2021-12-15 15:12:31 +00:00
|
|
|
(** The Solo5 manifest *)
|
2021-12-13 13:58:44 +00:00
|
|
|
type mft = {
|
|
|
|
version : int;
|
2021-12-15 15:12:31 +00:00
|
|
|
(** [version] is at the moment always 1. *)
|
2021-12-13 13:58:44 +00:00
|
|
|
entries : mft_entry list;
|
2021-12-15 15:12:31 +00:00
|
|
|
(** [entries] in the manifest. *)
|
2021-12-13 13:58:44 +00:00
|
|
|
}
|
|
|
|
|
2021-12-16 11:12:43 +00:00
|
|
|
(** The known solo5 targets *)
|
|
|
|
type abi_target =
|
|
|
|
| Hvt
|
|
|
|
| Spt
|
|
|
|
| Virtio
|
|
|
|
| Muen
|
|
|
|
| Genode
|
|
|
|
| Xen
|
|
|
|
|
|
|
|
(** abi taget and abi version *)
|
|
|
|
type abi = {
|
|
|
|
target : abi_target; (** abi target *)
|
|
|
|
version : int32; (** abi version *)
|
|
|
|
}
|
|
|
|
|
2021-12-13 13:58:44 +00:00
|
|
|
val pp_mft_entry : Format.formatter -> mft_entry -> unit
|
|
|
|
val pp_mft : Format.formatter -> mft -> unit
|
2021-12-15 15:12:31 +00:00
|
|
|
(** Pretty-prints the manifest as JSON in a similar style as the Solo5 command
|
|
|
|
* line tool {[solo5-elftool query-manifest]}. *)
|
2021-12-13 13:58:44 +00:00
|
|
|
|
2021-12-16 11:12:43 +00:00
|
|
|
val pp_abi_target : Format.formatter -> abi_target -> unit
|
|
|
|
val pp_abi : Format.formatter -> abi -> unit
|
|
|
|
(** Pretty-prints the manifest as JSON in a similar style as the Solo5 command
|
|
|
|
* line tool {[solo5-elftool query-abi]}. *)
|
|
|
|
|
2021-12-13 13:58:44 +00:00
|
|
|
val query_manifest : Owee_buf.t -> (mft, [> `Msg of string ]) result
|
2021-12-15 15:12:31 +00:00
|
|
|
(** [query_manifest buf] is the solo5 manifest of [buf], or an error message.
|
2021-12-16 11:12:43 +00:00
|
|
|
|
|
|
|
@raise Owee_buf.Invalid_format if [buf] is not valid ELF format *)
|
|
|
|
|
|
|
|
val query_abi : Owee_buf.t -> (abi, [> `Msg of string ]) result
|
|
|
|
(** [query_abi buf] is the solo5 abi of [buf], or an error message.
|
|
|
|
|
|
|
|
@raise Owee_buf.Invalid_format if [buf] is not valid ELF format *)
|