x86 Paging Tutorial / 64-bit architectures Updated +Created
64 bits is still too much address for current RAM sizes, so most architectures will use less bits.
x86_64 uses 48 bits (256 TiB), and legacy mode's PAE already allows 52-bit addresses (4 PiB). 56-bits is a likely future candidate.
12 of those 48 bits are already reserved for the offset, which leaves 36 bits.
If a 2 level approach is taken, the best split would be two 18 bit levels.
But that would mean that the page directory would have 2^18 = 256K entries, which would take too much RAM: close to a single-level paging for 32 bit architectures!
Therefore, 64 bit architectures create even further page levels, commonly 3 or 4.
x86_64 uses 4 levels in a 9 | 9 | 9 | 9 scheme, so that the upper level only takes up only 2^9 higher level entries.
The 48 bits are split equally into two disjoint parts:
----------------- FFFFFFFF FFFFFFFF
Top half
----------------- FFFF8000 00000000


Not addressable


----------------- 00007FFF FFFFFFFF
Bottom half
----------------- 00000000 00000000
A 5-level scheme is emerging in 2016: software.intel.com/sites/default/files/managed/2b/80/5-level_paging_white_paper.pdf which allows 52-bit addresses with 4k pagetables.
Malus' Law Updated +Created
Matches the quantum superposition probability proportional to the square law. Poor Étienne-Louis Malus, who died so much before this was found.
Oxford Master Course in Mathematical and Theoretical Physics Updated +Created
At least they have a fucking clear course schedule unlike the undergrad.
SQL COUNT function Updated +Created
Have a look at some interesting examples under nodejs/sequelize/raw/many_to_many.js.
University of Cambridge student culture Updated +Created
Virtuoso Universal Server Updated +Created
Khan Academy Updated +Created
Kudos for being a not-for-profit. Also, anyone can create content: e-learning websites must allow students to create learning content. Oh, but TODO is possible for anyone to make content publicly visible? Course join links lik: www.khanacademy.org/join/MJZ6NSV7 require login. webapps.stackexchange.com/questions/165132/how-to-create-a-course-that-is-publicly-visible-without-the-need-to-login-on-kha If that's the case, it is a fatal flaw not shared by OurBigBook.com.
Another cool aspect is that they have the "physical world teacher pull student accounts in" approach built-in quite well at course creation. This is a very good feature.
As of 2021 they were a bit struggling for money it seems: www.youtube.com/watch?v=I8XdUy-wyyM?
Kilogram Updated +Created
Unit of mass.
Defined in the 2019 redefinition of the SI base units via the Planck constant. This was possible due to the development of the Kibble balance.
NuNET Updated +Created
Relativistic particle in a box thought experiment Updated +Created
Described for example in lecture 1.
SQL genenerate_series Updated +Created
SQL transaction isolation level Updated +Created
Each transaction isolation level specifies what can or cannot happen when two queries are being run in parallel, i.e.: the memory semantics of the system.
Remember that queries can affects thousands of rows, and database systems like PostgreSQL can run multiple such queries at the same time.
Type-II superconductor Updated +Created
Figure 1.
Sketch of the typical superconducting phase diagram of a Type-II superconductor
. Source.
Particle decay Updated +Created
Can produce two entangled particles.
x86 Paging Tutorial / Application Updated +Created
Paging makes it easier to compile and run two programs or threads at the same time on a single computer.
For example, when you compile two programs, the compiler does not know if they are going to be running at the same time or not.
So nothing prevents it from using the same RAM address, say, 0x1234, to store a global variable.
And thread stacks, that must be contiguous and keep growing down until they overwrite each other, are an even bigger issue!
But if two programs use the same address and run at the same time, this is obviously going to break them!
Paging solves this problem beautifully by adding one degree of indirection:
(logical) ------------> (physical)
             paging
Where:
  • logical addresses are what userland programs see, e.g. the contents of rsi in mov eax, [rsi].
    They are often called "virtual" addresses as well.
  • physical addresses can be though of the values that go to physical RAM index wires.
    But keep in mind that this is not 100% true because of further indirections such as:
Compilers don't need to worry about other programs: they just use simple logical addresses.
As far as programs are concerned, they think they can use any address between 0 and 4 GiB (2^32, FFFFFFFF) on 32-bit systems.
The OS then sets up paging so that identical logical addresses will go into different physical addresses and not overwrite each other.
This makes it much simpler to compile programs and run them at the same time.
Paging achieves that goal, and in addition:
  • the switch between programs is very fast, because it is implemented by hardware
  • the memory of both programs can grow and shrink as needed without too much fragmentation
  • one program can never access the memory of another program, even if it wanted to.
    This is good both for security, and to prevent bugs in one program from crashing other programs.
Or if you like non-funny jokes:
Figure 1.
Comparison between the Linux kernel userland memory virtualization and The Matrix
. Source. Is this RAM real?
x86 Paging Tutorial / ARM Updated +Created
x86 Paging Tutorial / Basic TLB operation Updated +Created
After a translation between linear and physical address happens, it is stored on the TLB. For example, a 4 entry TLB starts in the following state:
  valid  linear  physical
  -----  ------  --------
> 0      00000   00000
  0      00000   00000
  0      00000   00000
  0      00000   00000
The > indicates the current entry to be replaced.
And after a page linear address 00003 is translated to a physical address 00005, the TLB becomes:
  valid  linear  physical
  -----  ------  --------
  1      00003   00005
> 0      00000   00000
  0      00000   00000
  0      00000   00000
and after a second translation of 00007 to 00009 it becomes:
  valid  linear  physical
  -----  ------  --------
  1      00003   00005
  1      00007   00009
> 0      00000   00000
  0      00000   00000
Now if 00003 needs to be translated again, hardware first looks up the TLB and finds out its address with a single RAM access 00003 --> 00005.
Of course, 00000 is not on the TLB since no valid entry contains 00000 as a key.

Unlisted articles are being shown, click here to show only listed articles.