IRIX Network Forums
Documenting parts of the IRIX userland - Printable Version

+- IRIX Network Forums (//forums.irixnet.org)
+-- Forum: SGI/MIPS (//forums.irixnet.org/forum-3.html)
+--- Forum: Development/Porting (//forums.irixnet.org/forum-9.html)
+--- Thread: Documenting parts of the IRIX userland (/thread-2817.html)



Documenting parts of the IRIX userland - Raion - 04-14-2021

A lot of this thread is just gonna be me providing insight, through hexediting, symbol tables and c library calls, how various commands and pieces of the IRIX userland work. This will hopefully provide others with information regarding how IRIX's internals work, how they are unique, and perhaps lay the groundwork for me, or others, to replace and update utilities. 

MV/LN/CP

Might surprise you guys, but these are all the same command on IRIX. I determined this through looking at the symbols used by each (they're nearly identical) and how they all stack up in memory. It's a rather unique setup, and one I've not seen in any other OS. This does not mean the binaries are symlinked, they aren't. But the code is literally identical across the three commands. 

patch

This was a bit surprising to me. IRIX's patch is just an old version of GNU patch. 1.1, dated 1995 to be exact. This one wasn't hard, just comparing neko_patch to IRIX patch.

tar

I previously determined this in another thread to be an old version of tar derived from 4.4BSD and probably shared with solaris and other SVR4 UNIXes. 

CPIO

I'm reasonably certain this a RISCOS (no, not the ARM OS, the UNIX one) binary. There's some similarities in the RISCOS code that's on bitsavers with the symbol tables generated by this. 

Sort, uniq, wc

4.4BSD-derived. 

diff
GNU diff not sure of the version, but it's probably a very old version as it doesn't accept all new flags in use by GNU diff nowadays. 

I'll add more, but this is kinda fun.


RE: Documenting parts of the IRIX userland - jpstewart - 04-14-2021

(04-14-2021, 10:39 PM)Raion Wrote:  MV/LN/CP

Might surprise you guys, but these are all the same command on IRIX. I determined this through looking at the symbols used by each (they're nearly identical) and how they all stack up in memory. It's a rather unique setup, and one I've not seen in any other OS. This does not mean the binaries are symlinked, they aren't. But the code is literally identical across the three commands. 

Odd.  On all my SGIs (IRIX 6.5.x on Octane, O300, Indigo2;  4.0.5 on Indigo) mv and cp are symlinks to ls.

I've also seen it in the past (I forget which OS) where they are all hard links to the same binary.  That might be the case in your system.  Does 'ls -i' show the same inode number for them all?


RE: Documenting parts of the IRIX userland - Raion - 04-14-2021

AH that works. I was thinking "strange".


RE: Documenting parts of the IRIX userland - jpstewart - 04-15-2021

For what it's worth, Solaris has them as hard links to the same binary.  I knew I'd seen it somewhere.  It was cp/mv/ln as hard links that taught me the trick of checking argv[0] and altering the program's behaviour based on it.