Feel the benefits of the LDT

Source: Internet
Author: User
Feel the benefits of the LDT

1) Start with an exception first:

2) from the trace you can see that "Init_main" is called, and the function is a function of kernel, which means that the problem is not the stage of boot and load.

?

3) Next look produces #PF的代码, EIP is 0x7b7b, this address looks very strange. First, the address of the kernel start instruction is 0x30400, and this 0x7b7b looks very confusing, not like the address of the initialization function in kernel, or the address of the interrupt service program, much less like the address of a task. --no clue.

?

4) Restart, at 0x7b7b break point, to see what this is.

?

08:0003 0729, this is the function of kernel. Because 8 here represents the selector for the kernel code snippet.

?

05:0000 7b7b, here 05 is the segment selector, this is the task of CS, the task of CS point to the No. 0 of the LDT, because:

So the 5 here represents the selector for the task code segment. (and ldt[0 in code] = 5)

?

05:00007b7b out the problem, stating that the task caused the exception.

?

5) Because each task corresponds to a LDT segment, see which task has a problem:

?

Look at the LDTR register, the value is 0x28 OK is the first task.

?

6) Take a look at the first task

The task exits, but exits without a good exit mechanism (like windows, a task switch), but rather eip++++ directly, running, which leads to problems.

?

7) At this point, it is found that each task uses a separate local descriptor for the LDT is a very good design, so that each task is isolated, the problem is better positioned.

Feel the benefits of the LDT

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.