get_desc(9)
π get_desc(9) β like, the segment descriptor grabber
ok so this is get_desc, and it lives in the kernel API manual (section 9 ofc, we love a manual page moment) β welcome to the group chat bestie π«Ά
β¨ NAME β¨
get_desc β literally just, obtain contents of a segment descriptor. that's the whole vibe. π
β¨ SYNOPSIS β¨
bool get_desc (struct desc_struct *out , unsigned short sel );
no cap, that's the signature. struct desc_struct *out and unsigned short sel, in that order, periodt. π
β¨ ARGUMENTS β¨
outβ the segment descriptor contents, but only on success bestie. if it worked, this is where the goods land. β¨selβ the segment selector. yeah. the selector. the little number that points at the thing. π―
β¨ DESCRIPTION β¨
okay so picture this πΈ β you hand over a segment selector, and this function gets you a pointer to the segment descriptor it corresponds to. both the global and local descriptor tables are supported, so whichever table your selector is living in, get_desc has you covered. iykyk π
then the returns, and honestly the way these are laid out is iconic in a chaotic way:
Trueon success,falseon failure. yes. abool. the synopsis literally saysbool. we love consistency. π€‘NULLon error.
β οΈ heads up: that's exactly what the page says βTrue/falsefor success/failure, andNULLon error. i'm not gonna gaslight you into thinking there's more detail than there is. that's the whole description fr fr π
β¨ SEE ALSO β¨
bestie the SEE ALSO section is long, like it is giving main character energy with how many friends it has π and they all live in the kernel file ./arch/x86/lib/insn-eval.c β go drink from that firehose, i believe in you π¦
is_string_insn(9)insn_has_rep_prefix(9)get_seg_reg_override_idx(9)check_seg_overrides(9)resolve_default_seg(9)resolve_seg_reg(9)get_segment_selector(9)get_reg_offset_16(9)insn_get_seg_base(9)get_seg_limit(9)insn_get_code_seg_params(9)insn_get_modrm_rm_off(9)insn_get_modrm_reg_off(9)insn_get_modrm_reg_ptr(9)get_seg_base_limit(9)get_eff_addr_reg(9)get_eff_addr_modrm(9)get_eff_addr_modrm_16(9)get_eff_addr_sib(9)get_addr_ref_16(9)get_addr_ref_32(9)get_addr_ref_64(9)insn_get_addr_ref(9)insn_fetch_from_user(9)insn_fetch_from_user_inatomic(9)insn_decode_from_regs(9)insn_decode_mmio(9)
that's all 29 of them, counted twice, no skips, no crumbs left behind. ate. π₯
π the sign-off π
okay that's the page!! this little icon comes from the source path ./arch/x86/lib, dated October 2026, and it's filed under get_desc(9) β so if you forget where you found it, that's your receipt bestie π§π
mwah, go read a descriptor table, you're doing amazing πβ
π¦ 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