Skip to content

Add basic V_COMMON exception handler - #22

Open
zachary-cauchi wants to merge 35 commits into
masterfrom
20-create-a-basic-exception-handler
Open

Add basic V_COMMON exception handler#22
zachary-cauchi wants to merge 35 commits into
masterfrom
20-create-a-basic-exception-handler

Conversation

@zachary-cauchi

Copy link
Copy Markdown
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
Copy Markdown
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?

@Ravenslofty Ravenslofty left a comment

Copy link
Copy Markdown
Owner

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...

Comment thread prussia_rt/src/cop0.rs Outdated
Comment thread prussia_rt/src/cop0.rs Outdated
Comment thread prussia_rt/src/cop0.rs Outdated
Comment thread prussia_rt/src/exceptions/v_common.rs Outdated

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

/// Purposefully trigger an overflow exception. For testing purposes.

Copy link
Copy Markdown
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)

Comment thread prussia_rt/src/lib.rs Outdated
Comment thread prussia_rt/src/panic.rs Outdated
Comment thread prussia_rt/src/routines.S Outdated
Comment thread prussia_rt/src/routines.S Outdated
Comment thread prussia_rt/src/thread.rs
/// jumping to an exception handler.
#[repr(C)]
pub(crate) struct ThreadControlBlock {
pub at: u64,

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a basic exception-handler

2 participants