linux-mips-fnet
[Top] [All Lists]

Re: Booting 1.3.96, kinda

To: linux-mips@fnet.fr
Subject: Re: Booting 1.3.96, kinda
From: Warner Losh <imp@village.org>
Date: Sun, 12 May 1996 21:16:39 -0600
In-reply-to: Your message of Mon, 13 May 1996 04:56:34 +0200
: Ok, I'll try to integrate them into my source tree though this is now
: a bit more difficult ...

After a mild panic attack re fs corruption, I have the patches ready.
The exerimental EXT2FS feature of FreeBSD (when used in -stable rather
than the more supported -current) seems to cause some mild file system
corruptions sometimes for reasons unknown.  I've backed out these
changes :-(.

: The workaround for the 640k problem (Bill is watching you ...) is buggy
: in your release.  When freeing the memory I've freed ALL memory from
: 0-640kb - even the copy of the exception handlers.  This should have
: affected you yet ...

Yes.  It bit me!  Right after it printed the banner for the linux
version.  I've fixed it, I believe.  Also, it would free the first
page of the ISA bus as well.

: Your kernel is trying to start /bin/sh again and again but fails each
: time trying ...

Yep.  That's what I figure.  I think it is trying three times and can
never find it any of those times. :-)  Or trying three different
programs (/bin/init /sbin/init and /bin/sh would be my guess).

: You might really try to use NFS root; it's extremly usefull for development.

I know.  My machines are in the DMZ for the village's network, so I
can't run NFS on them.  I'm working on a scam to let me do that,
however....

Warner

P.S.  Here are my patches.  They add comments, fix bugs and cleanup a
little of the deskstation support.  Some have been posted before.  The
CONFIG_PROC_FS one is to allow me to compile a kernel w/o procfs.
scsi driver still has problems, but I'm about to start compiling it
in, so I've not fixed them.  These diffs are relative to 1.3.96 from
the ftp.fnet.fr server.  If need be, I can still identify what,
exactly, I was doing for each one, so feel free to ask.

diff -r -u linux-96/arch/mips/Makefile linux/arch/mips/Makefile
--- linux-96/arch/mips/Makefile Sun May  5 17:39:55 1996
+++ linux/arch/mips/Makefile    Sat May 11 23:36:46 1996
@@ -100,6 +100,10 @@
 # The DECStation boot PROM loads kernels at 0x80030000.
 # Jazz machines load the kernel at 0x80000000.
 #
+# Deskstation machines can load their kernels anywhere, but if loaded at 
+# 0x80000000 they are subject to the familiar 640k limit.  We cope by 
+# loading them at 1M.
+#
 ifdef CONFIG_DECSTATION
 LINKFLAGS     := $(LINKFLAGS) -T arch/mips/ld.script.dec
 else
diff -r -u linux-96/arch/mips/kernel/irq.c linux/arch/mips/kernel/irq.c
--- linux-96/arch/mips/kernel/irq.c     Sun May  5 07:07:39 1996
+++ linux/arch/mips/kernel/irq.c        Sat May 11 17:44:29 1996
@@ -372,22 +372,10 @@
                        setup_x86_irq(2, &irq2);
                        break;
                case MACH_DESKSTATION_TYNE:
-                       /* set the clock to 100 Hz */
-                       outb_p(0x34,0x43);              /* binary, mode 2, 
LSB/MSB, ch 0 */
-                       outb_p(LATCH & 0xff , 0x40);    /* LSB */
-                       outb(LATCH >> 8 , 0x40);        /* MSB */
-                       request_region(0x20,0x20, "pic1");
-                       request_region(0xa0,0x20, "pic2");      
-                       setup_x86_irq(2, &irq2);
-
-                       if (request_irq(2, no_action, SA_INTERRUPT, "cascade", 
NULL))
-                               printk("Unable to get IRQ2 for cascade\n");
-                       break;
                case MACH_DESKSTATION_RPC44:
