If possible, can you point to documentation or describe the kernel space memory layout?
When a device driver instantiates a variable does that variable live in the kernel space or does it live in user space with special permissions?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
The kernel space memory layout is documented in the kernel, for x86_64 at least. On many architectures, this includes a direct physical mapping, with a fixed offset which doesn’t vary over one kernel instance’s lifetime. Since the kernel code runs on the CPU, using the MMU (on MMU-equipped architectures), all the addresses referenced by running code (for variable pointers, stacks etc.) are addresses understandable by the MMU, i.e. virtual addresses, normally allocated outside the direct physical mapping.
Variables in device drivers are mapped in kernel space by default. A device driver can also make data available from user space, in a variety of ways —
procfs, mapped to user space in the vDSO...