All of lore.kernel.org
 help / color / mirror / Atom feed
* Testing a microcontroller emulation by loading the binary on incomplete Flash emulation
@ 2021-08-22 14:36 Gautam Bhat
  2021-08-22 16:47 ` Peter Maydell
  0 siblings, 1 reply; 12+ messages in thread
From: Gautam Bhat @ 2021-08-22 14:36 UTC (permalink / raw)
  To: QEMU Developers

Hi,

I am to implement a very simple microcontroller for my understanding
of Qemu development. This microcontroller runs its code from
programmable flash which is bit-, byte- and word addressable. To do
some initial tests of my nascent microcontroller implementation I
would like to load a very simple program binary. Is there a way to
load this binary and start execution without emulating Flash
controller and memory?

Thanks.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Testing a microcontroller emulation by loading the binary on incomplete Flash emulation
  2021-08-22 14:36 Testing a microcontroller emulation by loading the binary on incomplete Flash emulation Gautam Bhat
@ 2021-08-22 16:47 ` Peter Maydell
  2021-08-23 19:46   ` Gautam Bhat
  0 siblings, 1 reply; 12+ messages in thread
From: Peter Maydell @ 2021-08-22 16:47 UTC (permalink / raw)
  To: Gautam Bhat; +Cc: QEMU Developers

On Sun, 22 Aug 2021 at 15:37, Gautam Bhat <mindentropy@gmail.com> wrote:
>
> Hi,
>
> I am to implement a very simple microcontroller for my understanding
> of Qemu development. This microcontroller runs its code from
> programmable flash which is bit-, byte- and word addressable. To do
> some initial tests of my nascent microcontroller implementation I
> would like to load a very simple program binary. Is there a way to
> load this binary and start execution without emulating Flash
> controller and memory?

Just create a plain old RAM memory region, and then load the
guest binary into it with the 'generic loader' (which can
take an ELF file or a raw binary).

-- PMM


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Testing a microcontroller emulation by loading the binary on incomplete Flash emulation
  2021-08-22 16:47 ` Peter Maydell
@ 2021-08-23 19:46   ` Gautam Bhat
  2021-08-24  8:22     ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 12+ messages in thread
From: Gautam Bhat @ 2021-08-23 19:46 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers

On Sun, Aug 22, 2021 at 10:18 PM Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Sun, 22 Aug 2021 at 15:37, Gautam Bhat <mindentropy@gmail.com> wrote:
> >
> > Hi,
> >
> > I am to implement a very simple microcontroller for my understanding
> > of Qemu development. This microcontroller runs its code from
> > programmable flash which is bit-, byte- and word addressable. To do
> > some initial tests of my nascent microcontroller implementation I
> > would like to load a very simple program binary. Is there a way to
> > load this binary and start execution without emulating Flash
> > controller and memory?
>
> Just create a plain old RAM memory region, and then load the
> guest binary into it with the 'generic loader' (which can
> take an ELF file or a raw binary).
>
> -- PMM

Thanks. I will check it out.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Testing a microcontroller emulation by loading the binary on incomplete Flash emulation
  2021-08-23 19:46   ` Gautam Bhat
@ 2021-08-24  8:22     ` Philippe Mathieu-Daudé
  2021-08-24  9:18       ` Peter Maydell
  2021-08-25 19:03       ` Gautam Bhat
  0 siblings, 2 replies; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-08-24  8:22 UTC (permalink / raw)
  To: Gautam Bhat, Peter Maydell; +Cc: QEMU Developers

On 8/23/21 9:46 PM, Gautam Bhat wrote:
> On Sun, Aug 22, 2021 at 10:18 PM Peter Maydell <peter.maydell@linaro.org> wrote:
>> On Sun, 22 Aug 2021 at 15:37, Gautam Bhat <mindentropy@gmail.com> wrote:
>>>
>>> Hi,
>>>
>>> I am to implement a very simple microcontroller for my understanding
>>> of Qemu development. This microcontroller runs its code from
>>> programmable flash which is bit-, byte- and word addressable. To do
>>> some initial tests of my nascent microcontroller implementation I

Aren't Nascent uC based on 8051? Because AFAIK QEMU doesn't emulate
this architecture.

>>> would like to load a very simple program binary. Is there a way to
>>> load this binary and start execution without emulating Flash
>>> controller and memory?
>>
>> Just create a plain old RAM memory region, and then load the
>> guest binary into it with the 'generic loader' (which can
>> take an ELF file or a raw binary).
>>
>> -- PMM
> 
> Thanks. I will check it out.
> 



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Testing a microcontroller emulation by loading the binary on incomplete Flash emulation
  2021-08-24  8:22     ` Philippe Mathieu-Daudé
