Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
89 user(s) are online (57 user(s) are browsing Forums)

Members: 2
Guests: 87

Lio, AlfredOne, more...

Headlines

 
  Register To Post  

« 1 ... 34 35 36 (37) 38 39 40 ... 72 »
Re: What the fastest possible x64 emulation way of OS4 today ?
Home away from home
Home away from home


See User information
@balaton
Quote:

radeon9250 does not have 64 bit BARs so all this is not needed for that. If you connect an HD card with a PCI to PCIe bridge to the PCI bus that will show up in /pci but your AGP card is on the other PCI bus. Try ls / and check the other bus which may be /pci@80000000 or something where display should show up.


Yeah, all tests can be done once bridge arrived. But just for sake of filling gap, for Radeon9250 on real pegasos it's /pci@C0000000 , the /pci@8000000 is for general stuff like fireware, isa, ide, usb, sound and co:

80000000:

ok ls /pci@80000000
host
@0
firewire
@1
isa
@C
ide
@C,1
usb
@C,2
usb
@C,3
other
@C,4
sound
@C,5
pci1106
,3068@C,6
ethernet
@D
ok



C0000000:

ok ls /pci@C0000000
host
@0
display
@8
display
@8,1
ok


Dunno why there 2 displays, but that what each of them show:

That for display@8:

