Skip to content
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

Add basic V_COMMON exception handler #22

Open
wants to merge 34 commits into
base: master
Choose a base branch
from

Conversation

zachary-cauchi
Copy link
Collaborator

  • Adds a basic exception handler to all V_COMMON exceptions.
  • Add basic panic handler which prints all COP0 register values and halts.
  • Modify linkfile to specify memory locations for sections.
  • Fix error messages in VSCode.
  • Add sleep_thread syscall.
  • Add saving of EE registers in exception handler before passing to Rust-level handler.
  • Remove deprecated r0 crate.

Partially addresses #20.

@zachary-cauchi zachary-cauchi linked an issue Oct 26, 2024 that may be closed by this pull request
23 tasks
@Ravenslofty
Copy link
Owner

I am unfortunately away from keyboard for like another week, so I probably won't be able to review this until then. If feasible, could you ping me in a week?

Copy link
Owner

@Ravenslofty Ravenslofty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect the ghost of provenance will haunt us for some time...

prussia_rt/src/cop0.rs Outdated Show resolved Hide resolved
prussia_rt/src/cop0.rs Outdated Show resolved Hide resolved
prussia_rt/src/cop0.rs Outdated Show resolved Hide resolved
prussia_rt/src/exceptions/v_common.rs Outdated Show resolved Hide resolved

use crate::{cop0::CoP0Dump, thread::ThreadControlBlock};

/// Purposefully trigger an overflow exception. For testing purposes.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(thankfully, these went out of style)

prussia_rt/src/lib.rs Outdated Show resolved Hide resolved
prussia_rt/src/panic.rs Outdated Show resolved Hide resolved
prussia_rt/src/routines.S Outdated Show resolved Hide resolved
prussia_rt/src/routines.S Outdated Show resolved Hide resolved
/// jumping to an exception handler.
#[repr(C)]
pub(crate) struct ThreadControlBlock {
pub at: u64,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't remember, is this from my code? If it was, it's technically incorrect because the GPRs are actually 128-bit wide...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I started with 64-bit because that was the only way to keep the compiler and linker happy for some reason. I've now been trying to rewrite it with 128-bit fields but I can't quite figure out why it's failing to run properly. I've done all sorts of tricks but it always results in TLB Misses. I'll continue debugging it and try get it done.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't suppose you have an IM platform I could talk to you on?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you'd like, I'm on Signal and Discord. Alternatively, is there any other platform that you'd prefer?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signal would be perfect. I'm ravenslofty.79

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a basic exception-handler
2 participants