Xref: utzoo unix-pc.general:5207 comp.sys.att:9294 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!jarthur!nntp-server.caltech.edu!juno!andy From: andy@juno.caltech.edu (Andy Fyfe) Newsgroups: unix-pc.general,comp.sys.att Subject: Re: UNIX3.51m Kernel object files, it matches FIXDISK2.0 binary... (*LONG*) Keywords: Kernel, object files, relocatable, UNIX3.51m Message-ID: <1990Apr11.042020.5317@laguna.ccsf.caltech.edu> Date: 11 Apr 90 04:20:20 GMT References: <1135@icus.ICUS.COM> Sender: news@laguna.ccsf.caltech.edu Reply-To: andy@csvax.caltech.edu Organization: California Institute of Technology Lines: 108 A while back someone made the observation that one can easily buy a board that houses a 68020 and plugs into a 68010 (or was it 68000) socket. The problem, of course, was the software. Now that the kernel is available in its consistuent pieces, is it now possible to correct the software problem? The Gnu C compiler is capable of generating 68020 code, and, it seems, the assembler and linker are more than happy to deal with it. Included below are diffs to tm-3b1.h that correct a few minor 68020 boo-boos. (If someone would like to check them, I'll delay forwarding them to bug-gcc.) I've been able to make a 68020 version of gcc, though, of course, I can't run it! Maybe this would even permit a 68881 to be added. (This is where a problem comes up with the loader. A file that uses floating point is flagged by the assembler as either "soft" or "68881". Unfortunately, the loader doesn't appear to allow these two types of objects to be mixed together.) Here are a few lines you can add to /etc/magic to get the cpu and fpu type of a file (this in the m68k executable section): >18 short &0x1800 0x0000 [68010] >18 short &0x1800 0x0800 [68020] >18 short &0xe000 0x0000 [float-none] >18 short &0xe000 0x2000 [float-soft] >18 short &0xe000 0x4000 [68881] >18 short &0xe000 0x8000 [sky] Any thoughts from the experts? Andy Fyfe andy@csvax.caltech.edu *** tm-3b1.h-save Tue Apr 10 02:00:06 1990 --- tm-3b1.h Tue Apr 10 13:33:17 1990 *************** *** 35,39 **** #undef ASM_SPEC ! #define ASM_SPEC "%{m68020:-68020}%{!m68020:-68010}" /* we use /lib/libp/lib* when profiling */ --- 35,39 ---- #undef ASM_SPEC ! #define ASM_SPEC "%{m68020:-68020}%{!m68020:-68010} %{m68881:-68881}" /* we use /lib/libp/lib* when profiling */ *************** *** 97,100 **** --- 97,101 ---- #undef TARGET_VERSION + #undef REGISTER_NAMES #undef ASM_FORMAT_PRIVATE_NAME #undef ASM_OUTPUT_DOUBLE *************** *** 116,119 **** --- 117,125 ---- #define TARGET_VERSION fprintf (stderr, " (68k, SGS/AT&T unixpc syntax)"); + #define REGISTER_NAMES \ + {"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7", \ + "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%fp", "%sp", \ + "%f0", "%f1", "%f2", "%f3", "%f4", "%f5", "%f6", "%f7"} + /* Store in OUTPUT a string (made with alloca) containing an assembler-name for a local static variable named NAME. *************** *** 299,303 **** CODE_LABEL_NUMBER (XEXP (addr, 0)), \ reg_names[REGNO (ireg)]); \ ! if (scale != 1) fprintf (FILE, ":%d", scale); \ fprintf (FILE, ")"); \ break; } \ --- 305,309 ---- CODE_LABEL_NUMBER (XEXP (addr, 0)), \ reg_names[REGNO (ireg)]); \ ! if (scale != 1) fprintf (FILE, "*%d", scale); \ fprintf (FILE, ")"); \ break; } \ *************** *** 324,328 **** else if (ireg != 0) \ fprintf (FILE, "%s.l", reg_names[REGNO (ireg)]); \ ! if (scale != 1) fprintf (FILE, ":%d", scale); \ putc (')', FILE); \ break; \ --- 330,334 ---- else if (ireg != 0) \ fprintf (FILE, "%s.l", reg_names[REGNO (ireg)]); \ ! if (scale != 1) fprintf (FILE, "*%d", scale); \ putc (')', FILE); \ break; \ *************** *** 384,389 **** if (!strncmp ((PTR), "fmove", 5)) \ { fprintf ((FILE), "fmov"); (PTR) += 5; } \ ! else if (!strncmp ((PTR), "ftst", 4)) \ ! { fprintf ((FILE), "ftest"); (PTR) += 4; } \ } \ /* MOVE, MOVEA, MOVEQ, MOVEC ==> MOV */ \ --- 390,395 ---- if (!strncmp ((PTR), "fmove", 5)) \ { fprintf ((FILE), "fmov"); (PTR) += 5; } \ ! else if (!strncmp ((PTR), "fbne", 4)) \ ! { fprintf ((FILE), "fbneq"); (PTR) += 4; } \ } \ /* MOVE, MOVEA, MOVEQ, MOVEC ==> MOV */ \