[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Support in uname for Falcon and MagiC
Here's a patch for uname.c in the MiNTlibs to make it recognise the
Falcon and MagiC. I have neither a Falcon, nor MagiC, however, so I
can't test it. To anyone who has, please let us know if it works...
I'm not sure whether the name given for the Falcon should be "falcon"
as shown below... To match the name already there, it ought to be
"atarifalcon" but that doesn't fit in the space available. In any
case, if/when C-Lab take over Falcon production, it won't be the
*Atari* Falcon any more. :)
I don't know how to find out MagiC's version number either. ST
Applications doesn't say.
--
Charles Briscoe-Smith
3rd Year student of Computer Science
University of Kent at Canterbury, United Kingdom, European Union.
World Wide Web: http://aurora.etsiig.uniovi.es:3080/~~pippin/
--- uname.c Wed Sep 15 12:09:00 1993
+++ my.uname.c Wed Mar 15 22:11:44 1995
@@ -6,6 +6,8 @@
* version number in the 'version' field (even under MiNT).
*
* (Modified slightly by ERS.)
+ *
+ * Now recognises the Falcon and MagiC. --cpbs
*/
#include <stdlib.h>
@@ -23,6 +25,7 @@
__EXTERN int gethostname __PROTO((char *buf, size_t len));
static long _mch; /* value of the _MCH cookie, if any */
+static long magx; /* MagX cookie, if any (indicates MagiC installed) */
static int tosvers; /* TOS version number */
/*
@@ -36,7 +39,7 @@
{
long *cookie, *sysbase;
-/* get _MCH cookie value */
+/* get _MCH and MagX cookie values */
cookie = *((long **) 0x5a0L);
if (cookie) {
while (*cookie) {
@@ -44,6 +47,10 @@
_mch = cookie[1];
break;
}
+ if (*cookie == 0x4d616758L) { /* MagX */
+ magx = cookie[1];
+ break;
+ }
cookie += 2;
}
}
@@ -63,11 +70,12 @@
if (!tosvers)
(void)Supexec(getinfo);
- strcpy(buf->sysname, __mint ? "MiNT" : "TOS");
+ strcpy(buf->sysname, __mint ? "MiNT" : magx ? "MagiC" : "TOS");
if (gethostname(buf->nodename, (size_t) 15))
strcpy(buf->nodename, "??node??");
+ /* TODO: find out MagiC version number */
if (__mint)
sprintf(buf->release, "%d.%d", HILO(__mint));
else
@@ -82,6 +90,8 @@
strcpy(buf->machine, "atariste"); break;
case 2:
strcpy(buf->machine, "ataritt"); break;
+ case 3:
+ strcpy(buf->machine, "falcon"); break;
default:
strcpy(buf->machine, "atari");
}