seegongsik
Saved words
Operating systems

The wall between mine and yours

In virtual memory, each program saw its own memory (lesson 9). It couldn't even see the others'. Yet in truth, everyone's data sits mixed in one real memory. So what keeps mine and yours from touching each other? Surprisingly, there's no blocking wall at all.

01

Many live mixed in one memory

In the pretend view each seems to use its own,
but inside real memory everyone is mixed together.
A's pieces and B's pieces sit side by side.
If A could touch B's spot right next to it,
A's one mistake could wreck B, and even peek at its secrets.

Real memory
A
B
A
B
B
A
A
B
A
B
B
A

Look at real memory. A's (gold) and B's (blue) pieces sit mixed together.

Mixed in one space like this, it looks risky.
Yet in reality A can never touch B.
Is there some solid partition blocking the two?
No. The secret lies in that map from lesson 9.

02

Not a wall, just no path

Recall the map from lesson 9.
A's map points only to A's real spots.
There is simply no path in it leading to B's spots.
So A has no way to even name 'B's address'.
It's not that a wall blocks the two, but that there's no road to take.

A map
A1
B1
no path
A2
B2
no path
A3

Pick A. A's map leads only to A's spots; there's no arrow to B.

With no path in the map, you can't go there.
But what if some program, by mistake
or on purpose, calls an address outside its map?
Then another safeguard kicks in.

03

Try to cross the line, get caught

When a program calls an address not in its map,
there's no real spot to map to, so the translation fails.
At that instant the hardware notices and tells the OS.
The OS says 'you touched a spot that isn't yours'
and stops just that program. The bad access never lands.

Try A's address, then B's. Yours passes (green); the other's is caught and stopped (red).

Yours goes through; the other's is caught right there.
An attempt to cross the boundary never gets through.
Thanks to this, a very reassuring result follows.
Even if one program breaks, it doesn't spread to others.

04

One crashes, the rest stay fine

Since each program is boxed into its own space,
a breaking program can only mess up its own spot.
It can't touch others' memory, nor the OS.
The OS quietly cleans up just that broken one,
and the rest of the programs keep running as if nothing happened.

P1
running
P2
running
P3
running

Crash one program. Only that one stops; the rest keep running.

Without protection, one broken program would drag everything down.
Because they're kept separate, the accident stays in one box.
Stability and security both come out of this.
And underneath it isn't a 'wall' but 'separate maps'.

05

Separation itself is protection

In short, memory protection isn't a wall built on purpose.
Giving each process a separate map means there's no path between them,
and crossing the line gets caught, stopping just that one.
So they live mixed yet don't collide, and one crash doesn't spread.
The separation itself is the protection.

Toggle protection off and on. On, the accident stays in one box; off, it spreads to all.

Up to here the OS has ruled the inside: the CPU and memory.
Letting them take turns (time-sharing, scheduling), keeping them apart (virtual memory, protection).
But a computer must also talk to the outside.
Keyboards, screens, disks, even brand-new devices it's never seen.
How does the OS recognize all those devices? That's the next story.

In one lineMemory protection isn't a blocking wall but a result of each process having a different map. My map points only to my spots, so there's simply no path to anyone else's. If something tries to cross the line, the address isn't in its map, the hardware catches it, and the OS stops only that program. So one crash leaves the rest unharmed. Separation itself is the protection.
Operating systems
Was this helpful? Support seegongsik