xv6-riscv icon indicating copy to clipboard operation
xv6-riscv copied to clipboard

added a timerhalt() function

Open meighti opened this issue 3 years ago • 0 comments

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

meighti avatar Mar 30 '23 19:03 meighti