KVM_KERNDISP(3)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

🌸 NAME 🌸

Okay bestie, this is the kvm_kerndisp(3) page from the Library Functions Manual, and the name is literally kvm_kerndisp β€” get kernel displacement. That’s the whole assignment. πŸ’…

πŸ¦‹ LIBRARY πŸ¦‹

This one lives in the Kernel Data Access Library (libkvm, -lkvm). Iconic. ✨

✨ SYNOPSIS ✨

#include <kvm.h>

kssize_t
kvm_kerndisp(kvm_t *kd);

πŸ’… DESCRIPTION πŸ’…

Okay so kvm_kerndisp() returns the number of bytes by which the kernel referenced by kd is displaced. No cap, that’s the whole thing.

It’s the difference between the kernel’s base virtual address at run time and the kernel base virtual address specified in the kernel image file. Very β€œspot the difference” of it all. 🫢

Note, bestie: if the kernel is moved to a lower memory address, the displacement will be negative. Yes, negative. Not a typo. 😭

πŸ‘‘ RETURN VALUES πŸ‘‘

kvm_kerndisp() returns the number of bytes by which the kernel is displaced.

If the kernel is not displaced, or if it is not possible to find the displacement, then 0 is returned. Simple as that, periodt. πŸ’–

🌈 SEE ALSO 🌈


mwah πŸ’‹ this page is from Debian, dated February 5, 2020 β€” that’s the source/version and date, bestie, and we are not skipping the receipts. πŸŽ€

πŸ“¦ where this page comes from