ok dev /pci@C0000000/display@8
ok 
.properties
vendor
-id             0x1002 (4098)
device-id             0x5960 (22880)
revision-id           0x1 (1)
class-
code            0x30000 (196608)
subsystem-id          0x148C (5260)
subsystem-vendor-id   0x2093 (8339)
.
vendor-name          "ATI"
.class                "Display Controller"
.subclass             "PC Compatible"
interrupts            0x1 (1)
devsel-speed          0x1 (1)
66mhz-capable
fast
-back-to-back
min
-grant             0x8 (8)
max-latency           0x0 (0)
rom                   [0x20000 bytes]
        [
00055AA68E9 89060000 00000000 00000000
        
[01000000000 00000000 84010000 00004942
        [
0204D000000 00000000 00000000 00000000
        
[03020373631 32393535 32300000 00000000
        
[0403F3F0000 00000000 16010000 00000000
        
[05032303034 2F31322F 32322030 323A3031
        
[06000000000 E90C1300 E9B21E00 00000000
        
[07044764E37 108C1493 20000000 00000000
        
[080] 0D0A5261 64656F6E 20393235 30203235
        
[090] 364D4220 31343843 2D504143 32324246
        
[0A0412E5345 412D3831 37443136 0D0A0028
        
[0B043292031 3938382D 32303033 2C204154
        
[0C049205465 63686E6F 6C6F6769 65732049
        
[0D06E632E20 424B2D41 54492056 45523030
        
[0E0382E3031 37442E30 31362E30 30300020
        
[0F050414332 32424641 2E534541 20763631
        
[10031200056 32383041 47502044 47443155
        
[1104E000090 6C0008A0 00000811 6C00331F
        
[120745AA002 AC01EF00 80000301 000000C0
        
[13000F08C14 93206059 00000000 00000000
        
[1403D78A66D 390D1609 AFC30E06 FC050000
        
[15024545653 BFC30000 00000000 C004DA05
        
[160277F0000 AD030606 B1050000 00000000
        
[17000000000 EC010202 00000000 00000000
        
[1809B020000 50434952 02106059 00001800
        [
19000000003 68001108 00800000 41544920
        
[1A052414445 4F4E2039 32303000 0C0C0000
        
[1B000000000 60F41800 94AEF91A 00DD134E
        
[1C06097586F 6E4D7FE0 00000000 00000000
        
[1D000000000 00F40000 00000000 00000000
        
[1E000000000 00000000 00000000 01010F53
        
[1F0047504FB 01000000 00000001 01320032
[skipped]

name                  "display"
reg                   8:0
                      mp8
,0,10,0:8000000
                      i8
,0,14,0:100
                      m8
,0,18,0:10000
                      m8
,0,30,0:20000
assigned
-addresses    mp8,0,10,C0000000:8000000
                      i8
,0,14,F8001000:100
                      m8
,0,18,C8000000:10000
                      m8
,0,30,C8020000:20000


And that for display@8,1:

ok dev /pci@C0000000/display@8,1
ok 
.properties
vendor
-id             0x1002 (4098)
device-id             0x5940 (22848)
revision-id           0x1 (1)
class-
code            0x38000 (229376)
subsystem-id          0x148C (5260)
subsystem-vendor-id   0x2092 (8338)
.
vendor-name          "ATI"
.class                "Display Controller"
.subclass             "Other"
devsel-speed          0x1 (1)
66mhz-capable
fast
-back-to-back
min
-grant             0x8 (8)
max-latency           0x0 (0)
name                  "display"
reg                   8,1:0
                      mp8
,1,10,0:8000000
                      m8
,1,14,0:10000
assigned
-addresses    mp8,1,10,D0000000:8000000
                      m8
,1,14,C8010000:10000
ok


But anyway all will be inetersting once i get bridge..

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
@Maijestro
You can get more info from QEMU on what the driver tries to do with -trace enable="ne2000*" then find some docs of RTL8029 and try to make sense of the communication and see if some error can be spotted there. This could be easier if the AmigaOS driver source was available but it could be similar to other open source drivers for this card like that found in some BSD unices. QEMU emulates a generic NE2000 which the the RTL8029 should be compatible with but maybe the Realtek device has some peculiarity that the driver expects but QEMU does not emulate. If we find what is that it might be added to QEMU.

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
@balaton
Except for onboard ethernet controllers the RTL8139 is the most used PCI ethernet controller on AmigaOS systems, therefore I doubt the problems are something in the AmigaOS driver.
The main difference in the RTL 8029 and 8139 drivers is that AFAIK the 8139 one uses DMA, while the 8029 is PIO-only, which should be much easier to emulate.

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


See User information
@geennaam
To debug the DMA issue further maybe we would need at least this info:
- command line you used to start qemu
- the output you got
- info mtree and info pci output after booting AmigaOS where the errors happen.
I know you've posted these before but never all of them from one run so I have some command lines but don't know which one used when saw the errors (in particular did you have VGA or not x-vga or not, if you still using VGA and x-vga=off then I believe that's an invalid config that can't work because the card ROM can't talk to the VGA part of the card that way). And bacause of the previous ambiguities I don't know if for example vga parts shown in an info mtree output comes from where.

Since x-vga does not work with older Radeons you can't use that so you should try without x-vga but also not adding VGA and see if the driver can init the card. If that does not work then try fixing x-vga so the card's VGA regs show up in the guest. I don't think other way might work. What I think might be happening is that unlike the RadeonHD/RX driver the Radeon driver can't init the card because these cards predate AtomBIOS so there's no other way to do the init than running the card ROM. The card ROM can't run because it may need the VGA regs that x-vga would solve but that needs to be fixed. You were able to get past the ROM by adding VGA device but that results writes to VGA regs go to the emulated VGA card and writes to PCI regs go to the passed through card and if writes to VGA regs are also needed to propetly init the card then this won't work until x-vga is fixed. Fixing that may not be that hard if all it needs to do is to use BAR1 for the io BAR instead of BAR4 so you may try that for testing even if it breaks HD cards then if that works come up with a patch that works with both. Hope this makes sense and I could explain what I think.

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


See User information
@joerg
Also QEMU emulates a lot of systems and all of them can use rtl8139. While it may not be the default and because of that less tested it should work with all other guest OS drivers in Windows, linux and I know people used it with MacOS on qemu-system-ppc too so then it's more likely to either something with AmigaOS driver or with the pegasos2 emulation than the rtl8139 emulation.

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
@balaton
If the RTL8139 emulation works on all other guest OSes it's probably related to the Pegasos2 emulation, especially DMA related parts since there were some "Failed to initialise Radeon DMA" errors as well. AmigaOS Radeon drivers need DMA (and CCE, and and least some executing the BIOS with a x86 emulator by the firmware), and the RTL8139 driver needs DMA as well.
Like with the gfx drivers the MorphOS RTL8139 driver might have some PIO fallback code if DMA doesn't work, just like the MorphOS gfx drivers do, but the AmigaOS drivers don't.

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


See User information
@balaton

X-vga is always needed when you want to show the bootloader output on the display output of the gfx card. Somehow only DVI works for me on all cards except the voodoo3 which only has vga.

The effect can be seen seen on the uboot output. It shows something like
VGA: 1
VESA: ok

X-vga causes a crash on the Radeon 9250 and Sam460. But the quick and dirty in the qemu source code fixes this. But maybe I have to see what this quirk is meant to fix anyways.

I am nowhere near my computers this weekend so I cannot paste the commandlines and outputs.

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


See User information
@joergQuote:
joerg wrote:@balaton
If the RTL8139 emulation works on all other guest OSes it's probably related to the Pegasos2 emulation, especially DMA related parts since there were some "Failed to initialise Radeon DMA" errors as well. AmigaOS Radeon drivers need DMA (and CCE, and and least some executing the BIOS with a x86 emulator by the firmware), and the RTL8139 driver needs DMA as well.
Like with the gfx drivers the MorphOS RTL8139 driver might have some PIO fallback code if DMA doesn't work, just like the MorphOS gfx drivers do, but the AmigaOS drivers don't.


I think they might be right, since this driver is used extensively under AmigaOs4.1 and has also been tested.

@balaton

The rtl8139 driver under Qemu works fine so far, but I can also confirm that my network crashes from time to time for no apparent reason. The only solution then is not to restart AmigaOs4.1. I have to quit Qemu completely and restart. Which suggests that Qemu or the Pegasos emulation have a problem with the rtl8139 somewhere.

We should investigate this in parallel to the PCI passthrough story probably there is also a connection that the passthrough cards break in connection with the network or AmigaOs4.1 freezes.

I have asked before that we should investigate the problem with rtl8139 driver under Qemu, unfortunately I don't know exactly how we could do that.


Edited by Maijestro on 2023/7/7 19:31:49
MacStudio ARM M1 Max Qemu//Pegasos2 AmigaOs4.1 FE
Go to top
Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


See User information
@joerg

Iirc at least the RadeonRX depends on the vbios to reset and initialize the card. Atombios is not enough. This was the reason why soft resets don't work.

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


See User information
@MartinW

Your "fixup script" is a static script with hard-coded values that you have stored next to Amigaboot.of?

Or is it something that you enter line by line on the of command prompt?


Edited by geennaam on 2023/7/7 20:04:16
Go to top
Re: What the fastest possible x64 emulation way of OS4 today ?
Not too shy to talk
Not too shy to talk


See User information
It’s the first. So I get to the of prompt. Type boot hd:0 5450.of and that executes the script. The last line of the script boots amigaboot.of as you normally would.

Before we all dwell too much on network issues I need to do some more work on it. I noticed I’ve missed off a memory range so I imagine that could mean there’s a clash somewhere. I realised it when the values for RX card were posted earlier and confirmed it on my machine.

Food time right now. I’ll look at it some more after.


Amiga x5040 ı 16GB ı RX580
GB-A1000 060@100,
A1200 PiStorm32-Lite CM4
Go to top
Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


See User information
@MartinW

Yes there are 4 bars. The fifth memory range is something called "extended ROM" iirc

Go to top
Re: What the fastest possible x64 emulation way of OS4 today ?
Not too shy to talk
Not too shy to talk


See User information
By no means an observation based on any kind of proof but my feeling is that the freezes are not related specifically to the network card. I just added a working sound configuration to my command line and I couldn't even get past the startup sound before the OS froze. The degbug output on serial didn't give any clue, it just stopped.

I did just make the mistake of moving the order of my command line so that I could easier comment out bits and of course that completely changed all of the memory addresses. Well, I assume "of course" anyway because the display is no longer device 2 it's now device 3 and the memory ranges changed as well.

So I've just reworked all my figures and it's working again. I'm actually typing this from OS4. Which thinking about it, is stupid given it might crash when I click submit!

[edit] It didn't. Obyssey is very slow at updating the screen by the way.


Amiga x5040 ı 16GB ı RX580
GB-A1000 060@100,
A1200 PiStorm32-Lite CM4
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
@MartinW

Yeh, JavaScript is slow on Amiga, we need our own JS JIT for PowerPC, I think someone worked on it, its was not as simple, because other part of browser, or something like that.

(NutsAboutAmiga)

Basilisk II for AmigaOS4
AmigaInputAnywhere
Excalibur
and other tools and apps.
Go to top
Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


See User information
@MartinW
If you want to make sure a device always have the same address you can add addr property to the -device command line such as -device vfio-pci,addr=2 to make sure it won't change when adding more devices. If you don't specify any address QEMU will pick a free one.

I can't help with debugging the hangs, it's more a problem of how to debug AmigaOS and not much different from debugging a hang on real hardware except that with QEMU you can inspect the machine state from QEMU monitor such as info registers info irq and some other things or even attach a debugger for more detailed analysis but if you don't know what to look for then that's not much help and to know what to look for knowledge about AmigaOS is needed not knowledge about QEMU.

A hang might be related to interrupts not delivered as expected so maybe that's where we need to check it, I hope you're using the latest QEMU version for this, at least 8.0 or even better QEMU master just to make sure we're not debugging a problem that was already fixed. It might also be possible that the network card driver has a bug that does not happen on real hardware because for example there are delays there but the emulated card is much faster so events may happen that trigger a bug not otherwise seen on real machine. Or some registers behave a bit different than the driver expects or whatever, it's impossible to guess without being able to find out what's happening which should point in the direction what could cause the issue. So some help from somebody who can debug such issues on real hardware could help to debug the same on emulated hardware as the debuggging itself is no different.

Go to top
Re: What the fastest possible x64 emulation way of OS4 today ?
Not too shy to talk
Not too shy to talk


See User information
@derfs

Sorry, didn't realise what the time was!

Try this:

\ Fixup Script for Radeon R9 R270 2G @ /pci/display@4
\

\reg                   4
:0
\                      xp4
,0,10,0:10000000
\                      x4
,0,18,0:40000
\                      i4
,0,20,0:100
\                      m4
,0,30,0:20000
\assigned
-addresses    xp4,0,10,90000000:10000000
\                      x4
,0,18,80080000:40000
\                      i4
,0,20,FE001200:100
\                      m4
,0,30,80020000:20000 
                      

s
" /pci/display@4" find-device
open ( -- ) true ;
s" /pci/display@4" open-dev to my-self

\ reg

0 0 h
# 00002000 encode-phys 0 encode-int encode+ 0 encode-int encode+
0 0 h# 42002010 encode-phys 0 encode-int encode+ h# 10000000 encode-int encode+
0 0 h# 02002018 encode-phys 0 encode-int encode+ h# 00040000 encode-int encode+
0 0 h# 01002020 encode-phys 0 encode-int encode+ h# 00000100 encode-int encode+
0 0 h# 02002030 encode-phys 0 encode-int encode+ h# 00020000 encode-int encode+
encodeencodeencodeencode" reg" property

\ assigned
-addresses

h
# 90000000 0 h# 42002010 encode-phys 0 encode-int encode+ h# 10000000 encode-int encode+
h# 80080000 0 h# 02002018 encode-phys 0 encode-int encode+ h# 00040000 encode-int encode+
h# FE001200 0 h# 01002020 encode-phys 0 encode-int encode+ h# 00000100 encode-int encode+
h# 80020000 0 h# 02002030 encode-phys 0 encode-int encode+ h# 00020000 encode-int encode+ 
encodeencodeencode" assigned-addresses" property

device
-end

\120 nodefault
-bytes os4_commandline
\setenv os4_commandline serial munnge debuglevel
=

  boot hd
:0 amigaboot.of


You will still need to enter
" /failsafe" io
blind to get to the open firmware input. From there you can copy and paste that all in one go. It should work. If the screen output isn't all in a nice neat display at the end then probably something didn't work.

Obviously adjust (or comment out) the final boot command to suit what you would normally type.

NB: Do note that if you change the order of devices in your qemu command or add / remove any then it's highly likely these numbers WILL change. I got caught out with that earlier when I just thought "I'll move these to the bottom so make them quicker to comment out" and I had to redo all my numbers. I'm starting to get used to the pattern of bits now though so it didn't take long.

Hopefully that goes well. If so, enjoy!

If it works then you can save it to the same place your amigaboot.of is and provided your qemu config doesn't change you can just call that script instead of amigaboot and have it chain the boot for you.

Go to top
Re: What the fastest possible x64 emulation way of OS4 today ?
Not too shy to talk
Not too shy to talk


See User information
Right, I'm not going to be about much over the weekend. 2 children and 1 adult all with birthdays, but at some point I hope to start to dig into why this thing is unstable because I'm pretty sure either something is still not configured correctly (less face it, quite possible), or there is a resource conflict. What I do know is that it's not limited in any way to the network card.


Amiga x5040 ı 16GB ı RX580
GB-A1000 060@100,
A1200 PiStorm32-Lite CM4
Go to top
Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


See User information
@MartinW
Or alternatively to using addr you could connect the gfx card to the AGP port/other PCI bus with -device vfio-pci,bus=pci.0 where it is alone as other devices are on bus=pci.1 so it won't change when addding devices to other bus. The memory windows for pci.0 are different so you have to cahnge the numbers once but then they should be stable. Using pci.0 for the gfx card also matches real machine better and may fit larger BARs as you won't share the memory window with other cards.

Go to top
Re: What the fastest possible x64 emulation way of OS4 today ?
Not too shy to talk
Not too shy to talk


See User information
Could that potentially help with interrupts as well? Looking in Ranger i just noticed that both the GFX and the RTL8139 share the same interrupt details (line, pin and whatever the 3rd one was - the VM has now crashed)

You did mention this a number of replies back. I'm only just getting to trying to look at it.

[EDIT] I'll look more when I can. That doesn't appear to work. OS4 freezes before it's had a chance to draw the dock loading image in the middle of the screen. It's possible I've rushed and got a number wrong. This is where doing it by hand isn't so wise!


Edited by MartinW on 2023/7/8 0:42:48

Amiga x5040 ı 16GB ı RX580
GB-A1000 060@100,
A1200 PiStorm32-Lite CM4
Go to top
Re: What the fastest possible x64 emulation way of OS4 today ?
Quite a regular
Quite a regular


See User information
@MartinW
I don't know if it would help with interrupts and it's possible something is wrong with interrupts still after trying to fix this in QEMU 8.0. Before that PCI interrupts did not work at all for pegasos2. The firmware configures all PCI devices to use IRQ 9 but don't know what it does for the AGP port or if that's wired up correctly at all. Somebody needs to test this and maybe getting lspci -v and /proc/interrupts contents from a real pegasos2 under Linux and comparing that to emulated machine might help to see if there are any differences.

@kas1e
Can you boot Linux on real pegasos2 and get lspci -v and /proc/interrupts from it?

Go to top

  Register To Post
« 1 ... 34 35 36 (37) 38 39 40 ... 72 »

 




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




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project