diff -ur milo-2.0.30-0.4/boot_main.c milo-2.0.30-0.4.new/boot_main.c --- milo-2.0.30-0.4/boot_main.c Mon Nov 24 19:16:09 1997 +++ milo-2.0.30-0.4.new/boot_main.c Mon Jun 1 17:22:54 1998 @@ -245,6 +245,8 @@ #define HLT 0x02 /* 4 mS */ #define ND 0x00 /* Use DMA */ +extern void entMM (void); + static void fdasleep(int nmsec) { int i; @@ -1106,6 +1108,9 @@ /***************************************************************************** * Do any CPU specific initialisation required * *****************************************************************************/ + + /* enable memory fault handler */ + wrent (entMM, 2); /* we need the hwrpb set up before we can do this */ /* This gets us keyboard and VGA (I hope) */ diff -ur milo-2.0.30-0.4/entry.S milo-2.0.30-0.4.new/entry.S --- milo-2.0.30-0.4/entry.S Wed Sep 24 06:03:19 1997 +++ milo-2.0.30-0.4.new/entry.S Mon Jun 1 20:49:11 1998 @@ -88,18 +88,14 @@ .globl entMM .ent entMM -entMM: br zero,entMM - br gp,1f +entMM: br gp,1f 1: ldgp gp,0(gp) - lda sp,-8(sp) - stq ra,0(sp) - ldq a3,8(sp) - ldq a4,16(sp) - ldq a5,24(sp) + ldq a3,0(sp) + ldq a4,8(sp) + ldq a5,16(sp) + bis zero,ra,a0 jsr ra,do_entMM - ldq ra,0(sp) - lda sp,8(sp) - ret zero,(ra) + call_pal PAL_halt .end entMM .globl entIF diff -ur milo-2.0.30-0.4/memory.c milo-2.0.30-0.4.new/memory.c --- milo-2.0.30-0.4/memory.c Thu Sep 18 16:04:25 1997 +++ milo-2.0.30-0.4.new/memory.c Mon Jun 1 21:07:06 1998 @@ -580,10 +580,14 @@ void do_entMM(u64 a0, u64 a1, u64 a2, u64 ps, u64 pc, u64 gp) { - printk("MM fault: ps = 0x%lx, pc = 0x%lx, gp = 0x%lx\n", - ps, pc, gp); - printk(" a0 = 0x%lx, a1 = 0x%lx, a2 = 0x%lx\n", a0, a1, a2); - for(;;) ; /* wait forever */ + /* inform user of memory fault and regs */ + printk ("\nMemory fault:\n"); + printk(" ps = 0x%016lx, pc = 0x%016lx, gp = 0x%016lx\n", ps, pc, gp); + printk(" a0 = 0x%016lx, a1 = 0x%016lx, a2 = 0x%016lx\n", a0, a1, a2); + + /* wait for keypress */ + printk("\nPress any key to reboot... "); + kbd_getc(); } diff -ur milo-2.0.30-0.4/milo.c milo-2.0.30-0.4.new/milo.c --- milo-2.0.30-0.4/milo.c Mon Nov 24 22:54:17 1997 +++ milo-2.0.30-0.4.new/milo.c Mon Jun 1 21:07:47 1998 @@ -155,7 +155,7 @@ &boot_parse}, {"read", "dev: blknum", - "Read a block (256 bytes) from given dev at given block", + "Read from given dev starting at given block", &read_parse}, {"run", "[-t fs] dev:file", @@ -797,8 +797,9 @@ #ifndef MINI_EMBED_LINUX static void read_cmd(char *lsdev, int blknum) { - unsigned char buf[256]; + unsigned char buf[24*16]; /* One screenful at a time */ int rc, i, n; + long offset = blknum*512; /* For partitions up to 512 GB... */ int dummyfd = -1; dummyfd = device_open(lsdev); @@ -806,26 +807,33 @@ printk("read: Could not open device: %s\n", lsdev); return; } - rc = device_read(dummyfd, buf, sizeof(buf), blknum * 512); - device_close(dummyfd); - if (rc < 0) { - printk("Read of block from %s:[%d] failed\n", lsdev, blknum); - return; - } - printk("\n"); - for (n = 0; n < rc; n += 16) { - printk(" %3x:", n); - for (i = 0; i < 16; ++i) - printk(" %02X", buf[n + i]); - printk(" |"); - for (i = 0; i < 16; ++i) { - int c = buf[n + i]; + do { + rc = device_read(dummyfd, buf, sizeof(buf), offset); - printk("%c", (c <= ' ' || c > 126) ? '.' : c); - } - printk("|\n"); + if (rc < 0) { + printk("\nRead of block from %s:[%d] failed\n", lsdev, blknum); + return; + } + printk("\n"); + for (n = 0; n < rc; n += 16) { + printk("%010lx:", offset+n); + for (i = 0; i < 16; ++i) + printk(" %02x", buf[n + i]); + printk(" |"); + for (i = 0; i < 16; ++i) { + int c = buf[n + i]; + + printk("%c", (c <= ' ' || c > 126) ? '.' : c); + } + printk("|\n"); + } + printk (" -- q to quit - any other key to continue --"); + offset += sizeof(buf); } + while (kbd_getc () != 'q'); + + printk ("\n"); device_close (dummyfd); } #endif @@ -1088,7 +1096,7 @@ token = __PULL(); if (token != NULL) { - int len = strlen(readdev); + int len = strlen(token); readdev = token; if (len > 0 && readdev[len - 1] == ':') @@ -1098,7 +1106,7 @@ if ((token != NULL && (readblk = atoi(token)) < 0) || (readdev == NULL) || (token == NULL)) { printk("MILO: 'read' command requires a device name and block number\n"); - printk(" MILO> run fd0: blknum\n"); + printk(" MILO> read fd0: blknum\n"); } else { read_cmd(readdev, readblk); } diff -ur milo-2.0.30-0.4/x86_sysenv.c milo-2.0.30-0.4.new/x86_sysenv.c --- milo-2.0.30-0.4/x86_sysenv.c Mon Nov 24 19:45:22 1997 +++ milo-2.0.30-0.4.new/x86_sysenv.c Fri Apr 10 21:14:15 1998 @@ -41,6 +41,16 @@ #include "sysenv.h" #include "host.h" +/* this will be accurate for machines rated at 200 BogoMIPS */ +/* it will be too long for slow machines, and too fast for others, but... */ +/* this will be used by the "udelay" macro whenever */ +/* the "calibrate_delay" routine has *NOT* been called beforehand. */ +unsigned long loops_per_sec = 100000000UL; + +void *malloc(int size) +{ return vmalloc(size); +} + #ifdef MINI_DIGITAL_BIOSEMU /* * Use Digital's BIOS emulation technology to set up the video device. @@ -100,10 +110,6 @@ return pci_root.subordinate; } -void *malloc(int size) -{ return vmalloc(size); -} - #ifdef NOT_NOW unsigned char InPciCfgB(unsigned int bus, unsigned int dev, unsigned int func, unsigned int reg) @@ -153,12 +159,6 @@ pcibios_write_config_dword(bus, PCI_DEVFN(dev, func), reg, data); } #endif /* NOT_NOW */ - -/* this will be accurate for machines rated at 200 BogoMIPS */ -/* it will be too long for slow machines, and too fast for others, but... */ -/* this will be used by the "udelay" macro whenever */ -/* the "calibrate_delay" routine has *NOT* been called beforehand. */ -unsigned long loops_per_sec = 100000000UL; /* used only by the BIOS emulator for delaying before its banner message */