In-depth understanding of computers

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.