MIT 6.828 Xv6/jos LAB3-PARTB

Source: Internet
Author: User

This section is expected to handle page faults, breakpoints, and system calls

Handling System Page Errors

After the page fault has occurred, enter into the system interrupt, then go through the _alltraps, into the trap, and then through the Trap_dispatch distribution, the interrupt type of T_pgflt interrupt should be processed

Of course, page faults also have kernel page faults and user page errors

Working with breakpoints

In Jos, breakpoint interrupts are "abused", almost a system call, which is used as a monitor for invoking the system and is simple to implement.

System calls

The assembly part of the system call has been written.

An interrupt is thrown, the interrupt number is t_syscall, and the specific system call number is written in Num, which is the register ax, and then in Trap_dispatch, the call to SYSCALL is available.

The implementation of the Syscall is as follows

User-mode Startup

The link into the kernel that was loaded at system boot time is USER/HELLO.C

is to print Hello World and your own environmental information

But there are several interruptions and system calls involved.

The first call to system call Sys_getenvid is

And then after entering the Umain function

It outputs two times, so it generates two system calls

When the Umain function executes and returns to the LibMain function, the Exit function is executed, and the exit function is called inside Env_destroy

So the above interrupts and system calls are explained.

Page Fault and memory protection

Very important content, protect memory, in the memory operation, check the current memory range is not the current process can access, if not, check failed, end process

The code above is a reference to someone else's program.

Check all pages within a given memory range to see if the current user has permission to access

At this time the experiment ended, tossing a day and a half ...

MIT 6.828 Xv6/jos LAB3-PARTB

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.