Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Status
The first post of this thread is a WikiPost and can be edited by anyone with the appropiate permissions. Your edits will be public.

flyproductions

macrumors 65816
Jan 17, 2014
1,089
466
Sorry if I'm asking you to repeat yourself, but you tested this card in a New World Mac and it works OK with the ROM you edited?
Yes. Works tested in the Sawtooth and a Quicksilver and also in a 1.8 Single G5.

I went all the way through the whole section, where the 01 15 01 12 12 FC-string appears (with the last appearance not ending in FC as there are no FC-bytes left) and edited after every appearance of D4 03 3C according to the PC ROM as described in the wiki's appendix. I didn't even know, that this ROM-maker existed. As far as i know it has never been "publicly released". From Arti, i remember a few other tools like the Softstrap Copier, the Detokenizer and the Resman Patcher.

These are the properties as the Sawtooth's OF shows them. In this case with the temperature sensor still present.

Code:
vendor-id               000010de
device-id               00000221
revision-id             000000a1
class-code              00030000
interrupts              00000001
min-grant               00000005
max-latency             00000001
subsystem-vendor-id     000010de
subsystem-id            00000010
devsel-speed            00000001
fast-back-to-back       
fcode-rom-offset        00000000
model                   Geforce 6200
NVDA,BMP                55aa7eeb 4b373430 30e94c19 77cc5649 44454f20 0d000000 00005710 00004942
                        4d205647 4120436f 6d706174 69626c65 01000000 b010cc23 30362f32 342f3035
                        00000000 00000000 01100000 00000000 e93edd00 00000000 00000000 00004081
                        efffff7f 10000080 2200a542 e9f5b7e9 fcb7ffb8 42495400 00010c06 10473201
                        0400de00 42021600 e2004301 0e00f800 44010400 06014901 0e000a01 4c010200
                        18017401 12001a01 4d010200 2c014e00 00000000 50011900 2e015302 15004701
                        54010200 5c015501 03005e01 56010600 61016300 00000000 69022300 67010000
                        00007502 43050000 00000000 a8073030 2f30302f 30300200 00000000 00000000
                        ... 000024fb bytes total
device_type             NVDA,GeForce
NVPM                    01000000 00000000 00000000 00000000 00000000 00000000 00000000
NVCAP                   04000000 00000001 000e0000 00000007 000000
name                    NVDA,Parent
#address-cells          00000001
#size-cells             00000000
rom-revision            32313439 6100
NVDA,Features           004d02ef
NVDA,Level              00000001
reg                     00011800 00000000 00000000  00000000 00000000
                        02011810 00000000 00000000  00000000 01000000
                        02011818 00000000 00000000  00000000 01000000
                        42011814 00000000 00000000  00000000 10000000
                        02011830 00000000 00000000  00000000 00020000
VRAM,memsize            10000000 10000000
assigned-addresses      c2011814 00000000 90000000  00000000 10000000
                        82011810 00000000 82000000  00000000 01000000
                        82011818 00000000 81000000  00000000 01000000
                        82011830 00000000 800a0000  00000000 00020000

METHODS:
decode-unit     close           open     



/pci@f2000000/pci-bridge@d/NVDA,Parent@3/NVDA,Display-A@0
PROPERTIES:
name                    NVDA,Display-A
device_type             display
reg                     00000000 
compatible              NVDA,NVMac
                        NVDA,MultiDisplay
connector-type          00000200
display-type            4e4f4e45 00
display-cfg             ffffffff
NVPR                    06800600 001b0000 00000000 00000000 00000000 00000000 00000000 00000000
                        0000004d 00000000 0000

METHODS:
close           restore         draw-logo       write           open            ddc2-send-byte 
ddc2-set-stop   ddc2-set-start  dimensions      get-colors      set-colors      color@         
color!          read-rectangle  fill-rectangle  draw-rectangle  set-mode        show-modes     
get-mode       

