IRIX and Software

Irix binary compatibility for Linux on MIPS64? - Page 1

I am soon getting a multi-core 900 MHz MIPS64-based computer running Linux.
This computer does not support NetBSD. I want to be able to run at least some
Irix binaries.
How much effort would it be to port the NetBSD/MIPS Irix compatibility Layer
(Link: http://www.ukuug.org/masl/10 ) to Linux/MIPS?

Has someone already tried that?
:Fuel: 600 MHz, 2 GB RAM, 72 GB 15k RPM HD
:O2: 180 MHz
Very difficult. Linux and NetBSD are two totally different OSes, and MIPS is historically not well supported on Linux. Also, you won't be able to on a modern MIPS system anyways as IRIX is big-endian oriented, your Linux-MIPS system is more than likely little endian. So no, no way at all.
Entire collection up for sale :(
your Linux-MIPS system is more than likely little endian. So no, no way at all.


No, it is not. It is big endian. It has Sibyte SB1 cores. It can run the Pistachio microkernel
(see: http://l4hq.org/arch/mips64/ ).

Ok, I ask again: Is anyone in the forum that tried to run Irix binaries on a big endian
Linux/MIPS platform?
:Fuel: 600 MHz, 2 GB RAM, 72 GB 15k RPM HD
:O2: 180 MHz
rwengerter wrote: Ok, I ask again: Is anyone in the forum that tried to run Irix binaries on a big endian
Linux/MIPS platform?

That project was the pet of a guy from France who used to be pretty active on Usenet. Maybe some of the French contingent here might have contact info for him ?
Juliet ! the dice were loaded from the start ...
Have you considered the flipside question: What would it take to get NetBSD running on this hardware?
nyef wrote: Have you considered the flipside question: What would it take to get NetBSD running on this hardware?


Yes, I have. It has 4 GBit/s Fibrechannel ports and GBit Ethernet ports. I am pretty sure that there are
no available drivers for these ports if I would try to use NetBSD. I would therefore lose these ports
even if I would be successful in installing NetBSD.

Well, I currently don't have much information about the hardware. I plan to switch from Linux/x86 to Linux/MIPS
as main Linux development platform. I first have to install gcc on the Linux/MIPS computer. Later I will try to find
out what is necessary to run a simple Irix Hello-world-binary on the Linux/MIPS computer. I will post the information
here if I am successful.
:Fuel: 600 MHz, 2 GB RAM, 72 GB 15k RPM HD
:O2: 180 MHz
Syscalls are one thing. That article doesn't say anything about dynamic linking (perhaps it requires that they are statically linked).
smit happens.

:Fuel: bigred , 900MHz R16K, 4GB RAM, V12 DCD, 6.5.30
:Indy: indy , 150MHz R4400SC, 256MB RAM, XL24, 6.5.10
:Indigo2IMP: purplehaze , R10000, Solid IMPACT
probably posted from Image bruce , Quad 2.5GHz PowerPC 970MP, 16GB RAM, Mac OS X 10.4.11
plus IBM POWER6 p520 * Apple Network Server 500 * HP C8000 * BeBox * Solbourne S3000 * Commodore 128 * many more...
rwengerter wrote: Yes, I have. It has 4 GBit/s Fibrechannel ports and GBit Ethernet ports. I am pretty sure that there are
no available drivers for these ports if I would try to use NetBSD. I would therefore lose these ports
even if I would be successful in installing NetBSD.


Uhh I don't know what you're on, but NetBSD does have Fibrechannel and gigabit ethernet drivers for common chipsets. That being said, sounds like you're having an excuse to avoid BSD - which is your own business, but I doubt you'll have the patience and skill to adapt the NetBSD binary emulation layer for GNU/Linux. Maybe ask one of the Linux/MIPS guys like Kumba or ivelegacy, but beyond that, you're SOL, my friend. IRIX binaries which are dynamically linked will not run without having their libs copied over, and the IRIX kernel is mostly not well documented, so good luck with this project.
Entire collection up for sale :(
rwengerter wrote: How much effort would it be to port the NetBSD/MIPS Irix compatibility Layer
(Link: http://www.ukuug.org/masl/10 ) to Linux/MIPS?

Has someone already tried that?

If I believe this post and this linux kernel commit it looks like that irix binary compatibility support did exist at some point in time.
It seems it was pretty buggy and limited to the O32 ABI.
But it may give you some inspiration...
:Onyx2: :O2: :O3x0: :O3x0:
TeamBlackFox wrote: Uhh I don't know what you're on, but NetBSD does have Fibrechannel and gigabit ethernet drivers for common chipsets. That being said, sounds like you're having an excuse to avoid BSD - which is your own business, but I doubt you'll have the patience and skill to adapt the NetBSD binary emulation layer for GNU/Linux. Maybe ask one of the Linux/MIPS guys like Kumba or ivelegacy, but beyond that, you're SOL, my friend. ...


I would very welcome to have NetBSD for my new multi-core Sibyte Computer, however I just read that even
NetBSD/Mips stopped to support Irix in NetBSD after 5.0 Quote from https://www.netbsd.org/changes/changes-6.0.html#kernel : "Support for Darwin, Mach, IRIX and PECOFF emulation was retired. [joerg 20110426]"
The manufacturer used an FPGA as a chipset, which of course cannot be supported by the standard NetBSD
drivers.
Well, I will try to boot NetBSD/Mips 5.0 and see how far it goes.

bplaa.yai wrote: If I believe this post and this linux kernel commit it looks like that irix binary compatibility support did exist at some point in time.
It seems it was pretty buggy and limited to the O32 ABI.
But it may give you some inspiration...

Thanks bplaa.yai. Some support for Irix binaries is better than nothing.
:Fuel: 600 MHz, 2 GB RAM, 72 GB 15k RPM HD
:O2: 180 MHz
I have, don't set your hopes too high, some static binaries will work.
:Onyx2:
mia wrote: I have, don't set your hopes too high, some static binaries will work.

Interesting. Would you elaborate on this ?
:Onyx2: :O2: :O3x0: :O3x0:
bplaa.yai wrote:
mia wrote: I have, don't set your hopes too high, some static binaries will work.

Interesting. Would you elaborate on this ?


I first have to assemble a bootable Linux image. I have the Linux files as an tar.gz archive.
It uses a modified version of PMON as bootloader. I will report it here when I make progress.
:Fuel: 600 MHz, 2 GB RAM, 72 GB 15k RPM HD
:O2: 180 MHz
TeamBlackFox wrote: ...MIPS is historically not well supported on Linux...
Eh, that's not entirely correct. It depends heavily on the particular MIPS platform you're running Linux on. If you're referring to the new MIPS32R6 stuff by ImgTec, that is *very* well supported. If you're talking Indigo² R10000, then this statement applies.

rwengerter wrote: I want to be able to run at least some Irix binaries.
This was attempted once, a long time ago. Ralf (the Linux/MIPS maintainer) exorcised the remaining bits of code a few years ago (via this URL linked to by bplaa.yai) since it was unmaintained and didn't work. If you start from that, you might be able to take a look at how it might be brought up to work with current Linux kernels. Mind you, this will not be a trivial project or task. You can probably find more information out in #mipslinux on Freenode. It can be dead in there at times, though, so just idle until you see activity.
:Onyx2: 4x R14000 :Tezro: 4x R16000 :Fuel: 1x R16000 :Octane: 2x R14000 :O2+: RM7000 :O2: R10000 :O2: RM5200 :Indigo: R4400 :Indigo2IMP: R10000 :Indigo2: R8000 :O3x0: 4x R14000 :Indy: R5000

"The past tempts us, the present confuses us, the future frightens us. And our lives slip away, moment by moment, lost in that vast, terrible in-between."
--Emperor Turhan, Centauri Republic
This looks like the sort of project that can see promising results fairly quickly, but then get tied up with various undocumented incompatibilities and whatnot very shortly afterwards. The idea of running an IRIX userland in a Linux chroot is amusing, though. Or even just as the root filesystem. That would be worth some serious hack value, but I'd expect it to be a lot of work.
nyef wrote: This looks like the sort of project that can see promising results fairly quickly, but then get tied up with various undocumented incompatibilities and whatnot very shortly afterwards. The idea of running an IRIX userland in a Linux chroot is amusing, though. Or even just as the root filesystem. That would be worth some serious hack value, but I'd expect it to be a lot of work.
It would allow for a lot of study of IRIX program behavior, especially if one could patch strace/ltrace to see what commands it sends back and forth (such as Xsgi, for example). But would be very difficult to pull off and the ROI of time would be questionable. Would need a dedicated maintainer to keep the emulation layer in the kernel working, else Ralf would just pull it again a few years down the road.
:Onyx2: 4x R14000 :Tezro: 4x R16000 :Fuel: 1x R16000 :Octane: 2x R14000 :O2+: RM7000 :O2: R10000 :O2: RM5200 :Indigo: R4400 :Indigo2IMP: R10000 :Indigo2: R8000 :O3x0: 4x R14000 :Indy: R5000

"The past tempts us, the present confuses us, the future frightens us. And our lives slip away, moment by moment, lost in that vast, terrible in-between."
--Emperor Turhan, Centauri Republic
Two things come to mind.

First, "not it". At least, not at this point. I have lots of other things to do, so I am not particularly willing to play dedicated maintainer. For that matter, I still don't have any "fully working" MIPS64 Linux systems quite yet (by which I mean with a working bootloader, and SMP if it's not a Fuel, and there's that IOC3 IRQ conflict, and if it is a Fuel or Tezro then the graphics card driver, and then there's the L1 controller stuff...).

Second, can we use strace against Xsgi on IRIX itself to any useful purpose?
nyef wrote: I have lots of other things to do, so I am not particularly willing to play dedicated maintainer.
Wasn't nominating you in any way to tackle this :) Just pointing out in general that it would require someone willing to upkeep it for some time because of the way the kernel can change its internals periodically.

nyef wrote: For that matter, I still don't have any "fully working" MIPS64 Linux systems quite yet (by which I mean with a working bootloader, and SMP if it's not a Fuel, and there's that IOC3 IRQ conflict, and if it is a Fuel or Tezro then the graphics card driver, and then there's the L1 controller stuff...).
Not to threadjack, but IOC3 IRQ conflict? IIRC, at least on Octane with the Metadriver, IOC3 should be requesting two IRQs, one for ethernet, and ethernet+2 for I/O by kb/mouse. Serial uses a UART polling hack built into 8250 core to run the serial ports for now (by telling it to use IRQ 0), but the end goal would be to make the Altix DMA-capable IOC3 driver work.

nyef wrote: Second, can we use strace against Xsgi on IRIX itself to any useful purpose?
Apparently so. I was digging into my chat logs from 2004, and Stan used a patched strace to monitor Xsgi calls to MGras, which helped him figure out some of the DMA bits needed to write the Impact driver. I don't think he ever released that patch, though. Would probably be useful for a lot of things outside of Linux porting.
:Onyx2: 4x R14000 :Tezro: 4x R16000 :Fuel: 1x R16000 :Octane: 2x R14000 :O2+: RM7000 :O2: R10000 :O2: RM5200 :Indigo: R4400 :Indigo2IMP: R10000 :Indigo2: R8000 :O3x0: 4x R14000 :Indy: R5000

"The past tempts us, the present confuses us, the future frightens us. And our lives slip away, moment by moment, lost in that vast, terrible in-between."
--Emperor Turhan, Centauri Republic
Kumba wrote:
nyef wrote: I have lots of other things to do, so I am not particularly willing to play dedicated maintainer.
Wasn't nominating you in any way to tackle this :) Just pointing out in general that it would require someone willing to upkeep it for some time because of the way the kernel can change its internals periodically.

Okay, just making sure. And who knows, maybe by the time this actually gets implemented, if it gets implemented, I'll be able to commit to doing that upkeep.

And I'll move the rest of my response elsewhere, so as not to threadjack too badly.
I'm sitting here having a late dinner, doing a bit of reading, trying to come up with a suitable name for a directory in one of my projects, and then it hit me:

It should be possible to implement IRIX binary compatibility for Linux purely from user mode.

Yes, it would be slow in execution. But you would have the improved cycle time of not needing to deal with a full kernel build (or even "just" the dance for a loadable module), you can bring a normal debugger to bear, and so on. And once it's all running reasonably well, then you can consider building it as a kernel module. And until then, well, now you don't have to worry nearly as much about keeping it in sync with the Linux kernel because the ABI doesn't change incompatibly all that often.

So, how would one implement "user-mode IRIX"? Using all the same ptrace() tricks that user-mode Linux does.

The follow-up question is "can this be tied into binfmt-misc?", and that I have no idea about.