setup_physmem(9)
β¨ setup_physmem(9) β¨
okay bestie, welcome to the Kernel API Manual β this one's a kernel-level function from the UML (User-Mode Linux) world, so grab a lil snack and let's get into it π«Ά
πΈ NAME πΈ
setup_physmem β the function that sets up physical memory for UML, no cap π
π¦ SYNOPSIS π¦
void setup_physmem (unsigned long start , unsigned long reserve_end ,
unsigned long len );
π ARGUMENTS π
startβ the start address of the physical kernel memory, aka the start address of the executable image. literally where it all begins β¨reserve_endβ the end address of the physical kernel memory. that's a wrap π¬lenβ the length of total physical memory that should be mapped/made available, in bytes. yes, bytes. all of them π
π DESCRIPTION π
So here's the tea, bestie: this function creates an unlinked temporary file of size (len) and memory maps it on the last executable image address (uml_reserved). iconic behavior honestly π§
The offset is needed because the length of the total physical memory (len) includes the size of the memory used by the executable image β but the mapped-to address is the last address of the executable image (where uml_reserved == end address of executable image). it's giving "accounting for the overlap" and it ate π
The memory mapped memory of the temporary file is used as backing memory of all user space processes/kernel tasks. so yeah, it's kind of a big deal π₯
ngl this one's lowkey doing a lot of heavy lifting behind the scenes β the temp file is the memory, fr fr β¨
π SEE ALSO π
- Kernel file
./arch/um/kernel/physmem.cβ go read the source, bestie, it's right there π
and that's the whole vibe check! this page came to you from ./arch/um/kernel, dated October 2026 β slay, periodt, go set up some physical memory πππ
π¦ 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