/pci@f2000000/pci-bridge@d/NVDA,Parent@3/NVDA,Display-B@1
PROPERTIES:
name                    NVDA,Display-B
device_type             display
reg                     00000001 
compatible              NVDA,NVMac
                        NVDA,MultiDisplay
connector-type          00000004
display-type            4e4f4e45 00
display-cfg             ffffffff
can-hot-plug           
NVPR                    967f0600 00100690 041a0730 060a0438 03090001 2e7c0000 06101b92 00000000
                        0000004d 00000000 0000

METHODS:
close           restore         draw-logo       write           open            ddc2-send-byte 
ddc2-set-stop   ddc2-set-start  dimensions      get-colors      set-colors      color@         
color!          read-rectangle  fill-rectangle  draw-rectangle  set-mode        show-modes     
get-mode       

/pci@f2000000/pci-bridge@d/NVDA,Parent@3/sensor-parent@2
PROPERTIES:
name                    sensor-parent
compatible              NVDA,sensor-parent
hwsensor-params-version 00000002
hwctrl-params-version   00000002
reg                     00000002 
#address-cells          00000001
#size-cells             00000000


/pci@f2000000/pci-bridge@d/NVDA,Parent@3/sensor-parent@2/gpu-diode-temperature@0
PROPERTIES:
name                    gpu-diode-temperature
device_type             temp-sensor
location                6770752d 64696f64 6500
sensor-id               94e27000
reg                     00000000 
version                 00000002
zone                    ff000002
input-target            00550000
polling-period          0000001e 00000000
 
Last edited:

flyproductions

macrumors 65816
Jan 17, 2014
1,089
466
Code:
dev ttya
44 ' initscc dc + code!
0 ' initscc c4 + code!
Again no luck with this. As soon as i type unselect-dev, the screen on the G3 turns black. But even after switching the connection speed for ZTerm, i do not see the G3's OF there.
 

flyproductions

macrumors 65816
Jan 17, 2014
1,089
466
Ah yes, this was a long time after i played around with the PPC/Fcode-ROMs for graphics cards.

The last one i did was for some exotic GeForce 6800xt, a member of the closed CubeOwner-Forum send me in 2010. I'm still using this card in the Sawtooth.
6800xt.png
 
  • Like
Reactions: LightBulbFun

joevt

macrumors 604
Jun 21, 2012
6,971
4,262
So here is the file:
Seems to be identical to the one I have.
I don't understand why you get the following from dev / ls or dump-device-tree
Code:
AAPL,ROM@ffc00000
Whisper

while I get the following (using dingusppc emulator):
Code:
AAPL,ROM@FFC00000
whisper

Actually, all your hex values are lowercase while mine are uppercase. Maybe it's from an nvramrc patch? Zap the pram and check dev / ls again.


...and here is, what lspci returns with the 6200 in slot B1:
Code:
0 > lspci
00:0e.0         [10de:0221] [030000]
Thanks. There's the Nvidia at device 0x0e
 

joevt

macrumors 604
Jun 21, 2012
6,971
4,262
I don't understand why you get the following from dev / ls or dump-device-tree
There's a value named upc-hex? which determines if hex values are output as upper case.
For some unknown reason, it gets set to false by create-defaults when a PCI device has no fcode as determined by probe-device.

I guess my emulated environment does not run into that situation.

As for why you have Whisper instead of whisper, I think it's because you have a real perch device? The name with the uppercase W might come from the device itself and the device has version 2. If the device doesn't exist, then the name comes from perch-dummy and it has version 0.

Try this command:
dev pci/mac-io/via-cuda 8c 0 0a6 read-iic 0 do dup i + c@ 2 u.r loop drop
and post the result.
 

joevt

macrumors 604
Jun 21, 2012
6,971
4,262
Again no luck with this. As soon as i type unselect-dev, the screen on the G3 turns black. But even after switching the connection speed for ZTerm, i do not see the G3's OF there.
I'm sorry, I mistyped the instructions. Read it again: #90

Also see here as I type each line one at a time:

Code:
0 > dev ttya  ok
0 > see initscc 
: initscc 
  9 scc! sccxc 20 and if 
    80 
    else 
    40 
    then 
  scc! sccxc @startvec >sccac ! 38400 baud / 2/ 2- wbsplit D scc! scc! C 
  scc! scc! E scc! 1 scc! B scc! 50 scc! 5 scc! 6A scc! 4 scc! 4C scc! 3 
  scc! C1 scc! ; ok
0 > 44 ' initscc dc + code!  ok
0 > 0 ' initscc b4 + code!  ok
0 > see initscc 
: initscc 
  9 scc! sccxc 20 and if 
    80 
    else 
    40 
    then 
  scc! sccxc @startvec >sccac ! 38400 baud / 2/ 2- wbsplit D scc! scc! C 
  scc! scc! E scc! 1 scc! B scc! 0 scc! 5 scc! 6A scc! 4 scc! 44 scc! 3 scc! 
  C1 scc! ; ok
0 >

see initscc shows what the initscc word looks like before and after the patch.
You see that the hex numbers 50 and 4c are changed to 0 and 44.


Set modem port to 230.4 kbps

Code:
dev ttya
44 ' initscc dc + code!
0 ' initscc b4 + code!
unselect-dev

Line 1 selects the device that will have it's init routine modified by the next 2 lines.
The patches will also work with ttyb because the code is the same.

Line 2 changes the init routine so that it will set the number of stop bits to 1. The
default (using 4C hex) is two stop bits even though technote 1061 says to set the number
of stop bits to 1 in the communications app that you are using.

Line 3 changes the init routine so that it will select the RTxC pin (3.8MHz) for the
receive and trasmit clocks. The default (50 hex) selects the Baud Rate Generator. The RTxC
pin is used to get 230400 bps. Change the value in line 2 from 44 to 84 to halve the baud
rate (with line 3, that gives 115200 bps).

Line 4 unselects the device (causes pwd to not output a device path)
 

joevt

macrumors 604
Jun 21, 2012
6,971
4,262
Finally! 😁


Can this be stored in nvram too, so i don't have to renew it after every reboot?
I gave suggestions in #70 search for "You can include the first 3 lines in the nvramrc script to make it permanent"

Also, I don't think XON/OFF is useful for Open Firmware.
Done this. Still all hex-values in lowercase.
I think it's a hardware difference as explained in #106 . Provide the output from the read-iic line from #106
 

flyproductions

macrumors 65816
Jan 17, 2014
1,089
466
I gave suggestions in #70 search for "You can include the first 3 lines in the nvramrc script to make it permanent"
Thanks!
Also, I don't think XON/OFF is useful for Open Firmware.
Can this be turned off via OF-command too?
I think it's a hardware difference as explained in #106 . Provide the output from the read-iic line from #106
Looks like this:
Code:
0 > dev pci/mac-io/via-cuda 8c 0 0a6 read-iic 0 do dup i + c@ 2 u.r loop drop 0faa55aa576869737
06572000000000200000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffff
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ok
0 >
 

joevt

macrumors 604
Jun 21, 2012
6,971
4,262
Can this be turned off via OF-command too?
That is a setting in Z-Term. Click the check box. Serial port devices have no way of communicating their required settings to each other. You must set both of them to have the same settings. I don't think Open Firmware has a setting to enable flow control so it needs to be turned off in Z-Term. Open Firmware only has a setting for the baud rate.

Looks like this:
Yup. There it is.
Code:
00000000: 0faa55aa 5768697370657200 00000002  ..U.Whisper.....
00000010: 00 00000000 00 00000000 00 00000000 00  ................
00000020: ffff ffff ffff ffff ffff ffff ffff ffff  ................
00000030: ffff ffff ffff ffff ffff ffff ffff ffff  ................
00000040: ffff ffff ffff ffff ffff ffff ffff ffff  ................
00000050: ffff ffff ffff ffff ffff ffff ffff ffff  ................
00000060: ffff ffff ffff ffff ffff ffff ffff ffff  ................
00000070: ffff ffff ffff ffff ffff ffff ffff ffff  ................
00000080: ffff ffff ffff ffff ffff ffff            ............
0faa55aa is a number that indicates that the following data from read-iic is valid. When the data is invalid or is not read, then defaults from perch-dummy are used.