@ 2021-08-24  9:18       ` Peter Maydell
  2021-08-24 10:38         ` Philippe Mathieu-Daudé
  2021-08-25 19:03       ` Gautam Bhat
  1 sibling, 1 reply; 12+ messages in thread
From: Peter Maydell @ 2021-08-24  9:18 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé; +Cc: Gautam Bhat, QEMU Developers

On Tue, 24 Aug 2021 at 09:22, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> On 8/23/21 9:46 PM, Gautam Bhat wrote:
> > On Sun, Aug 22, 2021 at 10:18 PM Peter Maydell <peter.maydell@linaro.org> wrote:
> >> On Sun, 22 Aug 2021 at 15:37, Gautam Bhat <mindentropy@gmail.com> wrote:
> >>>
> >>> Hi,
> >>>
> >>> I am to implement a very simple microcontroller for my understanding
> >>> of Qemu development. This microcontroller runs its code from
> >>> programmable flash which is bit-, byte- and word addressable. To do
> >>> some initial tests of my nascent microcontroller implementation I
>
> Aren't Nascent uC based on 8051? Because AFAIK QEMU doesn't emulate
> this architecture.

I assumed Gautam was using 'nascent' in the usual English sense
of the word (ie as an adjective meaning "just coming into existence").

-- PMM


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Testing a microcontroller emulation by loading the binary on incomplete Flash emulation
  2021-08-24  9:18       ` Peter Maydell
@ 2021-08-24 10:38         ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-08-24 10:38 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Gautam Bhat, QEMU Developers

On Tue, Aug 24, 2021 at 11:19 AM Peter Maydell <peter.maydell@linaro.org> wrote:
> On Tue, 24 Aug 2021 at 09:22, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> > On 8/23/21 9:46 PM, Gautam Bhat wrote:
> > > On Sun, Aug 22, 2021 at 10:18 PM Peter Maydell <peter.maydell@linaro.org> wrote:
> > >> On Sun, 22 Aug 2021 at 15:37, Gautam Bhat <mindentropy@gmail.com> wrote:
> > >>>
> > >>> Hi,
> > >>>
> > >>> I am to implement a very simple microcontroller for my understanding
> > >>> of Qemu development. This microcontroller runs its code from
> > >>> programmable flash which is bit-, byte- and word addressable. To do
> > >>> some initial tests of my nascent microcontroller implementation I
> >
> > Aren't Nascent uC based on 8051? Because AFAIK QEMU doesn't emulate
> > this architecture.
>
> I assumed Gautam was using 'nascent' in the usual English sense
> of the word (ie as an adjective meaning "just coming into existence").

TIL 'nascent' is an English word =)

Thanks,

Phil.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Testing a microcontroller emulation by loading the binary on incomplete Flash emulation
  2021-08-24  8:22     ` Philippe Mathieu-Daudé
  2021-08-24  9:18       ` Peter Maydell
@ 2021-08-25 19:03       ` Gautam Bhat
  2021-08-25 19:53         ` Peter Maydell
  1 sibling, 1 reply; 12+ messages in thread
From: Gautam Bhat @ 2021-08-25 19:03 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé; +Cc: Peter Maydell, QEMU Developers

On Tue, Aug 24, 2021 at 1:52 PM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>

>
> Aren't Nascent uC based on 8051? Because AFAIK QEMU doesn't emulate
> this architecture.

I am trying to emulate the TI MSP430 microcontroller.

-Gautam.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Testing a microcontroller emulation by loading the binary on incomplete Flash emulation
  2021-08-25 19:03       ` Gautam Bhat
@ 2021-08-25 19:53         ` Peter Maydell
  2021-08-26 15:46           ` Gautam Bhat
  0 siblings, 1 reply; 12+ messages in thread
From: Peter Maydell @ 2021-08-25 19:53 UTC (permalink / raw)
  To: Gautam Bhat; +Cc: Philippe Mathieu-Daudé, QEMU Developers

On Wed, 25 Aug 2021 at 20:03, Gautam Bhat <mindentropy@gmail.com> wrote:
> I am trying to emulate the TI MSP430 microcontroller.

The MSP430 is a custom 16-bit architecture. We don't have an
emulation of that kind of CPU. If you're mostly doing this to look
at how QEMU's device emulation is implemented, you should probably
pick something based on an architecture that we already have an
emulation for (ie where there is a target/$whatever). If you're
doing this specifically because you want to look at how a
target frontend for a new architecture works, have fun, I guess.

thanks
-- PMM


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Testing a microcontroller emulation by loading the binary on incomplete Flash emulation
  2021-08-25 19:53         ` Peter Maydell
