Re: Anyone have working pre-v8 machines?

Mouse <[email protected]>
Newsgroups gmane.os.netbsd.ports.sparc
Message-ID <[email protected]>
>> v7/post-v7 can be tested by trying to use a hardware multiplication
>> instruction; if it causes an illegal instruction error, it's v7 (...
>> unless the OS traps and emulates it but I don't think NetBSD or any
>> Sun OSes do that), otherwise it's v8 or newer.

Well, looking at NetBSD/sparc 1.4T trap.c, I see

        case T_ILLINST:
        case T_UNIMPLFLUSH:
                if ((n = emulinstr(pc, tf)) == 0) {
                        ADVANCE;
                        break;
                }
                trapsignal(p, n, 0);    /* XXX code?? */
                break;

and then emulinst(), in emul.c, handles only certain instructions; I
haven't worked out exactly which ones, but it does call something
called muldiv(), which is commented

        /*
         * We check for {S,U}{MUL,DIV}{,cc}
         *
         * [c = condition code, s = sign]
         * Mul = 0c101s
         * Div = 0c111s
         */

and it looks to me as though it _tries_ to handle multiplication.  So I
suspect NetBSD might well handle it.

I certainly could build a kernel that doesn't, though, or I could print
something when that code runs, or some such.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		[email protected]
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.