Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
155 user(s) are online (101 user(s) are browsing Forums)

Members: 2
Guests: 153

jarokuczi, flash, more...

Headlines

 
  Register To Post  

« 1 ... 25 26 27 (28) 29 30 31 ... 72 »
Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


See User information
@joerg
Quote:
Voodoo 1 and 2 were 3D add-on cards only and need another VGA card, but Voodoo 3/4/5 are complete gfx cards incl. VGA: https://bochs.sourceforge.io/doc/docbook/user/voodoo-notes.html

OK, in that case @geennaam using x-vga=on with a with a Voodoo 3 is likely correct and proves that this option may do something and work at least for some cards but probably needs fixing for older Radeon cards as said in the comment. It may worth a try if somebody wants to find out what the comment means and try to come up with a patch and see if that helps.

Go to top
Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


See User information
@balaton

Quote:

I've asked what errors you get if you only have ATI 9250 with x-vga=on and no other VGA in the system, I know that does not work but I'd need the errors to find out why as I think that's how it sohuld work and not how you managed to get past it as then it did not work so that may not be a viable work around if the problem is elsewhere.


It will immediately result in a segmentation fault (core dumped) and then Qemu is terminated . So no qemu serial or monitor output.


Edited by geennaam on 2023/7/3 20:17:04
Go to top
Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


See User information
@balaton
Quote:

