USB for lower end irix kernel module looking for devs

siliboi

Member
Jan 4, 2021
58
9
8
Halifax Nova Scotia Canada
BSDHERO has made a nice little piece of software which is not fully finished. Here is the github: https://github.com/psxpetey/SILICON-GRAPHICS-USBand here is a discord I made for the purpose of expanding on his work Permanent link: https://discord.gg/esgchh9zUR
It looks like he was working on USB enumeration:
in the machine's DMA. The DMA chunk must be aligned to... 32k? don't remember very well, all is in the UHCI/EHCI standard doc. In these linked lists, some data about the transfers is stored and of course, data from the devices are stored there by the UHCI/EHCI interface. If we accomplish this with the controllers UHCI/EHCI/xHCI, we are almost done with the hardest part of a decent USB stack and from here all will just go like a ride in the park.
The package can be made and built on 32bit and 64bit machines and he said he used it on an o2 and a fuel, The instructions for building the package etc are on the github in the readme, but script files have been made for all functions. The instructions also say where to put your own usb controller chips into the list.

I have been trying to build and install this but it keeps detecting my processor and building a 64bit kernel module instead of 32bit. Once I get some more time to mess with the files I'm hoping to fix that. So what do we think about getting usb working on older machines? id love to have mass storage and usb mice and keyboard. Pymbal apparently got usb mass storage working on an octane or fuel along with some other devices with a simple driver!
 
Last edited:
  • Like
Reactions: chulofiasco and Elf

siliboi

Member
Jan 4, 2021
58
9
8
Halifax Nova Scotia Canada
UPDATE:
So after talking to some people on the discord I was told to keep a log of what we are doing and how the project is going so here goes, I may separate this into different threads but for now ill try this: So as of right now I have moved the project to sourcehut here: https://git.sr.ht/~psxpetey/USB4IRIX/tree
After some work was able to get this built and working every time without crashing, and in its current state it does work however enumeration is still missing/not working. I updated the readme and made 2 more build.sh 64 bit and 32 bit you still will have to change the processor board flags for your board which is simple just change CFLAGS== to CFLAGS=$CLFAGS the build.sh will do from IP19 to IP35. So currently without enumeration what does it do? Well as proof that this can work it will light up USB mice and storage devices and power them. So we can clearly access USB through PCI. You can also use the provided tool usbtools.sh to debug! My card is ohci as it has 1 firewire port so I ordered a via6212 to make it easier.

THE WHAT:
So where does this code come from So bsdhero is actually on our discord above and he has been answering questions basically he saw pymbals driver and realized it was a shell from a PCI example in an Irix developers book, he then began implementing it more extensively it is based on Netbsd mostly Uhci design guide Ehci design guide and "the universal serial bus" from Benjamin David Lunt. BSDhero is trying to get his fuel back up and running (white blinking light) to help with the project, and we are gathering testers as well so far CHulofiasco and some other people have volunteered for that.

WHATS HAPPENING RIGHT NOW:
Right now I am going through the books he mentioned some irix dev books and one mentioned by Elf
USB Complete: The Developer's Guide, Fifth Edition
by Jan Axelson
A lot of great info in there about enumeration and the process. and have been going through openbsd source irix6.5.5(probably nothing in 6.5.5 whatsoever tho) and I will be going through netbsd as that seems to have a lot of equivalents in irix.

Next step:

Obviously will be to work on enumeration and debugging that so it can provide DMA, after that everything should be fairly easy. If you'dlike to go ahead and download the package and build it give it a try especially if you have a uhci ehci PCI card, and of course if youd like to help in any capacity with this project dont hesitate to ask.

HOW DOES THIS CODE WORK:
So when built there are a few files usbcore.o usbehci.o usbuhci.o usbhub.o. Whenever ehci or uhci need something from core they call it via the HCD driver that is the very basic functionality description. They are loaded as kernel modules like so:
echo "Loading USB drivers "
for a in usbcore usbhub usbehci usbuhci; do
echo "loading $a"
/sbin/sync
/sbin/sync
/sbin/sync
/sbin/sync
/sbin/sync
/sbin/sync
/sbin/ml ld -v -c $a".o" -p $a"_"
done.
Now if you are worried when building this about damage to your machine don't The loaded modules will delete themselves upon kernel crash. When initially working on this I crashed my kernel at least 50 times I ran out of og space lol but in its current state it should crash your machine as i've built it and ran it many times on my O2.

Well that's it for now more updates soon!
 

About us

  • Silicon Graphics User Group (SGUG) is a community for users, developers, and admirers of Silicon Graphics (SGI) products. We aim to be a friendly hobbyist community for discussing all aspects of SGIs, including use, software development, the IRIX Operating System, and troubleshooting, as well as facilitating hardware exchange.

User Menu