-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Start populating the IDT and handle double faults. #2893
Conversation
}; | ||
} | ||
|
||
extern "x86-interrupt" fn double_fault_handler( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is "x86-interrupt"? Is this a type of linker that the Rust compiler already knows about or is it defined somewhere? Could you add a clarifying comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's not about linker -- it changes the calling convention of the function and what code the compiler emits. The particular calling convention is required by the x86-64 ABI.
You can read more about the x86-interrupt
in particular here: rust-lang/rust#40180
In short, you don't really expect to see that used anywhere else except for interrupt handlers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a comment with a link to that issue would help us understand what is going on later when we look at the code.
// We're not calling `panic!` here because (a) the panic location would be all wrong (the error | ||
// is not in the fault handler itself as the location would suggest), (b) in theory the | ||
// panic handler itself could cause a double fault, and (c) we want to be sure that we shut | ||
// down the machine after us. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: is "shut down the machine after us" an idiom that I don't know of? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it just means we want to be sure that the machine is shut down after we have a double fault.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I think describing it in those words would be clearer :)
Reproducibility Index:
Reproducibility Index diff: |
No description provided.