For RadeonHD/RX cards I was suspecting it's a problem with 64 bit BARs and in that case I'm not sure it can be fixed because the pegasos2 is a 32 bit system so there may not be enough space in the memory map to map these even if the PCI controller may support these (which probably it doesn't as I did not expect it to be needed so maybe the Marvell emulation may also need to be checked for this). The X5000 and sam460 may use newer CPUs that at least have larger virtual address spaces which may be needed.


I doubt that this is the issue. I am able to use a Radeon R9 270x in a an old SAM440ep with just a PCI to PCIe bridge.


Edited by geennaam on 2023/7/3 20:17:34
Go to top
Re: What the fastest possible x64 emulation way of OS4 today ?
Just can't stay away
Just can't stay away


See User information
@geennaam
Quote:
I doubt that this is the issue. I am able to use a Radeon R9 270x in a an old SAM440ep with just a PCI to PCIe bridge.
The 440 supports 41 bit (2 TB) virtual and 36 bit (64 GB) physical address space.
I don't know anything about the Pegasos2, but maybe some part(s) of it is/are limited to 32 bit (4 GB)?

Quote:
A Radeon 9250 works on a real pegasos. So there must be something in the qemu emulation going wrong.
balaton found something already, IO and MMIO using the same code which of course can't work because the AmigaOS driver switches MMIO to big-endian but IO always stays little-endian. The segfault is something unrelated, though.

Go to top
Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


See User information
@geennaam
Yes getting a core dump should allow further debugging. You could run qemu under gdb prepending gdb --args before the qemu command line then run from gdb and you can get a backtrace with br when it crashes. If it stops on USR1 signal you have to get gdb ignore that as QEMU uses it internally. There's some docs on this somewhere but I think there's some config in QEMU source tree that will handle this if you run qemu-system-ppc from build dir. So something like:
gdb --args qemu-system-ppc ...
(gdb) r
SEGV
(gdb) bt
to get useful backtrace you may need to configure --enable-debug and recompile first. To get more detailed backtrace "bt full" can be used but that may not be needed first. If it's in a different thread you may need to get backtrace from those but I think gdb will stop in the thread it crashed so just bt should be enough to get a relevant backtrace. Also if there were any error messages before the crash that may help.

The command to tell gdb to ignore SIGUSR1 is "handle SIGUSR1 noprint" I always have to find it again.

Go to top
Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


See User information
@joerg
Quote:
balaton found something already, IO and MMIO using the same code which of course can't work because the AmigaOS driver switches MMIO to big-endian but IO always stays little-endian. The segfault is something unrelated, though.

The IO and MMIO sharng (and lack of big endian support for MMIO) is related to the emulated ati-vga so it's not relevant for passing through a real card. For pass through 9250 I think it may be related to x-vga option with older cards if the card ROM needs to access those regs for propert init but I'm not sure.

Go to top
Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


See User information
@balaton

I will be a Linux guru as well at the end of this thread


Edited by geennaam on 2023/7/3 20:18:06
Go to top
Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


See User information
@geennaam
Looks like it's liekely related to what I thought. If you read the backtrace the part where it's called is in vfio_probe_ati_bar4_quirk at ../hw/vfio/pci-quirks.c:471 which is where the comment says it won't work for older cards that don't have BAR4 so this function should be fixed first. I don't know what it does or what it should do so if somebody wants to have a look and find out then go ahead. I'm still looking at sam460 PCIe emulation.

Reading the comment refers to PCI config space access via the MMIO registers BAR and indexed access via the IO BAR. SImilar exists for older ati cards and it's documented somewhere but the offsetts are different. It is implemented in ati-vga, the 0/4 MM_INDEX/MM_DATA regs are the same, The IO BAR allows accessing the first 0x100 regs of the MMIO BAR and there's a read only mirror of PCI cfg regs int the MMIO BAR at offset 0xf00 ... 0xfff as can be seen in qemu/hw/display/ati-vga.c (although without me explaining it here it might be hard to find). I think that's what the function should do then: Use BAR2 for MMIO and implement config reg access at 0xf00 instead of 0x4000. Anybody wants to try to implement that?

As a first try just to test the theory you may try to not care about newer cards and just change the existing functions for older cards. Of course you need to read that code and understand what it does first at least roughly. Then if that works with older cards come up with a patch that does not break newer cards but makes it work with older ones too.

Also try runing with -trace enable="vfio_quirk*" to see which of these quirk functions are called for ATI there are more which may need tweaking but comments mention X550 where changes needed which aparently works like all older Radeon cards as it matches what I had in ati-vga. I actually have an X550 card so I could test this but it's not in my machine and don't have time anyway. Besides the X550 is not supported by Amiga like OSes so I could only test with Linux so I let this open for others to try to fix.


Edited by balaton on 2023/6/30 20:40:57
Edited by balaton on 2023/6/30 20:46:27
Go to top
Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


See User information
@balaton

Quote:
I'm still looking at sam460 PCIe emulation


Yes, I agree. This is the only way forward.

Go to top
Re: What the fastest possible x64 emulation way of OS4 today ?
Home away from home
Home away from home


See User information
@balaton

Quote:
@geennaam
For RadeonHD/RX cards I was suspecting it's a problem with 64 bit BARs and in that case I'm not sure it can be fixed because the pegasos2 is a 32 bit system so there may not be enough space in the memory map to map these even if the PCI controller may support these (which probably it doesn't as I did not expect it to be needed so maybe the Marvell emulation may also need to be checked for this). The X5000 and sam460 may use newer CPUs that at least have larger virtual address spaces which may be needed.


64-bit PCI cards are backward compatible. I first started using them in an A1-XE, which is of the same era as the Pegasos-II. All the firmware has to do is treat it as a 32-bit card (ignore the 64-bit addressing bit, and set the upper 32-bits to 0).

The A1-XE clearly did this, because the resource ranges are present. What's uncertain here, is whether it's the Pegasos II firmware that's at fault, or the vfio passthrough. We'd need to somehow check how those BARs behave when they're read & written.

Quote:
But @kas1e said this somehow works on microA1 which is similar to pegasos2 so maybe it's possible but I've found no info on that so I don't know how that's done. Maybe Hans can fix this in his Radeon drivers and already works on it. If it turns out there's some issue in the pegasos2 emulation I can look at that if somebody finds out what's needed.

Fixing this from the drivers isn't realistic. The OS reports that BAR0 & BAR2 don't exist. I could directly read the BARs from their PCI configuration registers, but then I'd have to somehow find and claim an empty space within the 32-bit address space to put it in.

The firmware is supposed to allocate address space. If it doesn't, then the bootloader would be the next appropriate place to do so.**

Hans


** Some graphics cards can resize the VRAM BAR so that more of VRAM is visible. I'm guessing that the OS usually does this in the bootloader. It's a lot easier to do with a 64-bit address space...

http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more.
https://keasigmadelta.com/ - more of my work
Go to top
Re: What the fastest possible x64 emulation way of OS4 today ?
Just popping in
Just popping in


See User information
@balaton

Wow this topic has taken off.

Quote:
Yes I think I meant ub2lb/parthenope when I said AROS bootloader. But doesn't that just load amigaboot file and launches it? Does it replicate what amigaboot does and loads the kernel modules itself? I've looked at the source but it's not very clear.


No, it can do what amigaboot does, all self contained. So yes it can replicate amigaboot but it did lack FFS2 support. It can do the job of what SLB can do, which would predate amigaboot, on the A1 and Sams. And yes, the parthenope one, as it's also called. I looked at the code years ago. It does load in the kernel modules then launch it. By jumping to the loader code module somehow.

Apart from making AROS bootable it has better support for booting Linux. SLB can boot Linux from simple one liner kernel and options, but ub2lb is slightly more complex like GRUB and has more options. I modified it for use when building a Linux installer on the XE so it would auto boot into menu.

Now, I see you are familiar with the source since you discovered it crashes in the start_unit_scan() debacle from a NULL pointer, after Googling that function. I knew about this. I'm sure I posted about this years ago on AmigaWorld.

Okay just checked and I did in 2017. Found a thread. Sorry link bombing here:
https://amigaworld.net/modules/newbb/v ... wmode=flat&order=0#801942
https://amigaworld.net/modules/newbb/v ... wmode=flat&order=0#801965
https://amigaworld.net/modules/newbb/v ... wmode=flat&order=0#801974
https://amigaworld.net/modules/newbb/v ... wmode=flat&order=0#801993

Quote:
The Open Firmware part is clear to me. I tested amigaboot.of with the minimal open firmware in QEMU and know what it misses to run and what OF client interface functions it uses but I don't know what it does with the data it retrieves from OF. That is what kind of structure should it build from the OF device tree and how should it pass to the kernel. So I'd need more info on that part, all the others I don't care about.


I'm not certain if it builds anything from the device tree. The loader at the end can look up the tree itself if it needs too. But the Kick modules are all self contained in that the core ones are compiled for the machine they run on. I don't see a way to pass dynamic strings or objects. Extra options are in nvram variables or embedded in a module as text. I don't even think modules can be passed arguments like a normal command. Fairly rigid design.

But yes what's needed is the data that's passed down the line.

The Kicklayout can be slightly misleading as the comments mention EXEC being the name of the main kernel to use that contains exec.library. This not quite correct. EXEC points to a loader that launches the kernel. The kernel module contains exec.library. The EXEC file doesn't contain the kernel at all in the common configuration.

Quote:
The different versions are probably just to talk to the different firmwares in these machines. There are at least 3 kinds of firmware interfaces so there are that many boot loader versions but these likely only differ in the firmware side which I know for OF, I only need info on the kernel facing side that makes the module list in memory and prepares the info about the machine and starts the kernel. I'd look for info, docs or hints on that, the rest I can handle.


Yes that is the core info you need. And refreshing myself with the ub2lb code it looks like it has almost everything you need. I didn't see it before. It's just slightly complicated looking as it supports 4 things for booting; generic, OS4, AROS and Linux. So it reads in the Kicklayout from menu_load() and then in testboot_aos() it builds the module list. But, this is where I was lost, it loads in the EXEC loader separately and stores it as kernel. Usually this would be first module and also stored in the module list. I'm unsure about the module ID and flags but what is referred to as ID could be file type. So ID could be for binary or data. The struct module you need is in here.

https://github.com/cjg/ub2lb/blob/master/src/parthenope.c

What needs to be checked is register parameters which would differ in OF ABI. IIRC it's something like; R3* OS string, R4* module list, R5* OF hook.

Quote:
OK then maybe there are only two versions, one for OF and one for U-Boot wuth the U-Boot part already open source but that's not too interesting.


Likely the CFE/X1000 amigaboot is based directly off the Pegasos one. Don't know who made the firmware that way apart from Varisys but OF was hacked into CFE and they kept it that way. This would have made it easier to port and existing amigaboot over and at least two code bases could be merged. On the X5000, the modern UBoot supports OF basics like trees, since OF is so entrenched in PPC and being UBoot is made for Linux, it made sense. This would make it easier to port it as an amigaboot.ub since they can share the same code base. Right now Trevor owns ExecSG and amigaboot with it.

Quote:

I'd need the interface between amigaboot.of and loader.of and to know what structures in memory loader.of needs and where to pass them. The rest is just firmware dependent or trivial.


The list structure (which is an AmigaOS list) will be above with the module structure as nodes. Where they are passed as parameters needs to be checked.

I actually wrote my own CFE emulator when testing a few years back that emulated OF hooks. It could run amigaboot up to a point. Enough to see what it was doing. It was a bit of a hack as it intercepted DSI crashes since the memory mapped differs. But the range was known. Be more cleaner if it used MMU but it did the job. Should clean up source and release it as experimental emulator.

Quote:
Yes this is the part that would be interesting if it was documented in a bit more detail.


Against all odds it turns out parthenope is your friend.

Quote:
quiesce is the OF client interface word for closing down and stop using firmware services after boot so it's not just how Linux calls it. The OF client interface is well documented in its standard.


I see. I wonder if OS4 kernel uses it as well? It could be hidden.

I struggled to find basic technical info years ago about the ABI. Such as the OF hook being in R5. For some reason I just couldn't find the ABI layout. I suppose if you have something like "void *, void *, (*)()" R5 will be hidden. Don't recall exactly. But I do recall I could never figure the memory allocator out. It seemed to be too technical and needed hand holding with memory ranges or something. I expected something like a malloc() that was self managed. I wanted to program OF to allocate some memory. In the end I gave up and just wrote my own allocator using a preset range.

Quote:

I'm not sure about that part, I think I'm still missing the structs and calling convention of loader.of to be able to reimplement amigaboot.of.


Here's an amigaboot.of chain loader.

https://forum.hyperion-entertainment.com/viewtopic.php?t=4672

Quote:
Since yaboot probably can't load AmigaOS I don't think it would help much.


No but it does reveal one clue about the Pegasos. The Pegasos is the only platform here with CHRP support that was officially supported by Linux PPC install CDs. They contained extra scripts in FORTH that loaded in a CHRP kernel and booted it. It also needed the extra kernel but it had support. Unlike other platforms like the A1/XE which had no support on official releases. Likely because UBoot was totally different and had no OF emulation. Having built an installer CD for the XE it would be way over the scope of a simple configuration since it needed a fully custom kernel and modules. Though the PegXMac Mac emulator CD did manage to support both Pegasos and XE with one boot CD.

Go to top
Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


See User information
@geennaam
Quote:
geennaam wrote:@balaton
Quote:
I'm still looking at sam460 PCIe emulation

Yes, I agree. This is the only way forward.

It's not the only way forward and fixing the x-vga problem would be needed for older PCIe Radeon cards as well even on sam460ex. But since it's a config that works with real hardware if I can emulate that then it could at least provide some way to cross check other attempts.

But I could not find any documentation on how PCIe works on 460EX, the only info I have is the u-boot sources that's not very useful as a lot of detail is missing and it handles different variants so it's hard to follow. I could make some progress with u-boot now able to see an ati-vga on pcie on sam460ex but it can't fully detect or use the card yet. Since we have only a bit more than a week left until QEMU freeze (https://wiki.qemu.org/Planning/8.1) I won't be able to make this work, clean up to submit then get reviewed and merged in the remaining tine so this would miss 8.1 anyway so I'll have time to find this out later. So I'll keep trying on and off but this could take a while and it won't be in a release before December.

This may not even be needed if HD cards can be made working with pegasos2 which would be better anyway because pegasos2 is faster. So I think getting PCIe with sam460ex working is interesting but maybe not the highest priority now.


Edited by balaton on 2023/7/2 14:05:42
Go to top
Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


See User information
@Hans
Quote:

64-bit PCI cards are backward compatible. I first started using them in an A1-XE, which is of the same era as the Pegasos-II. All the firmware has to do is treat it as a 32-bit card (ignore the 64-bit addressing bit, and set the upper 32-bits to 0).

The A1-XE clearly did this, because the resource ranges are present. What's uncertain here, is whether it's the Pegasos II firmware that's at fault, or the vfio passthrough. We'd need to somehow check how those BARs behave when they're read & written.

I think vgio pass through should be working as it's used for passing through stuff with other machines and it worked for a while to run Windows VMs with GPUs so I don't think it could be a problem with that. It's either someting in pegasos2 emulation or in the pegasos2 firmware. We're also passint through a PCIe card to a PCI bus without a bridge so I'm not sure how that should work but it could be that the pegsos2 firmware can't handle 64 bit bars. Maybe this could be debugged by checking what the firmware has about the card in the device tree. I've asked for .properties output before in post #417 but I haven't seen a result posted.

Quote:

Fixing this from the drivers isn't realistic. The OS reports that BAR0 & BAR2 don't exist. I could directly read the BARs from their PCI configuration registers, but then I'd have to somehow find and claim an empty space within the 32-bit address space to put it in.

The firmware is supposed to allocate address space. If it doesn't, then the bootloader would be the next appropriate place to do so.


The firmware allocates space for PCI as can be seen in the ourput in post #436 and after that. The pci1-mem is the PCI memory space for PCI slots, pci0-mem is AGP memory BARS and in the system view these are mapped from 0x80000000 and 0xc0000000 where tha BARs show would show up. So you could check what else on the same bus is mapped and find a free space in the window for that and program the BAR accordingly. The IO space bars work similarly and you can see where they are mapped in the info mtree output.

But once we have a replacement amigaboot.of that we can modify it may be possible to patch things from there so no modification to the drivers are needed. So maybe I should look at the bootloader next as that seems to be useful to resolve several problems at the same time.

Go to top
Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


See User information
@Hypex
Yes, thanks, I've also found that function later in parthenope and saw it loads modules and calls the exec binary so maybe I can start from that.
I'm not familiar with the source just found a bug when trying to boot AROS on the sam460ex emulation which I did to check it so I had to fix the bug first to get it load.
I think the OF ABI on what a binary run by the firmware gets is documented either in some OF standard or in CHRP but for me the easiest is to look at QEMU VOF:
https://gitlab.com/qemu-project/qemu/- ... master/pc-bios/vof/main.c
https://gitlab.com/qemu-project/qemu/- ... ter/pc-bios/vof/bootmem.c
so according to that it would be
(*kernel_addr)(initrd_addr, initrd_size, CI_entry); in r3, r4, r5
so I can start from that and see if I can get ti boot or do something at least.

Go to top
Re: What the fastest possible x64 emulation way of OS4 today ?
Home away from home
Home away from home


See User information
@balaton
Quote:

Maybe this could be debugged by checking what the firmware has about the card in the device tree. I've asked for .properties output before in post #417 but I haven't seen a result posted.


Will this kind of information of any help, if i will buy some agp-pcie bridge and put real radeonhd into real pegasos2 ?

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


See User information
@balaton

Never mind


Edited by geennaam on 2023/7/2 10:19:24
Edited by geennaam on 2023/7/2 10:37:03
Edited by geennaam on 2023/7/3 20:19:25
Go to top
Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


See User information
@geennaam
Quote:
reg                   2:0
                      xp2
,0,10,0:10000000
                      xp2
,0,18,0:200000
                      i2
,0,20,0:100
                      m2
,0,24,0:40000
                      m2
,0,30,0:20000
assigned
-addresses    xp2,0,10,90000000:10000000
                      xp2
,0,18,80200000:200000
                      i2
,0,20,FE001200:100
                      m2
,0,24,80080000:40000
                      m2
,0,30,80020000:20000

Thanks. Looks like the firmware part may be OK. In the above it shows it recognised the 64 bit BARs and also mapped them according to assigned addresses. The docs https://www.openbios.org/data/docs/bus.pci.pdf on page 7 say what these mean and x denotes 64 bit BAR. So likely it's whatever reads this info from the firmware and creates the AOS info from it that later the OS uses needs to be checked if that handles 64bit BARs correctly. Is that loader.of? Does the A1 XE where this supposedly works use different version of that loader or gets device info differently? If the firmware already handles it correcly then it's likely not fixable from the boot loader above AOS because it seems the firmware already passes this info down. (Unless you consider loader.of part of the boot loader but I only mean the first exe loaded by the firmware under as boot loader which is amigaboot.of here.)

@kas1e
Quote:

Will this kind of information of any help, if i will buy some agp-pcie bridge and put real radeonhd into real pegasos2 ?

Only for cross checking the above and maybe testing a fix later if one will be available, otherwise I'd expect to get the same results as with QEMU above.

Go to top
Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


See User information
@balaton

Just guessing here. But I think that this would be the os4 kernel itself.

Go to top
Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


See User information
@kas1e
Quote:
otherwise I'd expect to get the same results as with QEMU above

Thinking about it some more maybe it's not the same on real hardware because there something should handle the bridge as well and @Hans told before this might be a problem with pegasos2 firmware. Maybe this could be tested on QEMU too by using similar config, so on an older machine with PCI passing through a bridge but finding a machine with PCI and VT-d may not be that simple. One could try with a PCIe to PCI then PCI to PCIe bridge and pass through the latter but this seems to be quite doubdtful config that can be hard to tell why it broke if not working. So maybe this won't work on real pegasos2 unless something can handle the bridge there. If SmartFirmware does not have code for that then it may not see the card.

@geennaam
Quote:
Just guessing here. But I think that this would be the os4 kernel itself.

Since it works on A1 XE the kernel and OS itself should be able to handle it but it seems to be somewhere in AOS4 code not outside of it so they should have a look and see if it's fixable there.

Go to top
Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


See User information
@balaton

I've cross checked the info with a HD4850 and RX 580.


Edited by geennaam on 2023/7/3 20:20:03
Go to top

  Register To Post
« 1 ... 25 26 27 (28) 29 30 31 ... 72 »

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project