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

added a timerhalt() function #176

Open
wants to merge 1 commit into
base: riscv
Choose a base branch
from
Open

Conversation

meighti
Copy link

@meighti meighti commented Mar 30, 2023

The virt QEMU board integrates a "test finisher" device. Writing FINISHER_PASS(=0x5555) to its address which is VIRT_TEST(=0x100000), will halt virt machine.

Since this should be done in machine mode, a new flag is set by timerhalt() in supervisor mode. Later timervec() will check this flag, which is at the end of timer scratch area. If the halt flag is not zero, it will branch to halt.

It can be used to halt when kernel panics in printf.c
It can be triggered in user mode by killing init process, using the following command at shell:
kill 1

Related to issue #60

The virt QEMU board integrates a "test finisher" device.
Writing FINISHER_PASS(=0x5555) to its address which
is VIRT_TEST(=0x100000), will halt virt machine.

Since this should be done in machine mode, a new flag
is set by timerhalt() in supervisor mode. Later timervec()
will check this flag, which is at the end of timer scratch
area. If the halt flag is not zero, it will branch to halt.

It can be used to halt when kernel panics in printf.c
It can be triggered in user mode by killing init process,
using the following command at shell:
kill 1
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.

1 participant