locore.s: attempts to get back to the pc532 rom monitor

machdep.c: debug cleanup and queues change
This commit is contained in:
phil 1994-04-25 18:13:41 +00:00
parent 18cbcf5368
commit 6275189adf
2 changed files with 51 additions and 31 deletions

View File

@ -295,6 +295,23 @@ ENTRY (_get_fp)
addr 0(fp), r0
ret 0
/* reboot the machine :) if possible */
.globl _rebootPTD
ENTRY(low_level_reboot)
ints_off /* Stop things! */
addr xxxlow(pc), r0 /* jump to low memory */
andd ~KERNBASE, r0
movd r0, tos
lmr ptb0, _rebootPTD(pc) /* get the right map */
ret 0
xxxlow:
lmr mcr, 0 /* Turn off mapping. */
movd 0x10000000, tos /* The ROM Address */
ret 0 /* Jump to the ROM! */
/* To get back to the rom monitor .... */
ENTRY(bpt_to_monitor)
@ -1134,8 +1151,8 @@ do_soft_intr:
cmpqd 0, _want_softnet(pc)
beq no_net
DONET(NETISR_RAW, _rawintr)
#ifdef INET
/* DONET(NETISR_ARP, _arpintr) */
DONET(NETISR_IP, _ipintr)
#endif
#ifdef IMP
@ -1146,6 +1163,12 @@ do_soft_intr:
#endif
#ifdef ISO
DONET(NETISR_ISO, _clnlintr)
#endif
#ifdef notyet
#ifdef CCITT
DONET(NETISR_X25, _pkintr)
DONET(NETISR_HDLC, _hdintr)
#endif
#endif
movqd 0, _want_softnet(pc)
movqd 0, _netisr(pc)
@ -1318,8 +1341,8 @@ do_spl0:
cmpqd 0, _want_softnet(pc)
beq no_net1
DONET(NETISR_RAW, _rawintr)
#ifdef INET
/* DONET(NETISR_ARP, _arpintr) */
DONET(NETISR_IP, _ipintr)
#endif
#ifdef IMP
@ -1330,6 +1353,12 @@ do_spl0:
#endif
#ifdef ISO
DONET(NETISR_ISO, _clnlintr)
#endif
#ifdef notyet
#ifdef CCITT
DONET(NETISR_X25, _pkintr)
DONET(NETISR_HDLC, _hdintr)
#endif
#endif
movqd 0, _want_softnet(pc)
movqd 0, _netisr(pc)

View File

