Classic Mac OS Software (Discussions on Applications) > Hacking the System, Mac OS 9.3, and Beyond !

Temporarily disabling devices from the device tree in Open Firmware

(1/2) > >>

nanopico:
So sometimes we are running into issues with unsupported hardware not setting up right, but may not really be needed.
Here is a way to temporarily disable the device so Mac OS 9 will not use or even attempt to initialize it. 
From open firmware go to the device you want to disable. (word of caution if there are child devices that are needed they also won't work).

I will use the usb controller on my G3 powerbook as an example

--- Code: ---dev /pci/usb@10
" reg" delete-property
" interrupts" delete-property
" none" encode-string " compatible" property
device-end

--- End code ---

In this case when I boot I will have no usb support.  If I reboot it will all come back.

Explanation:
The reg property give instructions for setting up and registering the device.  Clear it and no instructions.
the interrupts property indicates how many interrupts there are for the device.
The compatible property indicates what drivers the device is compatible with.
By removing and reseting these properties then OS 9 has no clue what to do with the device and pretty much skips over it.

nanopico:
Just an fyi this does not disable child devices so if you disable something with children, then good luck having any sort of stable boot.

Daniel:
It appears that there is a better way to do this, but It was buried in another thread. I have found it.

--- Quote from: nanopico on June 17, 2016, 01:58:50 PM ---Learned something new in my journey today.
I think it was asked how to delete a node from the device tree in open firmware.
I had provided some instruction somewhere on how to sort of disable and it would work for most things, but depending on how the interrupts are set up in hardware I found it can not work well.

If you can delete the node then it clears out those dependent interrupts so things are happy.

so with out further delay's here's how you can delete a node (and it deletes all the children below it as well)

I am not responsible for what you choose to do with this information.

So let's say we want to delete the mac-io node (fyi this will pretty much make your machine do pretty much nothing after this until you restart) located at /pci@f2000000/mac-io


--- Code: ---" /pci@f2000000/mac-io" find-package drop delete-node

--- End code ---

then just change the path to the node you want in the first part.  The space between the first " and the / is important.

--- End quote ---

darthnVader:
Daniel, any way to drop the agp/@10?

Seems to give me and invalid memory access when I try:


--- Code: ---" agp/@10" find-package drop delete-node
--- End code ---

I picked up a 1Ghz iMac G4 with a NV18 Geforce4 MX( 0x0189 device ID ), and I've got OS 9 booting on it, but I can't seem to hack together the video drivers. The OS 9 Drivers should support the NV18( 0x0184 Device ID ), but I'm thinking the Fcode ROM must have the basic 'NDRV' nVidia used for all OS 9 compatible cards.

I have the Fcode ROM for the 0x0184, but I can't use it because the Fcode ROM built-in to the BootROM is already active for the device:


--- Code: ---load hd:,\ppc\4mx.fc
dev agp/@10
800000 1 byte-load
" agp/@10" open-dev to my-self
800000 1 byte-load

--- End code ---

the byte-load command returns ok, but nothing gets executed, assuming because of the BootROM Fcode.

So I need to find a way to delete the node, even if it makes the screen go dark and I have to telnet in to execute the Fcode I want to try?

Daniel:
I think I linked the PCI DDK to you at some point. One of the useful tools it has is a tokenizer for FCode.

According to its documentation, fcode images for pci encode the vendor#, device#, and class-code in their headers. If those 3 values are different from the pci device, the fcode won't load.

I suggest changing device-tree properties to make sure those 3 values match up.

Navigation

[0] Message Index

[#] Next page

Go to full version