x86 Paging Tutorial / K-ary trees to the rescue Updated +Created
The algorithmically minded will have noticed that paging requires associative array (like Java Map of Python dict()) abstract data structure where:
  • the keys are linear pages addresses, thus of integer type
  • the values are physical page addresses, also of integer type
The single level paging scheme uses a simple array implementation of the associative array:
  • the keys are the array index
  • this implementation is very fast in time
  • but it is too inefficient in memory
and in C pseudo-code it looks like this:
linear_address[0]      = physical_address_0
linear_address[1]      = physical_address_1
linear_address[2]      = physical_address_2
...
linear_address[2^20-1] = physical_address_N
But there another simple associative array implementation that overcomes the memory problem: an (unbalanced) k-ary tree.
A K-ary tree, is just like a binary tree, but with K children instead of 2.
Using a K-ary tree instead of an array implementation has the following trade-offs:
  • it uses way less memory
  • it is slower since we have to de-reference extra pointers
In C-pseudo code, a 2-level K-ary tree with K = 2^10 looks like this:
level0[0] = &level1_0[0]
    level1_0[0]      = physical_address_0_0
    level1_0[1]      = physical_address_0_1
    ...
    level1_0[2^10-1] = physical_address_0_N
level0[1] = &level1_1[0]
    level1_1[0]      = physical_address_1_0
    level1_1[1]      = physical_address_1_1
    ...
    level1_1[2^10-1] = physical_address_1_N
...
level0[N] = &level1_N[0]
    level1_N[0]      = physical_address_N_0
    level1_N[1]      = physical_address_N_1
    ...
    level1_N[2^10-1] = physical_address_N_N
and we have the following arrays:
  • one directory, which has 2^10 elements. Each element contains a pointer to a page table array.
  • up to 2^10 pagetable arrays. Each one has 2^10 4 byte page entries.
and it still contains 2^10 * 2^10 = 2^20 possible keys.
K-ary trees can save up a lot of space, because if we only have one key, then we only need the following arrays:
  • one directory with 2^10 entries
  • one pagetable at directory[0] with 2^10 entries
  • all other directory[i] are marked as invalid, don't point to anything, and we don't allocate pagetable for them at all
Computer vision Updated +Created
Covariant derivative Updated +Created
A generalized definition of derivative that works on manifolds.
TODO: how does it maintain a single value even across different coordinate charts?
Del Updated +Created
Oh, and if it weren't enough, mathematicians have a separate name for the damned nabla symbol : "del" instead of "nabla".
TODO why is it called "Del"? Is is because it is an inverted uppercase delta?
Epic Stack Overflow users Updated +Created
Ciro also really likes the following users, a bit less like Gods, and bit more like friends:
Fantasy Updated +Created
Football Updated +Created
Football is a synonym for association football, can we be done with that! The word "soccer" is an aberration.
Machine learning bibliography Updated +Created
Magic: The Gathering content creator Updated +Created
Neural network Updated +Created
Player versus player Updated +Created
Bohr model Updated +Created
Was the first model to explain the Balmer series, notably linking atomic spectra to the Planck constant and therefore to other initial quantum mechanical observations.
This was one of the first major models that just said:
I give up, I can't tie this to classical physics in any way, let's just roll with it, OK?
It still treats electrons as little points spinning around the nucleus, but it makes the non-classical postulate that only certain angular momentums (and therefore energies) are allowed.
Exif Updated +Created
ExifTool Updated +Created
Expanding raisin bread model Updated +Created
Exponential function Updated +Created
Numberphile Updated +Created
Atomic nucleus Updated +Created

There are unlisted articles, also show them or only show them.