There is something about AS in Linux(1)

AS = ADDRESS SPACE

I will try to present, in intuitive and accessible manner, the addresse space and some issues related to it.

please remember this:

Each process is assigned a physical memory region or physical address space.

At some moment, here is the physical memory layout:

physical memeory layout

But the OS with some hardware support (CPU) will offer, instead, a beautiful and neat memory illusion for each process:

For example the process A would get the illusion that it is living in the following virtual address space (logical address space) :

No alt text provided for this image
The process A "thinks" it is loaded into memory at a address 0.

But as we saw before, the processes' physical address spaces are actually :

No alt text provided for this image

Thus each process has its own virtual address space which gets mapped to physical memory by the operating system (with serious CPU help).

And now magic happens! Sorry for this over simplification:

The generic technique uses by OS ( +CPU) is called address translation: mapping the VA to PA

  • PA:=Physical address
  • VA:= Virtual Address
No alt text provided for this image

The "process table" is an important data structure at the OS's disposal. The OS allocates entry for each resident process!

Suppose process A needs update its variable x. We suppose the variable x is living at the VA address 2K ( Process A's perspective):

  • VA(x) =2K

Before updating the variable x, OS needs to translate VA to PA! it should ensure first that the virtual address of x is a legal address.

The OS with serious help from hardware will do:

No alt text provided for this image

What if the VA(x) is out of the range [0K, 4K]?:

The OS will be offended by the process A, and would consider the access as illegal : As a result, the OS will kill the process A and free the A's entry from the process table.


Any question? please let me know!

Happy OS!

To view or add a comment, sign in

More articles by A. ADELL

  • Produit et propriétés universelles

    note: article en cours ① Mise en jambe Soient A , B, P et C des ensembles ayant les extensions suivantes: A= { John…

  • La correction du gamma

    «La correction du gamma permet de définir la quantité relative des composantes de couleur d’une image. Cette fonction…

  • Sections PLT, GOT, compilation statique vs dynamique

    De nombreux articles sur Internet expliquent les notions de compilation statique et dynamique et le rôle de PLT et GOT…

  • Re-entrancy attack sur "The DAO" & smart contract

    Voilà une attaque malicieuse qui date de 2016 sur les smart contracts! L'initiation des smart contracts sur la…

  • SVD, Data Science, et algèbre linéaire

    SVD = Singular Value Decomposition (Décomposition en valeurs singulières) Mise en jambes Soit 𝔼 un K-espace vectoriel…

  • un peu de (mécanique) quantique (2/10)

    Je considère un système à un seul qubit 1️⃣ vecteur d'état pour les états purs La base considérée est {|uᵢ⟩}, i =1,..

  • Pourquoi "positiver"

    Désolé ce n'est pas un article sur les astuces pour rester positif! 1️⃣ Rester "positif" ! Je considère l'opération de…

  • un peu de (mécanique) quantique

    Système à un seul qubit Un qubit correspond à l'état d'une particule qui peut osciller entre deux états de base: par…

  • Entropie en thermodynamique vs Entropie en théorie de l'information

    Introduction Emmy Noether,mathématicienne allemande, a démontré le théorème suivant : Parce que les lois physiques…

  • md5

    I- Empreinte Les fichiers informatiques ont leurs empreintes aussi!. Le calcul de l'empreinte d'un document emploie une…

Others also viewed

Explore content categories