-                       /*
-                        * For the moment just steal the TYNE support.  In the
-                        * future, we need to consider merging the two -- imp
-                        */
+                       /* Assume that Tyne and rPC44 are the same here. */
+                       set_cp0_status(ST0_IM,
+                                      IE_IRQ4 | IE_IRQ3 | IE_IRQ2 | IE_IRQ1);
                        /* set the clock to 100 Hz */
                        outb_p(0x34, 0x43);             /* binary, mode 2, 
LSB/MSB, ch 0 */
                        outb_p(LATCH & 0xff , 0x40);    /* LSB */
@@ -395,9 +383,6 @@
                        request_region(0x20,0x20, "pic1");
                        request_region(0xa0,0x20, "pic2");
                        setup_x86_irq(2, &irq2);
-                       set_cp0_status(ST0_IM, IE_IRQ4 | IE_IRQ3 | IE_IRQ2 | 
IE_IRQ1);
-                       if (request_irq(2, no_action, SA_INTERRUPT, "cascade", 
NULL))
-                               printk("Unable to get IRQ2 for cascade\n");
                        break;
                case MACH_DECSTATION:
                        /* FIXME: should set up the clock as per above? */
diff -r -u linux-96/arch/mips/kernel/rpc44-c.c linux/arch/mips/kernel/rpc44-c.c
--- linux-96/arch/mips/kernel/rpc44-c.c Sun May  5 00:16:36 1996
+++ linux/arch/mips/kernel/rpc44-c.c    Thu May  9 14:48:21 1996
@@ -8,6 +8,4 @@
  * Copyright (C) 1994, 1995 by Ralf Baechle
  */
 #define DS_TYPE deskstation_rpc44_
-#define DS_MACHINE_TYPE MACH_DESKSTATION_RPC44
-#define DS_MACH_STR "Rpc44"
 #include "tyne-c.c"
diff -r -u linux-96/arch/mips/kernel/setup.c linux/arch/mips/kernel/setup.c
--- linux-96/arch/mips/kernel/setup.c   Sun May  5 19:21:23 1996
+++ linux/arch/mips/kernel/setup.c      Sun May 12 15:36:26 1996
@@ -412,15 +412,7 @@
        if (atag)
          root_mountflags |= MS_RDONLY;
 
-       /*
-        * On the deskstation rpc44, for the moment, only the kernel is
-        * below 1M.  xxx imp fixme  MILO should set these, but doesn't
-        * seem to be.
-        */
-       if (mips_machtype == MACH_DESKSTATION_RPC44)
-               memory_start = (unsigned long) KSEG0 + (1 << 20);
-       else
-               memory_start = (unsigned long) &_end;
+       memory_start = (unsigned long) &_end;
 
        atag = bi_TagFind(tag_command_line);
        if (atag)
diff -r -u linux-96/arch/mips/kernel/tyne-c.c linux/arch/mips/kernel/tyne-c.c
--- linux-96/arch/mips/kernel/tyne-c.c  Sun May  5 00:23:44 1996
+++ linux/arch/mips/kernel/tyne-c.c     Thu May  9 15:10:26 1996
@@ -12,12 +12,6 @@
 #ifndef DS_TYPE
 #define DS_TYPE deskstation_tyne_
 #endif
-#ifndef DS_MACHINE_TYPE
-#define DS_MACHINE_TYPE MACH_DESKSTATION_TYNE
-#endif
-#ifndef DS_MACH_STR
-#define DS_MACH_STR "Tyne"
-#endif
 
 #define MKNAME3(a,b) b##a
 #define MKNAME2(a,b) MKNAME3(a,b)
diff -r -u linux-96/arch/mips/mips3/cache.S linux/arch/mips/mips3/cache.S
--- linux-96/arch/mips/mips3/cache.S    Sun May  5 18:50:55 1996
+++ linux/arch/mips/mips3/cache.S       Thu May  9 16:22:36 1996
@@ -7,6 +7,8 @@
  *
  * Copyright (C) 1994, 1995, 1996 by Ralf Baechle and Andreas Busse
  */