5768697370657200 = Whisper is a string for the compatible property of the perch device (default from perch-dummy is 7768697370657200 = whisper).
00000002 is a number for the version property of the perch device (default from perch-dummy is 00000000).

00 is a string (default from perch-dummy is 617761637300 = awacs).
00000000 is a number (probably version for awacs).

00 is a string for the compatible property of the video-in device. 00 means there's no video-in device.
00000000 is a number for the version property of the video-in device.

00 is a string for the compatible property of the front-panel-display. 00 means there's no front-panel-display device.
00000000 is a number for the version property of the front-panel-display device.

00 is I don't know what - maybe indicates end of device list or just padding?
 
Last edited:
  • Like
Reactions: flyproductions

joevt

macrumors 604
Jun 21, 2012
6,971
4,262
Here is a good read of the goings on of testing and debuging forth and PCI devices for those that have not read it:


Sadly only some of it applies to Apple's bastardized implementation of OF, but it does give some basics that apply.
I like the dingusppc emulator. I give it a Beige G3 ROM, then I can go into Open Firmware 2.4 and test things since I only have older or newer Power Macs. I can use the Terminal.app window for input and output to Open Firmware. The code is pretty simple and builds quickly. I can probably make an emulation for Nvidia 6200 - starting with the base address registers and rom image. Then maybe later I can define registers using code from nouveau drivers in Linux. I suppose you could easily define a PCI card with a huge rom as big as you like to add custom fcode to the emulator.
 

joevt

macrumors 604
Jun 21, 2012
6,971
4,262
Looks like this:
Can you test with this command:
dev pci/mac-io/via-cuda 200 0 0a6 read-iic 0 do dup i + c@ 2 u.r loop drop
I want to know if there's any other info beyond the first 0x8c bytes.
Also, if you have any other Beige G3s, it might be interesting to see if their personality cards have different info.
 

DearthnVader

Suspended
Dec 17, 2015
2,207
6,392
Red Springs, NC
I like the dingusppc emulator. I give it a Beige G3 ROM, then I can go into Open Firmware 2.4 and test things since I only have older or newer Power Macs. I can use the Terminal.app window for input and output to Open Firmware. The code is pretty simple and builds quickly. I can probably make an emulation for Nvidia 6200 - starting with the base address registers and rom image. Then maybe later I can define registers using code from nouveau drivers in Linux. I suppose you could easily define a PCI card with a huge rom as big as you like to add custom fcode to the emulator.
I hope you can fork Dingus so we can play along.

I have a real Beige G3 but it has OF 2.0.f.

BTW the 6600 ROM for the Geforce card has a GPU check that will go to abort if it doesn't find the proper GPU, so I'm not sure Atri removed this wth the 6200 ROM Maker or he just added a check for the NV44.

That maybe an issue for you with an emulated PCI card. If you can find the check in the FCODE for the FX/6xxx/7xxx cards, please share it, as I don't know how to remove or by-pass it.
 
Last edited:
  • Like
Reactions: flyproductions

joevt

macrumors 604
Jun 21, 2012
6,971
4,262
I hope you can fork Dingus so we can play along.
You can try Open Firmware with just the Rage GPU for now.
https://github.com/joevt/dingusppc

You may need to do xcode-select --install before doing hombrew install.

Use homebrew to get any missing commands (socat, cmake) or libraries (sdl2)
https://brew.sh
brew upgrade
brew install sdl2 socat
etc.

Code:
#=========================================================================================
# Get dingusppc

mkdir -p /Volumes/Work/Programming/dingusppc
cd /Volumes/Work/Programming/dingusppc
git clone https://github.com/joevt/dingusppc.git joevt-dingusppc
cd /Volumes/Work/Programming/dingusppc/joevt-dingusppc
git submodule update --init --recursive
git remote add upstream https://github.com/dingusdev/dingusppc.git
#open -a Fork.app .

