In the Name of ALLAH, Most Gracious, Most Merciful.
We will have a short journey in the x86 architecture starting from a hardware input till the final output.
This journey will help you understand in a bit of detail how the computer works so if you are a software developer you might find it useful to take such a journey before we start we need to know the main system components.
Any modern PC, laptop, smartphone or almost any programmable device has main three hardware parts:
- The central processing unit (CPU)
- The Random access memory (RAM)
- Input/output components e.g. mouse, touch screen, keyboard, sound card ..etc
These three components are connected together physically through indirect channels, the first known one how makes this architecture is John von Neumann

What important to us at this time is that:
- The three parts can send and receive data from/to each other.
- All programs have to be loaded first in RAM, it called random because of that: we can access any byte in it at any time.
- The CPU is the brain of the computer,smartphone or Machine.
- The CPU usually as almost all computers today have multi-cores, every core can execute specific instructions(some code) independently.
Before starting there is an existing note :
There is no pure output components!
How?!
I’ll tell you.
For example, did you think your connected LED/LCD screen is purely an output device? I meant the non-touch ones.
So tell me how the operating system knows the screen manufacturer and model so?
Sure it stored in the screen itself and this an input.
Let’s start our journey…
Say you’ve touched your smartphone screen, a visible button on it.
If you don’t know, the screen is different from it’s touch the touch is separate hardware layer above the screen which responsible for detecting your finger touched points and send these data(where and how you touched and/or release your fingers) to the next station in our journey, the next station is the touch controller which is a hardware responsible for storing these data and tells the processor that:
Hey man we have inputs here are you ready to receive these data?
This action is called CPU external interruption
If the CPU ready, it will read it and go to the fourth station, to be aligned here is the sequence again:
- You touched the screen.
- Touch information converted to a store-able data and stored in touch controller.
- When CPU is ready or any of its cores, data will received and stored inside the core memory say the cache of the CPU.
After that the CPU will take action according to the IDT
(Interrupt Descriptor Table: simply this is a table in the CPU, the kernel of the Operating System fills this table at loading time just after boot) this table tells the CPU when any internal or external interruption happened what to do, every interruption type has its handler in Operating System kernel code.

CPU will say that according to IDT:
Hey touch handler takes this data it’s for you.
The operating system formerly it’s kernel is now the current driver.
To the fifth station, this is a layer in the operating system which responsible for drawing the apps UI and also manages the connection between apps and kernel.
This layer takes the information to the current foreground app
And pass it to its parent view through the UI hierarchy, and finally reaches the developer code for the click or touch Listener.
Then the action of updating UI or executing the desired functionality
Happen through another journey!
There are some important points that you have to know :
1. at any area of these sequences the action can be prevented from reaching its final destination, here is the developer code, e.g. the OS may not send these data to the UI Layer because of system lag.
2.The Systems (as hardware) built driven by the interruption!
3. this Sequence Happens(the interruption itself) many many times duration even one second (not the external interruption), can reach millions of times in a second to be aware the slowest CPU know can run at speed on average 2GH which is 2 billion cycles in a second!
Thanks for reading ?
References
- IDT
- GUI Layer (Windowing System)