***************************************************************** * * * MORROW 68K SYSTEM boot EPROM REV 0. * * * * initial coding: 5/15/84 -bjg- * * * * STILL TO BE DONE: 1) initialize vectors * * 2) initialize MMU * * 3) Compupro POJ sequence with jsr.l * * 4) debug monitor * * * ***************************************************************** ioaddr = $ff0000 * compupro i/o address space staddr = $20000 * first ram address to test *********************************** * Compupro interfacer IV equates * *********************************** sio = ioaddr+$10 * interfacer base address siostat = sio+$1 * uart status siodat = sio * uart data select = sio+$7 * group select port console = 7 * interface left port ********************** * mult i/o equates * ********************** base = ioaddr+$48 * standard base address grpctl = base+$7 * select port dll = base * divisor latch lsb dlm = base+$1 * divisor latch msb ier = base+$1 * interrupt enable register lcr = base+$3 * line control register mcr = base+$4 * modem control register lsr = base+$5 * line status register rbr = base * receive buffer register thr = base * trasnmitter holding register dlab = $80 * divisor latch access bit thre = $20 * transmitter hold reg empty status dr = $1 * received data ready status ******************** * SIO4/DMA equates * ******************** * sio port assignments sbase = ioaddr+$20 * SIO4 base I/O address dmaddrl = sbase * low byte dma address dmaddrh = sbase+$1 * high byte dma address dmaddre = sbase+$2 * extended byte of dma address recntrl = sbase+$3 * receiver control port lcount = sbase+$4 * low byte of dma count hcount = sbase+$5 * high byte of dma count enable = sbase+$6 * start / stop enable dmacntl = sbase+$7 * dma control and status sdata = sbase+$8 * uart data port sstatus = sbase+$9 * uart status port smode = sbase+$a * uart mode register scommnd = sbase+$b * uart command register fifost = sbase+$c * fifo status fifoda = sbase+$d * fifo data dmaglbl = sbase+$e * global dma status sselect = sbase+$f * tty select port * sio constants control = $27 * normal async mode ttya = 0 * select byte for ttya ttyb = 1 * select byte for tttb ttyc = 2 * select byte for tttc ttyd = 3 * select byte for tttd divisor = $d * 9600 baud divisor * divisor = $8 * 1200 baud divisor * divisor = $e * 19200 baud divisor * sio flags and masks done = $40 * DMA idle when port 27 = 40 sro = $1 * transmit buffer empty when high sr1 = $2 * receive buffer full when high sr6 = $40 * carrier detected when low sr7 = $80 * data set ready when low kick = 1 * value to kick controller *************************** * miscellaneous equates * *************************** abel = $07 * ascii bell alf = $a * ascii line feed acr = $d * ascii carriage return asp = $20 * ascii space acs = $1a * ascii clear for ADM31 qpat = $55AAAA55 * initial ram test pattern spat = $ff0000ff * second pattern stop = $F0000 * end of 2 Meg ramtest area page = 1024 * 2K X 8 ram chips image = 0 uerr = $4fe ********************************* * B E G I N C O D E * ********************************* * set baud rates for all four SIO4 ports * 9600 baud, async, no parity, 8 data and 2 stop bits sbaud: move.b #ttya,d2 * select uart 0 sbaud1: move.b d2,sselect * select the tty move.b scommnd,d0 * set up for uart mode reg. 1 move.b smode,d1 * read mode register 1 point to 2 move.b smode,d0 * read mode register 2 point to 1 move.b smode,d1 * read mode register 1 setup for 2 andi.b #$f0,d0 * strip baud rate off ori.b #divisor,d0 * lower 4 bits = 9600 baud move.b d0,smode * write register 2 move.b #control,scommnd * set it for normal async rs232 addq.b #1,d2 * next one cmpi.b #4,d2 bne sbaud1 move.b #ttya,sselect * PRINT SIGNON init1: move.l #signon,a1 * say hello move.l #ramtest,a6 * set up return through a6 bra string * check for good ram before using stack ramtest: move.l #staddr,a0 * beginning of ram move.l #qpat,d0 * ramtest pattern move.l #spat,d1 * test with aa55 and 55aa pattern ramtst1: move.w d0,(a0) * write it cmp.w (a0),d0 * check it bne ramerr swap.w d0 * complement move.w d0,(a0) * write it cmp (a0),d0 * read it bne ramerr * test with ff00 and 00ff pattern move.w d1,(a0) * write it cmp (a0),d1 * check it bne ramerr swap.w d1 * complement move.w d1,(a0) * write it cmp (a0),d1 * read it bne ramerr addq.l #2,a0 * increment to next word address bra ramtst1 ramerr: cmpa.l #staddr,a0 * check for no memory bne ramer2 move.l #ramer1,a6 * save return address move.l #rerr1,a1 * no ram message bra string ramer1: jmp ramer1 * loop forever ramer2: move.l a0,a7 * set up stack cmpa.l #$80000,a0 bge ramok move.l #rerr2,a1 move.l #ramer1,a6 * return to main bra string ramok: move.l #ramgood,a1 * print ram ok move.l #main,a6 * setup the return bra string * This routine will call all the others * but loops for now main: bsr conin bsr conout jmp main ************************************************* * * * S I O 4 C O N S O L E R O U T I N E S * * * ************************************************* * routine gets character from SIO4 board * return with character in d1, d0 preserved conin: move.b d0,-(sp) * stash move.b #0,sselect conin1: move.b sstatus,d0 andi.b #sr1,d0 * check uart rda flag beq conin1 * loop till char rcd conin2: move.b sdata,d1 * send the data andi.b #$7f,d1 * strip msb move.b (sp)+,d0 * retreive rts * check console status-- return with * 0 in d1 if no character ready else * return with the character constat: move.b d0,-(sp) move.b #0,sselect move.b sstatus,d0 andi.b #sr1,d0 * check uart rda flag bne conin2 * go get it if char rcd move.b #0,d1 * else return 0 in d1 move.b (sp)+,d0 * retreive rts * routine sends serial output via direct I/O * to the SIO4 board print character in d1 * d0 preserved. conout: move.b #0,sselect * write select port move.b d0,-(sp) conout1: move.b sstatus,d0 andi.b #1,d0 * check uart tbe flag beq conout1 * loop till empty move.b d1,sdata * send the data move.b (sp)+,d0 * restore rts * S P E C I A L * Print string routine requires no RAM. * Routine sends serial output string (pointed to by a0) * via direct I/O to the SIO4 board port A. * Return is through a6 to elimnate need for ram string: move.b #0,d2 move.b d2,sselect * write select port string1: move.b sstatus,d0 andi.b #1,d0 * check uart tbe flag beq string1 * loop till empty move.b (a1)+,d1 cmpi.b #'$',d1 * check for end of string beq strnglv move.b d1,sdata * send the data bra string1 strnglv: jmp (a6) signon: .dc.b acs,acr,alf,alf,alf,alf,alf,alf,alf,alf,alf,alf,alf,alf .dc.b alf,alf,alf,alf,alf,alf,alf,alf,alf,alf,alf,alf .dc.b 'Welcome to Morrow Designs Trinity system (Prom Version 1.0).' .dc.b alf,acr .dc.b 'Running UNIX (tm) System V with UNISOFT enhancements.' .dc.b alf, alf, alf, acr .dc.b 'Testing memory, please stand by... $' rerr1: .dc.b alf, alf, alf, acr .dc.b 'No memory in system or incorrectly addressed!!' .dc.b alf,acr,abel .dc.b 'Please refer to installation manual for further instructions!$' rerr2: .dc.b alf, alf, alf, acr .dc.b 'Insufficient system RAM available!!' .dc.b alf,acr .dc.b 'UNIPLUS+ System V requires a mimimum of 1/2 megabyte.' .dc.b alf,acr .dc.b 'Please refer to installation manual for further instructions!' .dc.b alf,acr,abel, '$' ramgood: .dc.b ' System Memory O.K.' .dc.b alf,alf,acr, '$' .end