@ -115,6 +115,7 @@ int maxmem = 0;
vm_offset_t KPTphys;
int IdlePTD;
int rebootPTD;
int start_page;
int _istack;
@ -132,7 +133,7 @@ _low_level_init ()
int p0, p1, p2;
extern int _mapped;
umprintf ("starting low level init\n");
umprintf ("starting low level init\n");
mem_size = ram_size(end);
physmem = btoc(mem_size);
@ -141,8 +142,8 @@ umprintf ("starting low level init\n");
avail_end = mem_size - NS532_PAGE_SIZE;
umprintf ("mem_size = 0x%x\nphysmem=%x\nstart_page=0x%x\navail_end=0x%x\n",
mem_size, physmem, start_page, avail_end);
umprintf ("mem_size = 0x%x\nphysmem=%x\nstart_page=0x%x\navail_end=0x%x\n",
mem_size, physmem, start_page, avail_end);
/* Initialize the mmu with a simple memory map. */
@ -164,7 +165,6 @@ mem_size, physmem, start_page, avail_end);
avail_start += NS532_PAGE_SIZE;
bzero ((char *)p1, NS532_PAGE_SIZE);
umprintf ("point 1,");
/* Addresses here start at FFC00000... */
/* Map the interrupt stack to FFC00000 - FFC00FFF */
@ -172,40 +172,30 @@ umprintf ("point 1,");
/* All futhur entries are cache inhibited. => 0x4? in low bits. */
umprintf ("2\n");
/* The Duarts and Parity. Addresses FFC80000 */
WR_ADR(int, p1+4*0x80, 0x28000043);
umprintf ("3 .. p1 = 0x%x\n", p1);
/* SCSI Polled (Reduced space.) Addresses FFD00000 - FFDFFFFF */
for (ix = 0x100; ix < 0x200; ix++)
WR_ADR(int, p1 + ix*4, 0x30000043 + ((ix - 0x100)<<12));
umprintf ("4,");
/* SCSI "DMA" (Reduced space.) Addresses FFE00000 - FFEEFFFF */
for (ix = 0x200; ix < 0x2ff; ix++)
WR_ADR(int, p1 + ix*4, 0x38000043 + ((ix - 0x200)<<12));
umprintf ("5,");
/* SCSI "DMA" With A22 (EOP) Addresses FFEFF000 - FFEFFFFF */
WR_ADR(int, p1 + 0x2ff*4, 0x38400043);
umprintf ("6,");
/* The e-prom Addresses FFF00000 - FFF3FFFF */
for (ix = 0x300; ix < 0x340; ix++)
WR_ADR(int, p1 + ix*4, 0x10000043 + ((ix - 0x300)<<12));
umprintf ("7,");
/* Finally the ICU! Addresses FFFFF000 - FFFFFFFF */
WR_ADR(int, p1+4*0x3ff, 0xFFFFF043);
umprintf ("8,");
/* Add the memory mapped I/O entry in the directory. */
WR_ADR(int, p0+4*1023, p1 + 0x43);
umprintf ("9,");
/* Map the kernel pages starting at FE00000 and at 0.
It also maps any pages past the end of the kernel,
up to the value of avail_start at this point.
@ -223,13 +213,16 @@ umprintf ("9,");
WR_ADR(int,p0+4*pdei(KERNBASE), p2 + 3);
WR_ADR(int,p0, p2+3);
umprintf ("10,");
for (ix = 0; ix < (avail_start)/NS532_PAGE_SIZE; ix++) {
WR_ADR(int, p2 + ix*4, NS532_PAGE_SIZE * ix + 3);
}
/* the PTD for the reboot process */
rebootPTD = (int) avail_start;
avail_start += NS532_PAGE_SIZE;
bcopy ((char *)p0, (char *)rebootPTD, NS532_PAGE_SIZE);
/* Load the ptb0 register and start mapping. */
umprintf ("exiting low level init\n");
_mapped = 1;
_load_ptb0 (p0);
@ -248,14 +241,10 @@ init532()
void (**int_tab)();
extern int _save_sp;
umprintf ("starting init532\n");
#if 1
#if 0
/* Initial testing messages .... Removed at a later time. */
printf ("Welcome to the first initial bits of NetBSD/532!\n");
printf (" (%s)\n", version);
printf ("Memory size is %d Megs\n", ((int)mem_size) / (1024*1024));
printf ("physmem = %d (0x%x)\n", physmem, physmem);
@ -270,8 +259,6 @@ umprintf ("starting init532\n");
printf ("number of free pages = %d\n", free_pages);
#endif
umprintf ("after init532 printfs\n");
/*#include "ddb.h" */
#if NDDB > 0
kdb_init();
@ -684,7 +671,7 @@ boot(arghowto)
}
howto = arghowto;
printf ("boot: howto=0x%x\n", howto);
if ((howto&RB_NOSYNC) == 0 && waittime < 0 && bfreelist[0].b_forw) {
if ((howto&RB_NOSYNC) == 0 && waittime < 0) {
register struct buf *bp;
int iter, nbusy;
@ -720,13 +707,11 @@ printf ("boot: howto=0x%x\n", howto);
else
printf("done\n");
#if 0
/*
* If we've been adjusting the clock, the todr
* will be out of synch; adjust it now.
*/
resettodr();
#endif
DELAY(10000); /* wait for printf to finish */
}
@ -750,6 +735,7 @@ printf ("boot: howto=0x%x\n", howto);
fp = (int *)fp[0];
if (++i == 3) { printf ("\n"); i=0; }
}
for(;;) ; /* Stop here! */
}
#else
savectx(&dumppcb, 0);
@ -989,10 +975,11 @@ copystr(fromaddr, toaddr, maxlength, lencopied) u_int *lencopied, maxlength;
}
#if 0
int dumpmag = 0x8fca0101; /* magic number for savecore */
int dumpsize = 0; /* also for savecore */
#if 0
/*
* Doadump comes here after turning off memory management and
* getting on the dump stack, either when called above, or by
@ -1105,8 +1092,12 @@ void bad_intr (struct intrframe frame)
void reboot_cpu()
{
printf ("Should be rebooting! Hit reset!\n");
while (1);
extern void low_level_reboot();
/* Point Low MEMORY to Kernel Memory! */
WR_ADR(int, PTD, RD_ADR(int,PTD+4*pdei(KERNBASE)));
low_level_reboot();
}
int