How to send a shutdown signal to QEMU from RTEMS?

Joel Sherrill joel.sherrill at oarcorp.com
Fri Oct 10 17:04:53 UTC 2014


On 10/10/2014 11:56 AM, Hesham Moustafa wrote:
>
>
> On Wed, Oct 8, 2014 at 4:20 PM, Joel Sherrill
> <joel.sherrill at oarcorp.com <mailto:joel.sherrill at oarcorp.com>> wrote:
>
>
>     On 10/8/2014 12:15 AM, Sebastian Huber wrote:
>     > On 07/10/14 15:53, Hesham Moustafa wrote:
>     >> Hi,
>     >>
>     >> I want to send shutdown signal from RTEMS to qemu. Joel said that
>     >> qemu-system-i386 does so; can anyone refers me to how to
>     implement that for
>     >> qemu-system-or32 (openrisc)?
>     > This is target dependent.  Some targets implement the registers
>     of the reset
>     > module.  The easiest thing to figure this out is looking at the
>     Qemu sources.
>     >
>     We need to ask Christian. There is a command line option to qemu
>     which turns on "exit on reset" (--no-reboot).  If the simulated target
>     hardware has a way to reset it from software, the target specific
>     simulation
>     can honor the command line option and just exit rather than start
>     over.
>
>     We use this on at least the pc386.
>
> Would you please provide the related QEMU code so that I can try to
> imitate for or1k?

Bring Christian in on this. There has to be defined a hardware way to
shutdown.  It can be as simple as a new "IO device" which has a single
register. When you write to it, the simulator just does an orderly shutdown.

But if the or1k HW already has some defined HW mechanism to request
a reset, then we need to know that so that the simulator can exit or
restart when that is touched properly.

The qemu code is complex but it centers around qemu_system_reset_request()
as best I can tell.
>
>     The questions for Christian are:
>
>     + Does the or1ksim have a software reset capability? If not, can we
>     add one?
>
> There is a single assembly instruction that shutdowns the whole
> or1ksim simulator process. We can use it from RTEMS. The question is
> where is the best place to put in this instruction? It's BSP related,
> and I was thinking of _CPU_Fatal_Halt, but it's not BSP related.
> However only or1ksim simulator recognizes this instruction, and it has
> no effect on other (future) target (QEMU, FPGA board, etc).
>
>     + Can qemu be modified to support this?
>
>     It should only be a few lines of code in qemu and one write to the
>     magic location in the BSP.
>
>     It will be of great value in speeding the testing procedure.
>
>     --
>     Joel Sherrill, Ph.D.             Director of Research & Development
>     joel.sherrill at OARcorp.com        On-Line Applications Research
>     Ask me about RTEMS: a free RTOS  Huntsville AL 35805
>     Support Available                (256) 722-9985
>
>

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20141010/145cfca4/attachment-0002.html>


More information about the devel mailing list