Orange's exercises-Chapter 3 [interruptions and exceptions]

Source: Internet
Author: User
Tags stack pop

I. Short answer

1. What are the concepts of "interruption" and "exception" in section 80386?

Answer: For 80386, the interrupt is caused by an asynchronous external event and has nothing to do with the command being executed. Exceptions are caused by abnormal or invalid conditions detected during command execution. They are directly related to the commands being executed. Soft Interrupt commands "int n" and "into" are also attributed to exceptions because execution of these commands produces exceptions.

2. Let's talk about your understanding of Fault, Trap, and Abort.

Answer: The three are further subdivided based on whether the program that causes the exception can be recovered and the recovery point.

Fault is an exception that can be corrected. When a fault occurs, the processor restores the source operand of the fault command to the value before the start of the command, the value of the saved breakpoint cs and eip points to the command that causes the fault.

Trap is an exception reported immediately after the execution of the command that generates the Trap. The return address of the exception handler will be the one after the command that generates the Trap.

Abort is used to report serious errors. After the system receives the suspension, it needs to recreate various system tables and possibly restart the operating system. An example of a hardware fault or an invalid value in the system table is aborted.

3. Describe the return of interrupt or exception handling.

Answer: For an exception handling program that provides an error code, the error code must be popped out of the stack before executing the iret command.

First, the eip and cs pointer are returned from the top of the stack, and then the eflag value is displayed. Select the sub-RPL field in the pop-up cs to determine the returned privilege level. If the returned result shows that the selected sub-RPL is equal to CPL, not only does the row privilege level change. If RPL specifies an outer privileged level, it needs to change the privileged level. The ESP and SS values of the outer stack pop-up from the inner Stack are similar to those of the ret command.

2. Fill in blank questions

1. The processor does not shield interrupt requests from _____. In the same way as 8086, Which of the following is the fixed vector Number of the unshielded interrupt in 80386 _____, therefore, when the processor responds to this interrupt, it does not receive the interrupt vector number from external hardware. After the interrupt processing program starts, the processor automatically blocks the program and responds again. The unblocked interrupt is not blocked until the command _____ is returned after the interruption is executed.

Answer: NMI, 3, iret

2. The segment descriptor and Their descriptor have different structures, but the byte _____ is common, that is, the _____ bit in this byte, indicates whether the system segment/user descriptor or code segment/data segment is described by this selector.

Answer: 5, S

3. Compared with the call door, the lower _____ bits in the interrupt door and trap door are reserved.

Answer: 5

4. There is only one IDT In the Interrupt Descriptor Table. Which of the following table registers indicates the location of the IDT in the memory. In protection mode, 80386 regards _____ as the index of the descriptor in the Interrupt Descriptor Table IDT. Because 80386 only recognizes _____ interrupt vector numbers, the maximum length of IDT is _____ byte.

Answer: IDTR, interrupt vector number, 256, 2028, or 2 K

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.