hl_get_preboot_major_minor(9)
π hl_get_preboot_major_minor(9) β Kernel API Manual, bestie edition β¨
okay so this is a kernel API manual page, and honestly? it's a little cutie. it lives in the 9 section (kernel API, iykyk), and it's all about reading the firmware's version number out of a string. let's get into it π
πΈ NAME πΈ
hl_get_preboot_major_minor β pull the FW's version major and minor out of the version string. that's it, that's the whole job, and it does it immaculately π
β¨ SYNOPSIS β¨
int hl_get_preboot_major_minor (struct hl_device *hdev , char
*preboot_ver );
yes the signature is literally that. int going in, int coming out, two args, no cap. π¦
π«Ά ARGUMENTS π«Ά
hdevβ pointer to thehl_device. your main character struct, fr fr. it's where the extracted version numbers get stashed.preboot_verβ the FW's version string. the raw text we're about to dissect. π₯
π DESCRIPTION π
so preboot_ver is expected to be in the format <major>.<minor>.<sub minor>*, like for example:
42.0.1-sec-3
look at that. iconic. π
the extracted version gets set into the hdev fields: fw_inner_{major/minor}_ver. so yeah, after this runs, your device struct is holding the major and minor, all cozy in there. periodt. π
lowkey important: that format is expected, and the*on the end of<sub minor>*means there can be extra stuff trailing after the sub minor β like that-sec-3in the example. don't come at it with a naked42.0and expect the world, okay? π
β RETURN β
0on success β slay, we're done here π- negative error code for failure β not slay, something went sideways π
π SEE ALSO π
the kernel file where the magic happens:
./drivers/accel/habanalabs/common/firmware_if.c
and a whole friend group of related functions, all listed here because we do not skip anybody in this house π«Ά:
hl_fw_version_cmp(9)extract_u32_until_given_char(9)hl_get_sw_major_minor_subminor(9)hl_release_firmware(9)hl_fw_copy_fw_to_device(9)hl_fw_copy_msg_to_device(9)hl_fw_load_fw_to_device(9)hl_fw_send_cpu_message(9)hl_fw_preboot_update_state(9)hl_fw_dynamic_report_error_status(9)hl_fw_dynamic_send_cmd(9)hl_fw_dynamic_extract_fw_response(9)hl_fw_dynamic_wait_for_status(9)hl_fw_dynamic_send_clear_cmd(9)hl_fw_dynamic_send_protocol_cmd(9)hl_fw_compat_crc32(9)hl_fw_dynamic_validate_memory_bound(9)hl_fw_dynamic_validate_descriptor(9)hl_fw_dynamic_read_and_validate_descriptor(9)hl_fw_dynamic_request_descriptor(9)hl_fw_dynamic_read_device_fw_version(9)hl_fw_dynamic_copy_image(9)hl_fw_dynamic_copy_msg(9)hl_fw_boot_fit_update_state(9)hl_fw_dynamic_load_image(9)hl_fw_linux_update_state(9)hl_fw_dynamic_send_msg(9)hl_fw_dynamic_init_cpu(9)hl_fw_static_init_cpu(9)hl_fw_init_cpu(9)
like, the whole firmware squad showed up. obsessed. π
and that's the page!! this one came out of ./drivers/accel/habanalabs/common, dated October 2026, and it's filed as hl_get_preboot_major_minor(9). go forth and parse those version strings, bestie πΈπ¦β¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms