gwsystems / composite

A component-based OS
composite.seas.gwu.edu
185 stars 70 forks source link

Implementation of user-level fault handler #372

Closed WenyuanShao closed 6 years ago

WenyuanShao commented 6 years ago

Summary of this Pull Request (PR)

This PR is the implementation of user_level fault handlers. When a fault happens, it will make a sinv call to the user_level fault handler to handle the fault.

  1. Modified the invstk and set a bit into the captbl of the component on the top of the stack to indicate whether this is a sinv call to fault handlers or not. Add some additional comments to make this design easier to understand.
  2. Created a new type for sinv cap to the fault handlers, so we can get rid of a branch in the fast path.
  3. Expanded the thd_introspect to get the register information in user_level and print these register information when fault happens.
  4. Create an interface for fault handlers so different components can implement fault handlers differently.

Intent for your PR

Choose one (Mandatory):

Reviewers (Mandatory):

@gparmer @hungry-foolish @phanikishoreg

Code Quality

As part of this pull request, I've considered the following:

Style:

Code Craftsmanship:

Testing

I've tested the code using the following test programs (provide list here):

-llbooter_test.sh, llbooter_pong.sh, microboot.sh

phanikishoreg commented 6 years ago

Oh well.. Didn't notice, you need to pull the latest and fix the conflicts..

phanikishoreg commented 6 years ago

Just curious, why haven't you checked:

[ ] I've commented appropriately where code is tricky
[ ] I agree that there is no "throw-away" code, and that code in this PR is of high quality

If you don't, I think you should mention somewhere in the PR why! Helps reviewers.. ;)

And another nitpick:

[ ] This PR is for a code-review and is intended to get feedback, but not to be pulled yet.
[ ] This PR is mature, and ready to be integrated into the repo.

You should check one of these boxes only only.. Should really be treated as a radio-button.. :P