Android from the foundation · Puzzle 1 of 16
The kernel is in charge
Something has to share the phone between all those processes. That's the core of the phone's own software, and it's the only thing that can reach into every process.
The problem
In puzzle 0, every running app was its own process with its own memory. But the phone has one CPU (the chip that runs a program's instructions, one after another; real phones have a few, but picture one) and one pool of memory for all of them. Who decides which process runs right now, and who hands out the memory?
See it
Under all the processes runs the phone's own software, the operating system (Android, built on Linux, an operating system first made for computers shared by many people). Its core is the kernel: the ground every house stands on.
Step 1 of 4There's one CPU. The kernel gives it to Notes for a moment…
Step 2 of 4…then to Music, then back, many times a second, so both seem to run at once. Predict: Notes needs more memory. Who does it ask?
Step 3 of 4The kernel. It hands out memory, and it's the only one that can reach into every process.
Step 4 of 4
The building block
The phone runs its own software underneath the apps: the operating system. Android is an operating system, built on Linux: a free operating system first made for computers shared by many people.
At its core is the kernel. It shares the CPU between processes, switching between them many times a second, so they all seem to run at once. It hands out memory, and it opens files. Because the kernel hands out every process's memory, it can reach into any process. A process can only reach the memory it was given.
The analogy
The processes are houses on a street. The kernel is the street's management: it decides who gets electricity right now, hands out building space, and is the only one who can enter every house.
Check yourself
Sources
What you now know
Processes never deal with the CPU or memory directly. They ask the kernel, which shares them out and keeps every process in its place.
Answer every question above correctly to unlock the next puzzle.