Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/atari/stand/tostools/loadbsd Add support for the me...



details:   https://anonhg.NetBSD.org/src/rev/4f7b56c82751
branches:  trunk
changeset: 473262:4f7b56c82751
user:      leo <leo%NetBSD.org@localhost>
date:      Thu May 27 09:08:25 1999 +0000

description:
Add support for the memory on the CT2 board. Info from Thomas Goirand.

diffstat:

 sys/arch/atari/stand/tostools/loadbsd/loadbsd.c |  90 +++++++++++++-----------
 sys/arch/atari/stand/tostools/loadbsd/loader.h  |   5 +-
 2 files changed, 53 insertions(+), 42 deletions(-)

diffs (149 lines):

diff -r 34ae6d2214a5 -r 4f7b56c82751 sys/arch/atari/stand/tostools/loadbsd/loadbsd.c
--- a/sys/arch/atari/stand/tostools/loadbsd/loadbsd.c   Thu May 27 09:08:09 1999 +0000
+++ b/sys/arch/atari/stand/tostools/loadbsd/loadbsd.c   Thu May 27 09:08:25 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: loadbsd.c,v 1.13 1997/11/01 06:49:22 lukem Exp $       */
+/*     $NetBSD: loadbsd.c,v 1.14 1999/05/27 09:08:25 leo Exp $ */
 
 /*
  * Copyright (c) 1995 L. Weppelman
@@ -52,7 +52,7 @@
 int    t_flag  = 0;            /* Just test, do not execute    */
 int    v_flag  = 0;            /* show version                 */
 
-const char version[] = "$Revision: 1.13 $";
+const char version[] = "$Revision: 1.14 $";
 
 /*
  * Default name of kernel to boot, large enough to patch
@@ -151,6 +151,7 @@
                fatal(-1, "Cannot open kernel '%s'", kname);
        if (read(fd, (char *)&ehdr, sizeof(ehdr)) != sizeof(ehdr))
                fatal(-1, "Cannot read exec-header of '%s'", kname);
+
        if (N_MAGIC(ehdr) != NMAGIC)
                fatal(-1, "Not an NMAGIC file '%s'", kname);
 
@@ -187,17 +188,18 @@
         * Read symbol and string table
         */
        if (ehdr.a_syms) {
-               long    *p;
+           long        *p;
 
-               p = (long *)(kparam.kp + textsz + ehdr.a_data + ehdr.a_bss);
-               *p++ = ehdr.a_syms;
-               if (read(fd, (char *)p, ehdr.a_syms) != ehdr.a_syms)
-                       fatal(-1, "Cannot read symbol table\n");
-               p = (long *)((char *)p + ehdr.a_syms);
-               if (read(fd, (char *)p, stringsz) != stringsz)
-                       fatal(-1, "Cannot read string table\n");
-               kparam.esym_loc = (long)((char *)p-(char *)kparam.kp +stringsz);
+           p = (long *)(kparam.kp + textsz + ehdr.a_data + ehdr.a_bss);
+           *p++ = ehdr.a_syms;
+           if (read(fd, (char *)p, ehdr.a_syms) != ehdr.a_syms)
+               fatal(-1, "Cannot read symbol table\n");
+           p = (long *)((char *)p + ehdr.a_syms);
+           if (read(fd, (char *)p, stringsz) != stringsz)
+               fatal(-1, "Cannot read string table\n");
+           kparam.esym_loc = (long)((char *)p-(char *)kparam.kp +stringsz);
        }
+       close(fd);
 
        if (d_flag) {
            eprintf("\r\nKernel info:\r\n");
@@ -259,39 +261,45 @@
        jar = *ADDR_P_COOKIE;
        if (jar != NULL) {
                do {
-                       if (jar[0] == 0x5f435055) { /* _CPU     */
-                               switch (jar[1]) {
-                                       case 0:
-                                               kparam.bootflags |= ATARI_68000;
-                                               break;
-                                       case 10:
-                                               kparam.bootflags |= ATARI_68010;
-                                               break;
-                                       case 20:
-                                               kparam.bootflags |= ATARI_68020;
-                                               break;
-                                       case 30:
-                                               kparam.bootflags |= ATARI_68030;
-                                               break;
-                                       case 40:
-                                               kparam.bootflags |= ATARI_68040;
-                                               break;
-                                       case 60:
-                                               kparam.bootflags |= ATARI_68060;
-                                               break;
-                                       default:
-                                               fatal(-1, "Unknown CPU-type");
-                               }
+                   if (jar[0] == 0x5f435055) { /* _CPU */
+                       switch (jar[1]) {
+                               case 0:
+                                       kparam.bootflags |= ATARI_68000;
+                                       break;
+                               case 10:
+                                       kparam.bootflags |= ATARI_68010;
+                                       break;
+                               case 20:
+                                       kparam.bootflags |= ATARI_68020;
+                                       break;
+                               case 30:
+                                       kparam.bootflags |= ATARI_68030;
+                                       break;
+                               case 40:
+                                       kparam.bootflags |= ATARI_68040;
+                                       break;
+                               case 60:
+                                       kparam.bootflags |= ATARI_68060;
+                                       break;
+                               default:
+                                       fatal(-1, "Unknown CPU-type");
                        }
-                       if (jar[0] == 0x42504658) { /* BPFX     */
-                               unsigned long   *p;
+                   }
+                   if (jar[0] == 0x42504658) { /* BPFX */
+                       unsigned long   *p;
 
-                               p = (unsigned long*)jar[1];
+                       p = (unsigned long*)jar[1];
 
-                               kparam.ttmem_start = p[1];
-                               kparam.ttmem_size  = p[2];
-                       }
-                       jar = &jar[2];
+                       kparam.ttmem_start = p[1];
+                       kparam.ttmem_size  = p[2];
+                   }
+                   if (jar[0] == 0x5f435432) { /* _CT2 */
+                       /*
+                        * The CT2 board has a different physical base address!
+                        */
+                       kparam.ttmem_start = CTRAM_BASE;
+                   }
+                   jar = &jar[2];
                } while (jar[-2]);
        }
        if (!(kparam.bootflags & ATARI_ANYCPU))
diff -r 34ae6d2214a5 -r 4f7b56c82751 sys/arch/atari/stand/tostools/loadbsd/loader.h
--- a/sys/arch/atari/stand/tostools/loadbsd/loader.h    Thu May 27 09:08:09 1999 +0000
+++ b/sys/arch/atari/stand/tostools/loadbsd/loader.h    Thu May 27 09:08:25 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: loader.h,v 1.6 1996/01/07 22:06:18 leo Exp $   */
+/*     $NetBSD: loader.h,v 1.7 1999/05/27 09:08:25 leo Exp $   */
 
 /*
  * Copyright (c) 1995 L. Weppelman
@@ -47,6 +47,9 @@
 #endif
 
 #define        TTRAM_BASE      0x1000000       /* Fastram always starts here   */
+#define        CTRAM_BASE      0x4000000       /*  ... except on CT2 boards:   */
+                                       /*         Logical : TTRAM_BASE */
+                                       /*         Physical: CTRAM_BASE */
 
 /*
  * System var's used in low-memory



Home | Main Index | Thread Index | Old Index