First, how the computer works
1, 1 computer three magic Weapon
The stored program computer, the function call stack, and the interrupt mechanism.
A stack is a space where the C language program must record the call path and parameters when it runs. (function call frame, pass parameter, save return address, provide local variable space)
1, 2 in-depth understanding of function stacks
(1) Push stack top reduced by 4 bytes
Add 4 bytes to the top of the pop stack
EBP is used in the C language to record the current function call base
(2) Other key registers
(3) function stack frame
1, 3 parameter passing and local variables
(1) Generate disassembly code
(2) Sample Analysis statement
Sub &0x18,%esp reserve a space storage variable in the stack
Second, with the Linux kernel part of the source code simulation storage program computer work model and clock interrupt
2, 1 Mykernel the thought behind the experiment
A program has one of its own execution streams, how do I switch to another program?
Together with the CPU and kernel code to achieve the protection of the scene and recovery site, when the interrupt signal occurs, the CPU to the current signal of the ESP, EBP pressure into the kernel stack, the EIP point to the interrupt handler entry.
2, 2 simulation of computer hardware platform using Mykernel experiment
(1) Construction of the platform using the experimental building
Your own experiment:
In-depth understanding of computers