Computer System: Chapter 1 Abnormal Control Flow

Source: Internet
Author: User

References: in-depth understanding of computer systems, Chapter 2

1. Type of Control Flow

-- Reflects the changes in the internal State represented by the "program internal" variable. To put it simply, I am running this program. In the "program", it clearly indicates the next running command, such as the next, while, jump, and so on.

-- Responds to changes in some system states. These system states are "not captured by variables in this program. To put it simply, I am running this program, and suddenly a stimulus is coming from outside the program to let me respond.

-- For the second control flow, the system uses ECF (exceptional control flow exception Control Flow) to respond.


8.1 exceptions

-- "Basic process of exception: processor detects a time occurrence -- jump to the exception table written in advance --> corresponding exception handling program --" exception of different categories, make different "responses"


8.1.1 Exception Handling: hardware and software are required to work closely together to handle exceptions. It is easy to confuse which part executes the task: So, and determine which part performs the task.

1 -- "" hardware "basis: exception number for each exception

2 -- "software": when the operating system is started, an "exception table" is initialized.

3 -- "hardware": processor detects an exception -- jump according to the exception table

4 -- "software": Execute the corresponding exception handling program


8.1.2 exception category

1 -- interrupt (asynchronous: not the result caused by the current command)

2 -- trap

-- System Call

-- Fault faults

-- Terminate aborts (these four exceptions occur synchronously because they are the results of the current command, such as missing pages)


* -- "Concepts above

"Specified by the current command" refersFirst control flowBecause the jump will occur when the program runs to goto, which is indicated by the program display;

"Caused by the current command" indicates that the program does not explicitly specify how to control which of the following statements to be executed (ECF can be determined here), but because the current command is executed, caused an exception (such as missing pages). This isSynchronization exception

"Not the result caused by the current command" means that the current command of the program will not cause any exceptions, but a device sends a signal externally, which is asynchronous."Exception";


8.1.3linux/ia32 system exceptions

1 -- "ia32 system, baidu should refer to ia32 architecture, is an Intel instruction set architecture

2 -- the specificity of exception handling in this system

-- Number of exception types: 256. Both are defined.

-- "Exception handling methods (for example, some special ones)

-- System Call is provided through int 0x80

-- All system calls to "Linux" are passed through registers (such as % eax) instead of stacks.

Related Article

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.