Understanding Virtual Address, Virtual Memory and Paging

Before I answer your questions (I hope I do), here are a few introductory remarks: Remarks The problem here is that “virtual memory” has two senses. “Virtual memory” as a technical term used by low-level programmers has (almost) nothing to do with “virtual memory” as explained to consumers. In the technical sense, “virtual memory” is … Read more

How does multi-level page table save memory space?

In singlelevel pagetable you need the whole table to access even a small amount of data(less memory references). i.e 2^20 pages each PTE occupying 4bytes as you assumed. Space required to access any data is 2^20 * 4bytes = 4MB Paging pages is multi-level paging.In multilevel paging it is more specific, you can with the … 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

Difference between sequential write and random write

When people talk about sequential vs random writes to a file, they’re generally drawing a distinction between writing without intermediate seeks (“sequential”), vs. a pattern of seek-write-seek-write-seek-write, etc. (“random”). The distinction is very important in traditional disk-based systems, where each disk seek will take around 10ms. Sequentially writing data to that same disk takes about … Read more

How does x86 paging work?

Version of this answer with a nice TOC and more content. I will correct any error reported. If you want to make large modifications or add a missing aspect, make them on your own answers to get well deserved rep. Minor edits can be merged directly in. Sample code Minimal example: https://github.com/cirosantilli/x86-bare-metal-examples/blob/5c672f73884a487414b3e21bd9e579c67cd77621/paging.S Like everything else … 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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)