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

Fix panic by disabling exceptions and more BIOS bug fixes #30

Merged
merged 11 commits into from
Jan 7, 2024
Merged

Commits on Jan 6, 2024

  1. psx/sys: Make critical section unsafe

    This could be made safe by checking cop0::Status before the syscall but that
    gets rid of the benefit that this function immediately disables exceptions
    before any loads from cop0.
    ayrtonm committed Jan 6, 2024
    Configuration menu
    Copy the full SHA
    ad35238 View commit details
    Browse the repository at this point in the history
  2. Revert "bios: Use syscalls for critical sections"

    This reverts commit df12e35.
    ayrtonm committed Jan 6, 2024
    Configuration menu
    Copy the full SHA
    141e766 View commit details
    Browse the repository at this point in the history
  3. psx: Make panic thread-safe and reentrant

    The example BIOS previously had very random bugs because panic was not
    thread-safe. Essentially the loop {} was being ignored because if the exception
    handler changed threads. This commit fixes that by ensuring that panic happens
    in a critical section. A syscall is used to minimize the chance that an
    exception happens between panic's prologue and the critical section call but to
    really ensure this panic needs to be a naked function starting with the syscall.
    I'm not sure if this is worth it, but it may be a good idea to add a
    thread-aware panic handler in the example BIOS.
    
    The panic function was also not reentrant. Normally this should not occur
    because the panic function should be simple enough that it doesn't panic, but it
    was happening because of a typo in the framebuffer handling introduced when I
    added some video mode things. To make it reentrant I just use a static mut flag
    since it's already in a critical section and previous iterations won't hold onto
    mutable references.
    ayrtonm committed Jan 6, 2024
    Configuration menu
    Copy the full SHA
    5f32dc5 View commit details
    Browse the repository at this point in the history
  4. psx/gpu: Fix typo in VideoMode constants

    This fixes a bug that was causing nested panics in a non-reentrant panic handler
    ayrtonm committed Jan 6, 2024
    Configuration menu
    Copy the full SHA
    a0b918f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    6455fdd View commit details
    Browse the repository at this point in the history
  6. bios: Fix warnings

    ayrtonm committed Jan 6, 2024
    Configuration menu
    Copy the full SHA
    cd06122 View commit details
    Browse the repository at this point in the history

Commits on Jan 7, 2024

  1. psx: Remove loop after nested panic warning and refactor panic.rs

    In case of nested panics (e.g. cause by the CStr limit in println) this allows
    execution to continue until the second panic message.
    ayrtonm committed Jan 7, 2024
    Configuration menu
    Copy the full SHA
    5655176 View commit details
    Browse the repository at this point in the history
  2. psx: Bump char limit on println!

    There was a panic message in linked_list_allocator in the BIOS that needed a
    larger buffer.
    ayrtonm committed Jan 7, 2024
    Configuration menu
    Copy the full SHA
    938f2f7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d746390 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    74d0534 View commit details
    Browse the repository at this point in the history
  5. ci: Bump timeout on tests

    ayrtonm committed Jan 7, 2024
    Configuration menu
    Copy the full SHA
    ddddd95 View commit details
    Browse the repository at this point in the history