#=========================================================================================
# Make dingusppc

mkdir -p /Volumes/Work/Programming/dingusppc/joevt-dingusppc/build
cd       /Volumes/Work/Programming/dingusppc/joevt-dingusppc/build

cmake -DCMAKE_BUILD_TYPE=Release ..

make dingusppc

In the first terminal window:
First you want to get into the dingus debugger to setup nvram:
cd /Volumes/Work/Programming/dingusppc/joevt-dingusppc/build/bin
./dingusppc -d -b "ROM PM G3 @FFC00000 len-400000" serial_backend=socket

In the debugger in the first terminal window:
setenv auto-boot? false
setenv input-device ttya
setenv output-device ttya,11

In the second terminal window:
cd /Volumes/Work/Programming/dingusppc/joevt-dingusppc/build/bin
socat UNIX-CLIENT:dingussocket -,cs8,parenb=0,echo=0,icanon=0,isig=0,icrnl=0

In the debugger in the first terminal window, to continue emulation:
go
You can get back into the debugger by pressing Control-C.

In Open Firmware in the second terminal window:
7fffffff to lines/page
printenv
dev / ls
unselect-dev
dump-device-tree
16 to lines/page

Read here for some usage ideas:
https://github.com/joevt/dingusppc/commit/650c2c88dd495173c11adabee8aca9a427a6ff7a

Since input and output are serial port, the screen is black but you can change that with this:
screen output
You'll still input from the second terminal window while output will appear in the DingusPPC Display window.

Go back to outputting to serial port:
ttya output

Draw color bars to screen without changing output:
screen open-dev drop
dev screen
10 0 do i i 28 * 0 28 d# 480 fill-rectangle loop
 
Last edited:

flyproductions

macrumors 65816
Jan 17, 2014
1,089
466
Can you test with this command:
dev pci/mac-io/via-cuda 200 0 0a6 read-iic 0 do dup i + c@ 2 u.r loop drop
Here is the output. PCI F1 and C1 excluded from the probe. 6200 sitting in C1.
Code:
0 > dev pci/mac-io/via-cuda 200 0 0a6 read-iic 0 do dup i + c@ 2 u.r loop drop 0faa55aa57686973
706572000000000200000000000000000000000000000000fffffffffffffffffffffffffffffffffffffffffffffff
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
fffffffffffffffffff000faa55aa57686973706572000000000200000000000000000000000000000000ffffffffff
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
ffffffffffffffffffffffffffffffffffffffffffffffffffffffff00 ok
0 >
Also, if you have any other Beige G3s, it might be interesting to see if their personality cards have different info.
No, i "only" have one. But from the the link you posted, i now know there was one called "Wings", which had video input, and anotherone, which even suppurted Video DVD playback, called Bordeaux. As you know from previous posts, i only own the Whisper-version.
 

joevt

macrumors 604
Jun 21, 2012
6,971
4,262
Or patch all words so they all output something to console.... that might be doable.
It is doable and mostly done.

Here's a simple test of the functionality:
Code:
: testing ." hello" ;
: test true to trace? testing false to trace? ;
patch-words
test

It produces this result:
Code:
[ testing Empty
  [ (type) -796be3 5
    [ stdout-write -796be3 5
      [ ?xoff -796be3 5
        [ key-fillq -796be3 5
          [ "read" -796be3 5 -7200a0 1
          ] "read" -796be3 5 -7200a0 1 -7ef173 4
          [ $call-method -796be3 5 -7200a0 1 -7ef173 4 -726600
            [ find-method -796be3 5 -7200a0 1 -7ef173 4 -7babe8
              [ >xcode -796be3 5 -7200a0 1 -7ba668
              ] >xcode -796be3 5 -7200a0 1 -7ba658
            ] find-method -796be3 5 -7200a0 1 -7ba658 -1
          ] $call-method -796be3 5 0
        ] key-fillq -796be3 5
      ] ?xoff -796be3 5
      [ "write" -796be3 5
      ] "write" -796be3 5 -7ef14b 5
      [ $call-method -796be3 5 -7ef14b 5 -726740
        [ find-method -796be3 5 -7ef14b 5 -7babe8
          [ >xcode -796be3 5 -7ba598
          ] >xcode -796be3 5 -7ba588
        ] find-method -796be3 5 -7ba588 -1
hello      ] $call-method 5
    ] stdout-write Empty
  ] (type) Empty
] testing Empty


