x86 Paging Tutorial Multiple addresses translate to a single physical address by
Ciro Santilli 35 Updated 2025-04-24 +Created 1970-01-01
The same linear address can translate to different physical addresses for different processes, depending only on the value inside
cr3
.Both linear addresses
00002 000
from process 1 and 00004 000
from process 2 point to the same physical address 00003 000
. This is completely allowed by the hardware, and it is up to the operating system to handle such cases.This often in normal operation because of Copy-on-write (COW), which be explained elsewhere.
Such mappings are sometime called "aliases".
x86 Paging Tutorial Other architectures by
Ciro Santilli 35 Updated 2025-04-24 +Created 1970-01-01
Peter Cordes mentions that some architectures like MIPS leave paging almost completely in the hands of software: a TLB miss runs an OS-supplied function to walk the page tables, and insert the new mapping into the TLB. In such architectures, the OS can use whatever data structure it wants.
x86 Paging Tutorial Page table entries by
Ciro Santilli 35 Updated 2025-04-24 +Created 1970-01-01
The exact format of table entries is fixed by the hardware.
The page table is then an array of
struct
.On this simplified example, the page table entries contain only two fields:so in this example the hardware designers could have chosen the size of the page table to b
bits function
----- -----------------------------------------
20 physical address of the start of the page
1 present flag
21
instead of 32
as we've used so far.All real page table entries have other fields, notably fields to set pages to read-only for Copy-on-write. This will be explained elsewhere.
It would be impractical to align things at 21 bits since memory is addressable by bytes and not bits. Therefore, even in only 21 bits are needed in this case, hardware designers would probably choose 32 to make access faster, and just reserve bits the remaining bits for later usage. The actual value on x86 is 32 bits.
Here is a screenshot from the Intel manual image "Formats of CR3 and Paging-Structure Entries with 32-Bit Paging" showing the structure of a page table in all its glory: Figure 1. "x86 page entry format".
The fields are explained in the manual just after.
x86 Paging Tutorial Second Level Address Translation by
Ciro Santilli 35 Updated 2025-04-24 +Created 1970-01-01
Two level address translation to make OS emulation more efficient.
In x86 systems, there may actually be 2 address translation steps:like this:
- first segmentation
- then paging
(logical) ------------------> (linear) ------------> (physical)
segmentation paging
The major difference between paging and segmentation is that:
- paging splits RAM into equal sized chunks called pages
- segmentation splits memory into chunks of arbitrary sizes
This is the main advantage of paging, since equal sized chunks make things more manageable by reducing memory fragmentation problems. See also:
Paging came after segmentation historically, and largely replaced it for the implementation of virtual memory in modern OSs.
Paging has become so much more popular that support for segmentation was dropped in x86-64 in 64-bit mode, the main mode of operation for new software, where it only exists in compatibility mode, which emulates IA-32.
x86 Paging Tutorial The problem with single-level paging by
Ciro Santilli 35 Updated 2025-04-24 +Created 1970-01-01
The problem with a single-level paging scheme is that it would take up too much RAM: 4G / 4K = 1M entries per process.
If each entry is 4 bytes long, that would make 4M per process, which is too much even for a desktop computer:
ps -A | wc -l
says that I am running 244 processes right now, so that would take around 1GB of my RAM! x86 Paging Tutorial Why not a balanced tree by
Ciro Santilli 35 Updated 2025-04-24 +Created 1970-01-01
Learned readers will ask themselves: so why use an unbalanced tree instead of balanced one, which offers better asymptotic times en.wikipedia.org/wiki/Self-balancing_binary_search_tree?
fuseki.net/home/List-of-Patreon-Subs-with-Justification.html describes him well:
Homepage xahlee.org/ says:Nice Second brain vibe.
Let's see:
- LinkedIn: www.linkedin.com/in/xahlee/
- youtu.be/a6J62TwOreY?t=271 OMG he also uses a Kinesis Advantage 2 keyboard-like keyboard! Maybe there is something here after all.
- he's also a mad tutorial writer: xahlee.info/Wallpaper_dir/c4_Derivation.html#gc2.2.2.1 like Ciro's Stack Overflow
- www.patreon.com/xahlee £835.2/month from ony 27 members as of 2023, holy crap not bad!
- he was in a bad spot as of 2014: xahlee.info/emacs/misc/xah_as_good_as_dead.htmlThread: www.reddit.com/r/programming/comments/25pypq/im_about_as_good_as_dead_the_end_of_xah_lee/One is reminded of Chill and eat your bread in peace and Quote "Omar Khayyam's chill out quote". xahlee.org/PageTwo_dir/Personal_dir/xah.html autobiography is also of interest.
Rounds:
www.youtube.com/watch?v=v7iAqcFCTQQ shows their base technology:
- laser beam comes in
- input set via of optical ring resonators that form a squeezed state of light. Does not seem to rely on single photon production and detection experiments?
Xavier Niel, Iliad - Free: Je suis un casseur de monopoles by DECIDEURSTV (2011)
Source. Title translation: "I'm a hunter of monopolies".Being able to quote the right one at the right time is considered a fundamental shibboleth of the profession.
And with reason.
Amazing self-directed learning direction:
world.hey.com/gwyn/no-excuses-bc4152fb mentions that the founder was inspired by other schools: High Tech High and Expeditionary Learning.
Lots of focus on showcase student work.
The founder Gwyn ap Harri is quite dirty mouthed, which is also cool.
Ciro Santilli tried to contact them in 2021 at: twitter.com/cirosantilli/status/1448924419016036353 and on website contact form to see if we could do some project together, but no reply.
Often used as a synonym for X-ray crystallography, or to refer more specifically to the diffraction part of the experiment (exluding therefore sample preparation and data processing).
www.youtube.com/watch?v=-jIZ3bH-rAE "Illuminating biology at the nanoscale and systems scale using single-molecule and super-resolution imaging" by Xiaowei Zhuang (2017)
Our definition of fog computing: a system that uses the computational resources of individuals who volunteer their own devices, in which you give each of the volunteers part of a computational problem that you want to solve.
Pinned article: ourbigbook/introduction-to-the-ourbigbook-project
Welcome to the OurBigBook Project! Our goal is to create the perfect publishing platform for STEM subjects, and get university-level students to write the best free STEM tutorials ever.
Everyone is welcome to create an account and play with the site: ourbigbook.com/go/register. We belive that students themselves can write amazing tutorials, but teachers are welcome too. You can write about anything you want, it doesn't have to be STEM or even educational. Silly test content is very welcome and you won't be penalized in any way. Just keep it legal!
Intro to OurBigBook
. Source. We have two killer features:
- topics: topics group articles by different users with the same title, e.g. here is the topic for the "Fundamental Theorem of Calculus" ourbigbook.com/go/topic/fundamental-theorem-of-calculusArticles of different users are sorted by upvote within each article page. This feature is a bit like:
- a Wikipedia where each user can have their own version of each article
- a Q&A website like Stack Overflow, where multiple people can give their views on a given topic, and the best ones are sorted by upvote. Except you don't need to wait for someone to ask first, and any topic goes, no matter how narrow or broad
This feature makes it possible for readers to find better explanations of any topic created by other writers. And it allows writers to create an explanation in a place that readers might actually find it.Figure 1. Screenshot of the "Derivative" topic page. View it live at: ourbigbook.com/go/topic/derivativeVideo 2. OurBigBook Web topics demo. Source. - local editing: you can store all your personal knowledge base content locally in a plaintext markup format that can be edited locally and published either:This way you can be sure that even if OurBigBook.com were to go down one day (which we have no plans to do as it is quite cheap to host!), your content will still be perfectly readable as a static site.
- to OurBigBook.com to get awesome multi-user features like topics and likes
- as HTML files to a static website, which you can host yourself for free on many external providers like GitHub Pages, and remain in full control
Figure 2. You can publish local OurBigBook lightweight markup files to either OurBigBook.com or as a static website.Figure 3. Visual Studio Code extension installation.Figure 5. . You can also edit articles on the Web editor without installing anything locally. Video 3. Edit locally and publish demo. Source. This shows editing OurBigBook Markup and publishing it using the Visual Studio Code extension. - Infinitely deep tables of contents:
All our software is open source and hosted at: github.com/ourbigbook/ourbigbook
Further documentation can be found at: docs.ourbigbook.com
Feel free to reach our to us for any help or suggestions: docs.ourbigbook.com/#contact