-------- Message original --------
Sujet: Re: AW: adding ports to the ss5.
Date : Sun, 17 Mar 2013 18:34:20 +0400
De : Artyom Tarasenko <atar4qemu@gmail.com>
Pour : Jean.Michel.Schramm@genavir.fr
Copie à : breuerr <breuerr@mc.net>, "mark.cave-ayland" <mark.cave-ayland@ilande.co.uk>


Hi Jean Michel,

On 3/17/13, Jean.Michel.Schramm@genavir.fr
<Jean.Michel.Schramm@genavir.fr> wrote:
> Is there a way to write to prom image ss5.bin? nvalias command does
> not work because there's no nvram?

There is a nvram. But the proprietary firmware OBP - uses a different
layout than OpenBIOS. The current implementation of nvram doesn't
persist its content after shutting down or a hard reset. But, for your
experiments a soft-reset should be enough. Just use the 'reset'
command from the OBP ok prompt.

It should be possible to add some code to qemu that it would
read/write the contents of the nvram to a file.

> Does this ss5.bin is a merely
> direct copy of the real PROM?

Yes. ss5.bin is a copy of a real PROM.

> we cannot pass command
> through qemu start like -option-rom or -prom-env if not using
> openbios.

We can not, because the layout is different.

> So is there a way to modify ss5.bin?

None that I know of. If you have to use the proprietary firmware
(ss5.bin, ss20.bin and so on), I think extending qemu that it persists
nvram is the way to go. I think the initialization of the nvram
happens in sun4m.c. At least it used to be there. You'd have to add
some option like -nvram=file.bin which would disable -prom-env
options.

> To add ports I am trying to modify sun4m.c and escc.c and add fields
> qemu_irq & CharDriverState to the escc_init function. Is that the
> correct way to do it?

I think so. Except that I'm not sure you have to modify escc.c. But
I'm sitting at the airport and don't have qemu sources handy.

> The point is I do not understand everything in the code (I have the
> formation but not been a developer for past couple of decade..). For
> example I don't understand the line:
> #define CHN_C(s) ((s)->chn == chn_b? 'b' : 'a')

An ESCC port has two channels (physical ports) which are called 'a' and 'b'.

Artyom


> I know Mark said we should put this cg3 and other good stuff to the
> updated version but I am powerless on this point. though I understand
> it would be very nice to boot on openbios.
>
> Thanks again for your help.
>
> Cheers all.
> Jean Michel
>
>
>
>
> Artyom Tarasenko <atar4qemu@gmail.com> a écrit&nbsp;:
>
>> ss5.bin doesn't auto detect the ports. You'll have to execute some
>> Forth commands at the OBP "ok" prompt to make them visible in the
>> device tree. Can't tell the exact commands right now. There is a free
>> book "writing device drivers" (the name might be not exact) from
>> Sun/Oracle. You can try looking up the example there.
>>
>> Artyom
>>
>> Sent from a mobile phone. Please excuse my brevity and autocorrected
>> typos.
>>
>> ----- Ursprüngliche Nachricht -----
>> Von: Jean-Michel SCHRAMM
>> Gesendet: 15.03.2013 19:02
>> An: Artyom Tarasenko
>> Betreff: adding ports to the ss5.
>>
>>
>
>
>
>


-- 
Regards,
Artyom Tarasenko

solaris/sparc under qemu blog: http://tyom.blogspot.com/search/label/qemu