Here's some stuff I put in nvramrc for enabling serial output before probe-all:
Code:
: $oc
space
['] emit behavior u.
['] type behavior u.
['] install-console behavior u.
stdout @ u.
pci-probe-list u.
cr
;

." 1)" $oc

." [ install-console" cr
(install-console)
." ] install-console" cr
." 2)" $oc

7fffffff to lines/page

dev / ls

setenv pci-probe-list FFFFBFFF
." 3)" $oc
." [ probe-all (except gpu)" cr
probe-all
." ] probe-all (except gpu)" cr
." 4)" $oc

dev / ls

." [ banner" cr
banner
." ] banner" cr

setenv pci-probe-list FFFFFFFF
." 5)" $oc
." [ probing GPU" cr
probe-all
." ] probing GPU" cr

." 6)" $oc

dev / ls
unselect-dev

Notes about what's going on in the above:

  • emit and type remain unchanged before and after nvramrc (they point to (emit) and (type))
  • install-console is noop until after the nvramrc script is done, then it becomes (install-console)
  • stdout is 0 until after the nvramrc script is done, then it becomes instance node of ttya device
  • We can call (install-console) instead of install-console. It sets stdout to ttya instance and output is directed to output device instead of buffer.
  • dev / ls won't work before (install-console) because the console is required when it wants to wait for key press.
  • lines/page is inited by (install-console) so override it afterward.
  • banner is used to indicate that install-console and probe-all are not to be called after nvramrc (as described by IEEE 1275 spec)
 

Attachments

  • Open Firmware Trace.of.zip
    3.3 KB · Views: 117

joevt

macrumors 604
Jun 21, 2012
6,971
4,262
I hope you can fork Dingus so we can play along.

I have a real Beige G3 but it has OF 2.0.f.

BTW the 6600 ROM for the Geforce card has a GPU check that will go to abort if it doesn't find the proper GPU, so I'm not sure Atri removed this wth the 6200 ROM Maker or he just added a check for the NV44.

That maybe an issue for you with an emulated PCI card. If you can find the check in the FCODE for the FX/6xxx/7xxx cards, please share it, as I don't know how to remove or by-pass it.
I made some fixes to dingusppc debugger so it can be used to change nvramrc. It also properly handles the integer and string varible types. I have my emulated 6200 appearing as a PCI device. I have implemented the config space variables responsible for the Open Firmware properties but I haven't implemented any Nvidia 6200 specific registers since I haven't gotten that far in the driver. I was stuck for a bit on the fact that dingusppc wasn't reading more than 64K of my debug rom (normal rom is less than 64K but debug rom takes more space for debug strings).

There's an abort that's happening because the subsystem-id property is missing (I had set it to 0 in the emulation because that was the value in the lspci output that was provided). If I change it to 4D then the driver gets further. It eventually calls ABORT again after waiting for some registers to change. My emulation doesn't implement any Nvidia specific registers so it's expected to not work.

Anyway, I think the subsystem-id check is weird because it changes the subsystem-id to 10 afterward anyway.

@flyproductions , what size is the rom chip on your card? The Open Firmware rom is less than 64K but the assigned-addresses property for reg 0x30 says 128K. My debug rom is 205K.
 
  • Like
Reactions: Amethyst1

joevt

macrumors 604
Jun 21, 2012
6,971
4,262
Also might be nice to get an lspci from a Mac that the 6200 actually works in to see if the subsystem-id is populated.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.