* [Qemu-devel] Watchdog device in Qemu user mode
@ 2013-07-18 16:44 kbastian
2013-07-18 16:52 ` Peter Maydell
0 siblings, 1 reply; 6+ messages in thread
From: kbastian @ 2013-07-18 16:44 UTC (permalink / raw)
To: qemu-devel
Hey everybody,
I am fairly new to qemu development. So here is my question:
I would like to write a virtual watchdog device, which is part of the
emulated cpu. This is part of an Infineon Tricore Implementation I am
writing. For simplicities sake I use qemu user mode, to test my
translation. How could I implement such a watchdog device into qemu?
Can you give me some clues? Is it even possible to use a device in
user mode?
Best regards
Bastian
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] Watchdog device in Qemu user mode
2013-07-18 16:44 [Qemu-devel] Watchdog device in Qemu user mode kbastian
@ 2013-07-18 16:52 ` Peter Maydell
2013-07-18 17:09 ` kbastian
0 siblings, 1 reply; 6+ messages in thread
From: Peter Maydell @ 2013-07-18 16:52 UTC (permalink / raw)
To: kbastian; +Cc: qemu-devel
On 18 July 2013 17:44, <kbastian@mail.uni-paderborn.de> wrote:
> Hey everybody,
>
> I am fairly new to qemu development. So here is my question:
> I would like to write a virtual watchdog device, which
> is part of the emulated cpu. This is part of an Infineon
> Tricore Implementation I am writing. For simplicities sake
> I use qemu user mode, to test my translation.
> How could I implement such a watchdog device into qemu?
> Can you give me some clues? Is it even possible to use a
> device in user mode?
To a first approximation, no, you can't use devices in
user-mode. (Is the device really accessible to a normal
Linux process running on this hardware? Usually the
kernel would make it only kernel-accessible with the MMU.)
-- PMM
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] Watchdog device in Qemu user mode
2013-07-18 16:52 ` Peter Maydell
@ 2013-07-18 17:09 ` kbastian
2013-07-18 17:26 ` Peter Maydell
2013-07-18 17:28 ` Andreas Färber
0 siblings, 2 replies; 6+ messages in thread
From: kbastian @ 2013-07-18 17:09 UTC (permalink / raw)
To: Peter Maydell; +Cc: qemu-devel
Hi Peter,
thanks for the fast response. The processor is usually embedded and
programs run without operating systems or with custom ones designed
for hard realtime. Would it be much work to port from user mode to
system mode?
I am using a c-compiler to create testprograms and these programs are
serving the watchdog. This results in segmentation faults when I try
to execute loads or stores on addresses from the watchdog.
Best regards
Bastian
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] Watchdog device in Qemu user mode
2013-07-18 17:09 ` kbastian
@ 2013-07-18 17:26 ` Peter Maydell
2013-07-18 17:28 ` Andreas Färber
1 sibling, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2013-07-18 17:26 UTC (permalink / raw)
To: kbastian; +Cc: qemu-devel
On 18 July 2013 18:09, <kbastian@mail.uni-paderborn.de> wrote:
> thanks for the fast response. The processor is usually embedded and programs
> run without operating systems or with custom ones designed for hard
> realtime.
If this is your use case you should just implement system mode
and not worry about implementing linux-user mode at all.
thanks
-- PMM
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] Watchdog device in Qemu user mode
2013-07-18 17:09 ` kbastian
2013-07-18 17:26 ` Peter Maydell
@ 2013-07-18 17:28 ` Andreas Färber
2013-07-18 17:36 ` kbastian
1 sibling, 1 reply; 6+ messages in thread
From: Andreas Färber @ 2013-07-18 17:28 UTC (permalink / raw)
To: kbastian; +Cc: Peter Maydell, qemu-devel
Hi Bastian,
Am 18.07.2013 19:09, schrieb kbastian@mail.uni-paderborn.de:
> The processor is usually embedded and
> programs run without operating systems or with custom ones designed for
> hard realtime. Would it be much work to port from user mode to system mode?
> I am using a c-compiler to create testprograms and these programs are
> serving the watchdog. This results in segmentation faults when I try to
> execute loads or stores on addresses from the watchdog.
You need a softmmu a.k.a. system emulation for that. linux-user is only
for emulating programs that would actually run under Linux operating
system. You'd use the -bios command line option to load bare metal software.
Having no link to your code it's hard to judge how much work it might
be, but in general system emulation is easier - you need to write a
simple board file to load your binary, the instruction emulation remains
unchanged, maybe one or two stub functions for interrupts and MMU faults.
Regards,
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] Watchdog device in Qemu user mode
2013-07-18 17:28 ` Andreas Färber
@ 2013-07-18 17:36 ` kbastian
0 siblings, 0 replies; 6+ messages in thread
From: kbastian @ 2013-07-18 17:36 UTC (permalink / raw)
To: Andreas Färber; +Cc: Peter Maydell, qemu-devel
Hi Andreas,
thanks alot. I only used user mode because I thought it is easier to
implement.
I will take a look into system mode.
Best regards
Bastian
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-07-18 17:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-18 16:44 [Qemu-devel] Watchdog device in Qemu user mode kbastian
2013-07-18 16:52 ` Peter Maydell
2013-07-18 17:09 ` kbastian
2013-07-18 17:26 ` Peter Maydell
2013-07-18 17:28 ` Andreas Färber
2013-07-18 17:36 ` kbastian
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.