STRUCT RISCV_IMAGE_HEADER(9)
πΈ struct riscv_image_header(9) πΈ
okay so bestie, welcome to the Kernel API Manual β we're doing the RISC-V corner of the kernel today and honestly? it's giving iconic. this is struct riscv_image_header, aka the riscv kernel image header, and it's lowkey the first thing anyone reads when they wanna know what's inside a RISC-V kernel image. main character energy fr fr π
β¨ NAME β¨
struct riscv_image_header β the riscv kernel image header. that's it, that's the vibe π
π¦ SYNOPSIS π¦
no cap, here's the whole thing, character for character, don't touch it:
struct riscv_image_header {
u32 code0;
u32 code1;
u64 text_offset;
u64 image_size;
u64 flags;
u32 version;
u32 res1;
u64 res2;
u64 magic;
u32 magic2;
u32 res3;
};
likeβ¦ look at her. all those fields. so organized. we stan a well-structured struct π
π Members π
time for the member-by-member breakdown, pls pay attention bestie:
code0β Executable code πcode1β Executable code π (yes, again β twins, periodt)text_offsetβ Image load offset (little endian)image_sizeβ Effective Image size (little endian)flagsβ kernel flags (little endian)versionβ versionres1β reserved πres2β reserved πmagicβ Magic number (RISC-V specific; deprecated) β οΈ deprecated, bestie β noted, not ignoredmagic2β Magic number 2 (to match the ARM64'magic'field pos)res3β reserved (will be used for PE COFF offset)
ngl the three "reserved" fields are just seat-warmers sitting there looking pretty, and res3 has a whole future career lined up as a PE COFF offset. we love a glow-up in progress π
π§ Description π§
okay so the whole intention here β and this is the important bit β is for this header format to be shared between multiple architectures, specifically so we don't get a whole proliferation of image header formats. one header, many archs, no chaos. slay π β¨
π SEE ALSO π
- Kernel file
./arch/riscv/include/asm/image.hβ go read the actual header, it's right there, iykyk π«Ά
and that's the tea, bestie π this lil page came to you straight from the Kernel API Manual, filed under ./arch/riscv/include/asm, and it's dated October 2026 β so mark your calendar, screenshot it, send it to the group chat, whatever you gotta do. you understood it, you ate, periodt πππ¦β
π¦ 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