Why does Linux favor 0x7f mappings?

First and foremost, assuming that you are talking about x86-64, we can see that the virtual memory map for x86-64 is: ======================================================================================================================== Start addr | Offset | End addr | Size | VM area description ======================================================================================================================== | | | | 0000000000000000 | 0 | 00007fffffffffff | 128 TB | user-space virtual memory, different per mm … Read more

Why does the stack address grow towards decreasing memory addresses?

First, it’s platform dependent. In some architectures, stack is allocated from the bottom of the address space and grows upwards. Assuming an architecture like x86 that stack grown downwards from the top of address space, the idea is pretty simple: =============== Highest Address (e.g. 0xFFFF) | | | STACK | | | |————-| <- Stack … Read more

What are the differences between virtual memory and physical memory?

Softwares run on the OS on a very simple premise – they require memory. The device OS provides it in the form of RAM. The amount of memory required may vary – some softwares need huge memory, some require paltry memory. Most (if not all) users run multiple applications on the OS simultaneously, and given … Read more