Understanding the basics of the process Virtual Address Space (VAS)
A fundamental ‘rule’ of virtual memory is this: all potentially addressable memory is in a box; that is, it’s sandboxed. We think of this ‘box’ as the process image or the process VAS. Looking ‘outside’ the box is impossible.
Here, we provide only a quick overview of the process user VAS (which should be sufficient). For more details, please refer to my earlier book Hands-On System Programming with Linux.
The user VAS is divided into homogeneous memory regions called segments or, more technically, mappings (as they’re internally constructed via the mmap() system call). Figure 6.2 shows the minimal mappings (segments) that every single Linux (user space) process will have:
Figure 6.2: Linux user space process VAS
Let’s go over a quick breakdown of these segments or mappings (from the bottom up):
- Text segment:...