@ 2021-08-26 15:46           ` Gautam Bhat
  2021-08-26 15:49             ` Peter Maydell
  0 siblings, 1 reply; 12+ messages in thread
From: Gautam Bhat @ 2021-08-26 15:46 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Philippe Mathieu-Daudé, QEMU Developers

On Thu, Aug 26, 2021 at 1:24 AM Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Wed, 25 Aug 2021 at 20:03, Gautam Bhat <mindentropy@gmail.com> wrote:
>
> If you're
> doing this specifically because you want to look at how a
> target frontend for a new architecture works, have fun, I guess.
>
> thanks
> -- PMM

Exactly what I want to do. Since it has only 27 instructions and I
have a lot of dev boards I felt that it is right microcontroller to
start with.

For this I want to have a proper dev setup where I can load my binary
while I am writing my translate file.

Thanks,
Gautam.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Testing a microcontroller emulation by loading the binary on incomplete Flash emulation
  2021-08-26 15:46           ` Gautam Bhat
@ 2021-08-26 15:49             ` Peter Maydell
  2021-08-29 21:34               ` Gautam Bhat
  0 siblings, 1 reply; 12+ messages in thread
From: Peter Maydell @ 2021-08-26 15:49 UTC (permalink / raw)
  To: Gautam Bhat; +Cc: Philippe Mathieu-Daudé, QEMU Developers

On Thu, 26 Aug 2021 at 16:46, Gautam Bhat <mindentropy@gmail.com> wrote:
>
> On Thu, Aug 26, 2021 at 1:24 AM Peter Maydell <peter.maydell@linaro.org> wrote:
> >
> > On Wed, 25 Aug 2021 at 20:03, Gautam Bhat <mindentropy@gmail.com> wrote:
> >
> > If you're
> > doing this specifically because you want to look at how a
> > target frontend for a new architecture works, have fun, I guess.

> Exactly what I want to do. Since it has only 27 instructions and I
> have a lot of dev boards I felt that it is right microcontroller to
> start with.
>
> For this I want to have a proper dev setup where I can load my binary
> while I am writing my translate file.

Just create a minimal machine with some RAM in it, and use
the generic-loader to load the test binary into the RAM, then.

-- PMM


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Testing a microcontroller emulation by loading the binary on incomplete Flash emulation
  2021-08-26 15:49             ` Peter Maydell
@ 2021-08-29 21:34               ` Gautam Bhat
  2021-08-29 22:39                 ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 12+ messages in thread
From: Gautam Bhat @ 2021-08-29 21:34 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Philippe Mathieu-Daudé, QEMU Developers

> Just create a minimal machine with some RAM in it, and use
> the generic-loader to load the test binary into the RAM, then.
>
> -- PMM

I should be using the -bios switch for loading the bare metal firmware, correct?

-Gautam.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Testing a microcontroller emulation by loading the binary on incomplete Flash emulation
  2021-08-29 21:34               ` Gautam Bhat
@ 2021-08-29 22:39                 ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-08-29 22:39 UTC (permalink / raw)
  To: Gautam Bhat; +Cc: Peter Maydell, QEMU Developers

[-- Attachment #1: Type: text/plain, Size: 369 bytes --]

Le dim. 29 août 2021 23:34, Gautam Bhat <mindentropy@gmail.com> a écrit :

> > Just create a minimal machine with some RAM in it, and use
> > the generic-loader to load the test binary into the RAM, then.
> >
> > -- PMM
>
> I should be using the -bios switch for loading the bare metal firmware,
> correct?
>

No:

-device generic-loader

-Gautam.
>

[-- Attachment #2: Type: text/html, Size: 1009 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-08-29 22:40 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-22 14:36 Testing a microcontroller emulation by loading the binary on incomplete Flash emulation Gautam Bhat
2021-08-22 16:47 ` Peter Maydell
2021-08-23 19:46   ` Gautam Bhat
2021-08-24  8:22     ` Philippe Mathieu-Daudé
2021-08-24  9:18       ` Peter Maydell
2021-08-24 10:38         ` Philippe Mathieu-Daudé
2021-08-25 19:03       ` Gautam Bhat
2021-08-25 19:53         ` Peter Maydell
2021-08-26 15:46           ` Gautam Bhat
2021-08-26 15:49             ` Peter Maydell
2021-08-29 21:34               ` Gautam Bhat
2021-08-29 22:39                 ` Philippe Mathieu-Daudé

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.