+#include <linux/config.h>
+
 #include <asm/asm.h>
 #include <asm/cachectl.h>
 #include <asm/mipsregs.h>
@@ -45,12 +47,14 @@
                beqz    t1,do_icache
                li      t0,KSEG0                        # delay slot
 
+#ifdef CONFIG_PROC_FS
        /*
         * Some profiling ...
         */
        lw      v0,dflushes
        addiu   v0,1
        sw      v0,dflushes
+#endif
                /*
                 * Writeback data cache, even lines
                 */
@@ -106,12 +110,14 @@
 do_icache:     andi    t1,a2,ICACHE
                beqz    t1,done
 
+#ifdef CONFIG_PROC_FS
        /*
         * Again some profiling ...
         */
        lw      v0,iflushes
        addiu   v0,1
        sw      v0,iflushes
+#endif
                /*
                 * Flush instruction cache, even lines
                 */
diff -r -u linux-96/arch/mips/mm/init.c linux/arch/mips/mm/init.c
--- linux-96/arch/mips/mm/init.c        Sun May  5 18:14:23 1996
+++ linux/arch/mips/mm/init.c   Sun May 12 16:39:47 1996
@@ -267,18 +267,22 @@
 
        /*
         * For the rPC44 we've reserved some memory too much.  Free the
-        * memory from PAGE_SIZE to PAGE_OFFSET + 0xa0000 again.
+        * memory from PAGE_SIZE to PAGE_OFFSET + 0xa0000 again.  Don't
+        * free anything between 0xa0000 and 0xf0000 because that's where
+        * hardware lives.  Also, maybe other PC-like machines need this
+        * too.
         */
        if (mips_machtype == MACH_DESKSTATION_RPC44) {
-               tmp = PAGE_OFFSET;
-               while (tmp <= PAGE_OFFSET + 0xa000) {
+               tmp = PAGE_OFFSET + PAGE_SIZE;
+               while (tmp < PAGE_OFFSET + 0xa000) {
                        clear_bit(PG_reserved, &mem_map[MAP_NR(tmp)].flags);
                        tmp += PAGE_SIZE;
                }
        }
 
 #ifdef CONFIG_DESKSTATION_TYNE
-       deskstation_tyne_dma_init();
+       if (mips_machtype == MACH_DESKSTATION_TYNE)
+               deskstation_tyne_dma_init();
 #endif
        for (tmp = PAGE_OFFSET ; tmp < high_memory ; tmp += PAGE_SIZE) {
                /*
diff -r -u linux-96/drivers/char/keyboard.c linux/drivers/char/keyboard.c
--- linux-96/drivers/char/keyboard.c    Sun May  5 18:18:45 1996
+++ linux/drivers/char/keyboard.c       Sat May 11 23:35:42 1996
@@ -1288,9 +1288,18 @@
                /*
                 * These two machines address their keyboard via the normal
                 * port address range.
+                *
+                * Also enable Scan Mode 2.
                 */
                request_irq(KEYBOARD_IRQ, keyboard_interrupt, 0, "keyboard", 
NULL);
                request_region(0x60,16,"kbd");
+               kb_wait();
+               kbd_outb(0x60, 0x64); /* 60 == PS/2 MODE ??  */
+               kb_wait();
+               kbd_outb(0x41, 0x60); /* 4d:same as freebsd, 41:KCC+EKI */
+               kb_wait();
+               if (!send_data(0xf0) || !send_data(0x02))
+                       printk("Scanmode 2 change failed\n");
        }
        if (mips_machgroup == MACH_GROUP_JAZZ) {
                /*
@@ -1301,7 +1310,9 @@
        }
 #endif /* defined (__mips__) */
 #ifdef INIT_KBD
-       initialize_kbd();
+       if (mips_machtype == MACH_ACER_PICA_61 ||
+           mips_machtype == MACH_MIPS_MAGNUM_4000)
+               initialize_kbd();
 #endif
        init_bh(KEYBOARD_BH, kbd_bh);
        mark_bh(KEYBOARD_BH);

<Prev in Thread] Current Thread [Next in Thread>