[Qemu-devel] [graphic & serial on sun4m]
Hi Artyom, Thanks again for your interest. Le 07/03/2013 23:58, Artyom Tarasenko a écrit : Hi Jean Michel, On Thu, Mar 7, 2013 at 4:09 PM, Jean-Michel SCHRAMM wrote: Hello Artyom, Thanks for taking time to consider my needs for serial ports. I went on board Thalassa this morning and started the system (not easy, the ship is laid along quay hardly powered). I gathered the informations you requested. Hope this is all you need. Please ask me if I missed something. I also attach the documentation of the board. Thanks, this looks interesting. What I wonder is where are those serial ports in the device tree? Are they connected to the VME-BUS, and OBP knows nothing about them? Do you know how does the SunOS find them? The original serial ports come from a SCSI terminal server. A third party software from this terminal server maker (Central Data) is loaded at boot and create the devices /dev/ttyCx and load the proprietary driver in kernel. That's why those port are not in the devs tree. I can switch off this and replace the /dev/ttyCx with true serial ports. If it is possible to add a few ports on top on basic a & b native serial port, with custom device name, I think that could make it. But those new port has to be linked to host computer real ports to. This is far above my competence. Though I used to (long ago...) be fluent in C and could get some support here, so I could volunteer to spend time on trying if I get just information of where to start and what to alter. By the way, I just subscribed to qemu-devel (was only to qemu-discuss). Mark said we should talk on this list and get nice cg3 and cg14 Bob's cards to the current release? This is definitely a good idea. Feel free to write or add a cc to demu-devel any time. I did. Many thanks again. Jean Michel Artyom Le 28/02/2013 15:45, Artyom Tarasenko a écrit : Hi Jean Michel, On Mon, Feb 18, 2013 at 6:36 PM, wrote: Hello Bob, Of course, with your full custom 0.15.50 tree it is much much better!! Got the zip file and configure only sparc-softmmu. I undesrtand my mistake. I thought I needed only the new files from the 0.15. Thanks you for that!! Now I need at least 4 real serial port from the host up to the guest ...and network. Network must be there. The lance ethernet is emulated (except for some test/loopback registers, but SunOS can live without those). As for the serial ports, one way to proceed may be adding your machine/board to qemu. Can you provide the OBP device tree of your machine? It can be done in the OBP "ok" prompt like this: ok show-devs ok cd / ok .attributes ok cd ok .attributes The "ok " parts above would come from the OBP, you don't need to enter them. If this listing shows that the machine is close to SS-5 or SS-20, adding more serial ports should be easy. Works with SS5. With SS20, I have an error saying that it can't find cpu definitions..? (was working with other verions). see tomorrow. Have you tried -cpu "TI SuperSparc 60" ? Artyom =~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2013.03.07 11:28:14 =~=~=~=~=~=~=~=~=~=~=~= SPARC CPU-5CE, No Keyboard ROM Rev. 2.ÿNL&¾ªªrj Ethernet address 0:80:42:b:11:73, Host ID: 808b5173. Testing Memory - Initializing Memory |/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\ Type help for more information ok ok ok ok proe be-scsi Target 3 Unit 0 Disk QUANTUM VIKING II 4.5WLS5520 981006194912942263 Target 5 Unit 0 Device type 9 CenData ST-1008 V2.8 Send LUN Unit 1 Device type 9 CenData ST-1008 V2.8 Recv LUN ok shox-devs w-devs /FMI,MB86904 /sysconfig@0,7138 /virtual-memory@0,0 /memory@0,0 /obio /iommu@0,1000 /openprom /aliases /options /packages /obio/flash-memory@0,7130 /obio/SUNW,fdtwo@0,40 /obio/power@0,91 /obio/interrupt@0,e0 /obio/counter@0,d0 /obio/auxio@0,90 /obio/slavioconfig@0,80 /obio/eeprom@0,20 /obio/zs@0,0 /obio/zs@0,10 /iommu@0,1000/VME@0,3fe0 /iommu@0,1000/sbus@0,10001000 More [,,q] ? /iommu@0,1000/VME@0,3fe0/vmenet@2d,0 /iommu@0,1000/sbus@0,10001000/le@3,c0 /iommu@0,1000/sbus@0,10001000/cgsix@2,0 /iommu@0,1000/sbus@0,10001000/ledma@5,8400010 /iommu@0,1000/sbus@0,10001000/SUNW,bpp@5,c80 /iommu@0,1000/sbus@0,10001000/espdma@5,840 /iommu@0,1000/sbus@0,10001000/ledma@5,8400010/le@5,8c0 /iommu@0,1000/sbus@0,10001000/espdma@5,840/esp@5,880 /iommu@0,1000/sbus@0,10001000/espdma@5,840/esp@5,880/st /iommu@0,1000/sbus@0,10001000/espdma@5,840/esp@5,880/sd /packages/obp-tftp /packages/deblocker /packages/disk-label ok cd / ok .attributes modelSPARC CPU-5CE/32-85-X clock-f
Re: [Qemu-devel] cg6 implementation in QEMU
Hi Artyom, Hi Artyom, Thanks again for your interest. Le 07/03/2013 23:58, Artyom Tarasenko a écrit : Hi Jean Michel, On Thu, Mar 7, 2013 at 4:09 PM, Jean-Michel SCHRAMM wrote: Hello Artyom, Thanks for taking time to consider my needs for serial ports. I went on board Thalassa this morning and started the system (not easy, the ship is laid along quay hardly powered). I gathered the informations you requested. Hope this is all you need. Please ask me if I missed something. I also attach the documentation of the board. Thanks, this looks interesting. What I wonder is where are those serial ports in the device tree? Are they connected to the VME-BUS, and OBP knows nothing about them? Do you know how does the SunOS find them? Great step forward yesterday. I can now pass a serial port to the guest SS5, rename the device ttya to the expected name and then I can communicate with the software!!! This is really great! So I come back to you about your proposal to add serials ports to the emulated ss5. This is just what I need now to go forward. Could you please just give me the start point so hopefully I could give a try? Does only sun4m and escc.c need to be modified? Or is that much more complex? Thank you for your answer. I am now so close to succeed ! (well, still need network, haven't had a look at that issue yet) Kind regards, Jean Michel Le 28/02/2013 15:45, Artyom Tarasenko a écrit : Hi Jean Michel, On Mon, Feb 18, 2013 at 6:36 PM, wrote: Hello Bob, Of course, with your full custom 0.15.50 tree it is much much better!! Got the zip file and configure only sparc-softmmu. I undesrtand my mistake. I thought I needed only the new files from the 0.15. Thanks you for that!! Now I need at least 4 real serial port from the host up to the guest ...and network. Network must be there. The lance ethernet is emulated (except for some test/loopback registers, but SunOS can live without those). As for the serial ports, one way to proceed may be adding your machine/board to qemu. Can you provide the OBP device tree of your machine? It can be done in the OBP "ok" prompt like this: ok show-devs ok cd / ok .attributes ok cd ok .attributes The "ok " parts above would come from the OBP, you don't need to enter them. If this listing shows that the machine is close to SS-5 or SS-20, adding more serial ports should be easy. Works with SS5. With SS20, I have an error saying that it can't find cpu definitions..? (was working with other verions). see tomorrow. Have you tried -cpu "TI SuperSparc 60" ? Artyom
Re: [Qemu-devel] adding ports to the ss5.
Le 18/03/2013 14:27, Artyom Tarasenko a écrit : Back to Europe from the Great Baikal lake. Nice... :-) 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. OK, great info. I might try this when I will succeed getting new serial port to the prom. Please publish the code to the qemu-devel list, if you make it. Arg! Unfortunately I think it is beyond my competences but I will give a try. Another way would be to push Bob's upgrades, among them cg3.c to the update qemu. So we could use openbios as Mark said and pass the command in the script. Well, I thought I had to had fields to the escc_init function because I was understanding qemu_irq & CharDriverState fields as ttya and ttyb description. But I understand from your answser that I was confused by the a & b channel for an escc port? But then where are the two intitialisation of ttya and ttyb? Well the channels a and be are the ttya and ttyb (except that I'm not sure whether the channel a is ttya or ttyb at the end). OK so it's like one Zylog port with two channels..? I think I lack understanting of this: slavio_serial_ms_kbd_init(hwdef->ms_kb_base, slavio_irq[14], display_type == DT_NOGRAPHIC, ESCC_CLOCK, 1); // Slavio TTYA (base+4, Linux ttyS0) is the first Qemu serial device // Slavio TTYB (base+0, Linux ttyS1) is the second Qemu serial device escc_init(hwdef->serial_base, slavio_irq[15], slavio_irq[15], serial_hds[0], serial_hds[1], ESCC_CLOCK, 1); Especially the coment (no much comment in there :-) ) base+4 and base+0. I can't see where this is defined. hwdef->serial_base is the physical address of the serial port ttyb. And hwdef->serial_base+4 is the address of ttya. OK, I got the comment but I cannot see where this is done. I mean where is it define in the code that base+4 address. The only parameter which is passed to escc_init is base. I guess you just need a couple of more calls to escc_init with the different base address and irq, incrementing serial_hds[] all the time. Don't know how many ports can share the same irq line - there may be limitations both on qemu and SunOS sides. Now that I had got the network working through a bridge, I have started work on this issue this afternoon. Alternatively, you can use the PC rs232 ports. If SunOS 4.x does support them. I've never saw them in the real sun4m machines. In the sun4u device tree they are called "su". (The escc ports are called "zs" - which I believe is the short form of "Zilog Serial"). ? I'll have a look at sun4u.c Thanks again, Cheers, Jean Michel Artyom Artyom Tarasenko a écrit : 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
[Qemu-devel] Fwd: Re: AW: adding ports to the ss5.
Message original Sujet: Re: AW: adding ports to the ss5. Date : Sun, 17 Mar 2013 18:34:20 +0400 De :Artyom Tarasenko Pour : jean.michel.schr...@genavir.fr Copie à : breuerr , "mark.cave-ayland" Hi Jean Michel, On 3/17/13, jean.michel.schr...@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 a écrit : 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