Mercurial > hg > Members > kono > os9 > sbc09
changeset 35:01519215ec70
add watch point
0xfe00 fixed ram area in MMU
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 15 Jul 2018 20:29:55 +0900 |
parents | 2032755628dc |
children | cc8c2c2464fe |
files | a09.c d09.c io.c os9/level1/boot.asm os9/level1/sysgo.asm os9/level2/boot.asm os9/level2/vector.asm trace.c |
diffstat | 8 files changed, 437 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/a09.c Sun Jul 15 14:18:19 2018 +0900 +++ b/a09.c Sun Jul 15 20:29:55 2018 +0900 @@ -1290,7 +1290,7 @@ setlabel(lp); skipspace(); int sep = *srcptr; - if(sep=='\"' || sep=='/') { + if(sep=='\"' || sep=='/' || sep=='\'') { srcptr++; while(*srcptr!=sep&&*srcptr) putbyte(*srcptr++);
--- a/d09.c Sun Jul 15 14:18:19 2018 +0900 +++ b/d09.c Sun Jul 15 20:29:55 2018 +0900 @@ -1365,6 +1365,7 @@ fprintf(fp,"%0.2X %0.2X %0.2X %s%s [%s$%0.2X,%s]", code, postbyte, prog[pc+2], suffix, op->name, s, offset, IndexRegister(postbyte)); + extrabytes = 1; break; case 0x19 : offset = prog[pc+2] * 256 + prog[pc+3]; @@ -1377,6 +1378,7 @@ fprintf(fp,"%0.2X %0.2X %0.2X %0.2X %s%s %s$%0.4X,%s", code, postbyte, prog[pc+2], prog[pc+3], suffix, op->name, s, offset, IndexRegister(postbyte)); + extrabytes = 2; break; case 0x1a : break;
--- a/io.c Sun Jul 15 14:18:19 2018 +0900 +++ b/io.c Sun Jul 15 20:29:55 2018 +0900 @@ -270,6 +270,10 @@ do_timer(a,c); } else if (a >= 0x10+(IOPAGE&0x1ff)) { /* mmu */ do_mmu(a,c); +#ifdef USE_MMU + } else { /* fixed ram */ + mem[ a + 0xfe00 ] = c; +#endif } }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os9/level1/boot.asm Sun Jul 15 20:29:55 2018 +0900 @@ -0,0 +1,58 @@ +******************************************************************** +* Boot - V09 Boot module +* +* $Id: boot_1773.asm,v 1.1.1.1 2001/02/21 23:30:54 boisy Exp $ +* +* Ed. Comments Who YY/MM/DD +* ------------------------------------------------------------------ + + nam Boot + ttl v09 Boot module + + ifp1 + use defsfile + use coco.d + endc + +* +* map extended rom on page 0x40- +* first two bytes are extra rom module size + +tylg set Systm+Objct +atrv set ReEnt+rev +rev set $01 +edition set 1 + + mod eom,name,tylg,atrv,start,size + +size equ . + +name fcs /Boot/ + fcb edition + +start + ldx #Bt.Start+Bt.Size-1 + ldy #$ff00 + pshs x,y,u +loop ldb #$87 + cmpb ,x + bne notfound + os9 F$VModul + bcs notfound + ldx ,s + ldu ,u + ldd 2,u size of mulde + leax d,x + bra loop +notfound + leax 1,x + stx ,s + cmpx 2,s + blo loop +last clra + clrb + puls x,y,u,pc + + emod +eom equ * + end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os9/level1/sysgo.asm Sun Jul 15 20:29:55 2018 +0900 @@ -0,0 +1,323 @@ +******************************************************************** +* SysGo - Kickstart program module +* +* $Id$ +* +* Edt/Rev YYYY/MM/DD Modified by +* Comment +* ------------------------------------------------------------------ +* 5 1998/10/12 Boisy G. Pitre +* Taken from OS-9 L2 Tandy distribution and modified banner for V3. +* +* 5r2 2003/01/08 Boisy G. Pitre +* Fixed fork behavior so that if 'shell startup' fails, system doesn't +* jmp to Crash, but tries AutoEx instead. Also changed /DD back to /H0 +* for certain boot floppy cases. +* +* 2003/09/04 Boisy G. Pitre +* Back-ported to OS-9 Level One. +* +* 5r3 2003/12/14 Boisy G. Pitre +* Added SHIFT key check to prevent startup/autoex from starting if +* held down. Gene Heskett, this Bud's for you. + + nam SysGo + ttl Kickstart program module + + IFP1 + use defsfile + ENDC + +tylg set Prgrm+Objct +atrv set ReEnt+rev +rev set $03 +edition set $05 + + mod eom,name,tylg,atrv,start,size + + + org 0 +InitAddr rmb 2 + rmb 250 +size equ . + +name fcs /SysGo/ + fcb edition + +* Default process priority +DefPrior set 128 + +Banner equ * + fcc /(C) 2014 The NitrOS-9 Project/ +CrRtn fcb C$CR,C$LF + + IFEQ ROM + IFNE NOS9DBG + fcc "** DEVELOPMENT BUILD **" + fcb C$CR,C$LF + fcc "** NOT FOR DISTRIBUTION! **" + fcb C$CR,C$LF + ENDC +* dts + fcb C$CR,C$LF + fcc !http://www.nitros9.org! + fcb C$CR,C$LF + ENDC + + fcb C$LF +BannLen equ *-Banner + + IFEQ ROM +DefDev equ * + fcc "/D0" +* IFNE DD +* fcc "/DD" +* ELSE +* fcc "/H0" +* ENDC + fcb C$CR +HDDev equ * + fcc "/DD" +* IFNE DD +* fcc "/DD/" +* ELSE +* fcc "/H0/" +* ENDC +ExecDir fcc "/D0/CMDS" + fcb C$CR + ENDC + +Shell fcc "Shell" + fcb C$CR +AutoEx fcc "AutoEx" + fcb C$CR +AutoExPr fcc "" + fcb C$CR +AutoExPrL equ *-AutoExPr + + IFEQ ROM +Startup fcc "startup -p" + fcb C$CR +StartupL equ *-Startup + ENDC + +ShellPrm equ * + IFGT Level-1 + fcc "i=/1" + ENDC +CRtn fcb C$CR +ShellPL equ *-ShellPrm + +mdirprm fcc "-e" + fcb C$CR + +* Default time packet +DefTime +* dtb + + IFEQ atari+corsham + IFEQ Level-1 +* BASIC reset code (CoCo port only) +* BasicRst fcb $55 +* neg <$0074 +* nop +* clr >PIA0Base+3 +* nop +* nop +* sta >$FFDF turn off ROM mode +* jmp >Bt.Start+2 jump to boot +* BasicRL equ *-BasicRst + ENDC + ENDC + +Init fcs /Init/ + +* Entry: X = pointer to start of nul terminated string +* Exit: D = length of string +strlen pshs x + ldd #-1 +go@ addd #$0001 + tst ,x+ + bne go@ + puls x,pc + +* Display carriage-return/line-feed. +WriteCR pshs y + leax CrRtn,pcr + ldy #$0001 + os9 I$WritLn + puls y,pc + +********************************************************** +* SysGo Entry Point +********************************************************** +start leax >IcptRtn,pcr + os9 F$Icpt +* Set priority of this process + os9 F$ID + ldb #DefPrior + os9 F$SPrior + +* Write OS name and Machine name strings + leax Init,pcr + clra + pshs u + os9 F$Link + bcs SignOn + stx <InitAddr + ldd OSName,u point to OS name in INIT module + leax d,u point to install name in INIT module + bsr strlen + tfr d,y + lda #$01 + os9 I$Write + bsr WriteCR + ldd InstallName,u + leax d,u point to install name in INIT module + bsr strlen + tfr d,y + lda #$01 + os9 I$Write + bsr WriteCR + +* Show rest of banner +SignOn + puls u + leax >Banner,pcr + ldy #BannLen + lda #$01 standard output + os9 I$Write write out banner + +* Set default time +* leax >DefTime,pcr +* os9 F$STime set time to default + + IFEQ ROM +* Change EXEC and DATA dirs + leax >ExecDir,pcr + lda #EXEC. + os9 I$ChgDir change exec. dir + leax >DefDev,pcr +* Made READ. so that no write occurs at boot (Boisy on Feb 5, 2012) + lda #READ. + os9 I$ChgDir change data dir. + bcs L0125 + leax >HDDev,pcr + lda #EXEC. + os9 I$ChgDir change exec. dir to HD + ENDC + +L0125 equ * + pshs u,y + IFEQ atari+corsham + IFEQ Level-1 +* Setup BASIC code (CoCo port only) +* leax >BasicRst,pcr +* ldu #D.CBStrt +* ldb #BasicRL +*CopyLoop lda ,x+ +* sta ,u+ +* decb +* bne CopyLoop + ELSE + os9 F$ID get process ID + lbcs L01A9 fail + leax ,u + os9 F$GPrDsc get process descriptor copy + lbcs L01A9 fail + leay ,u + ldx #$0000 + ldb #$01 + os9 F$MapBlk + bcs L01A9 + +* lda #$55 set flag for Color BASIC +* sta <D.CBStrt,u +* Copy our default I/O ptrs to the system process + ldd <D.SysPrc,u + leau d,u + leau <P$DIO,u + leay <P$DIO,y + ldb #DefIOSiz-1 +L0151 lda b,y + sta b,u + decb + bpl L0151 + ENDC + ENDC +* +* IFEQ ROM +* Fork shell startup here +* IFEQ atari+corsham +* Added 12/14/03: If SHIFT is held down, startup is not run (CoCo only) +* lda #$01 standard output +* ldb #SS.KySns +* os9 I$GetStt +* bcs DoStartup +* bita #SHIFTBIT SHIFT key down? +* bne L0186 Yes, don't to startup or autoex +* ENDC + +*DoStartup leax >Shell,pcr +* leau >Startup,pcr +* ldd #256 +* ldy #StartupL +* os9 F$Fork +* bcs DoAuto Startup failed.. +* os9 F$Wait +* ENDC + +* Fork AutoEx here +*DoAuto leax >AutoEx,pcr +* leau >CRtn,pcr +* ldd #$0100 +* ldy #$0001 +* os9 F$Fork +* bcs L0186 AutoEx failed.. +* os9 F$Wait + + leax >MDIR,pcr + leau >mdirprm,pcr + ldd #$0100 + ldy #$0003 + os9 F$Fork + bcs L0186 AutoEx failed.. + os9 F$Wait + bra L0186 +MDIR fcs "mdir" + fcb $0d + +L0186 equ * + puls u,y +FrkShell leax >ShellPrm,pcr + leay ,u + ldb #ShellPL +L0190 lda ,x+ + sta ,y+ + decb + bne L0190 +* Fork final shell here + leax >Shell,pcr + lda #$01 D = 256 (B already 0 from above) + ldy #ShellPL + IFGT Level-1 + os9 F$Chain Level 2/3. Should not return.. + ldb #$06 it did! Fatal. Load error code + bra Crash + +L01A9 ldb #$04 error code +Crash clr >DPort+$08 turn off disk motor + jmp <D.Crash fatal error + ELSE + os9 F$Fork Level 1. + bcs DeadEnd Fatal. + os9 F$Wait + bcc FrkShell OK, go start shell. +DeadEnd bra DeadEnd + ENDC + +IcptRtn rti + + emod +eom equ * + end
--- a/os9/level2/boot.asm Sun Jul 15 14:18:19 2018 +0900 +++ b/os9/level2/boot.asm Sun Jul 15 20:29:55 2018 +0900 @@ -54,23 +54,26 @@ ** u points the memory stu 2,s return as x ldd ,s + std 6,s ldx #0 ** copy to Bt BtRAM -pagel tfr d,y +pagel ldd #$2000 + cmpd 6,s + blo lo + ldd 6,s +lo tfr d,y lda 5,s sta $ffa0 tfr y,d loop ldy ,x++ sty ,u++ - subb #2 - sbca #0 - cmpb #0 $100 transfered? - bne loop - bita #$1f - bne loop - tsta - beq last all transfered + subd #2 + bne loop clr $ffa0 back to system map + ldd 6,s + subd #$2000 + bmi last all transfered + std 6,s ** 2k boundary inc 5,s ldx #0
--- a/os9/level2/vector.asm Sun Jul 15 14:18:19 2018 +0900 +++ b/os9/level2/vector.asm Sun Jul 15 20:29:55 2018 +0900 @@ -8,6 +8,10 @@ sta $10,x set 0 page lda #$3f sta $17,x set IO/os9p1 page + ldd #$b7ff Bt.Bug hook + std <$5E sta $ff81 + ldd #$8139 rts + std <$5E+2 jmp [<vector,pcr] org $fff0
--- a/trace.c Sun Jul 15 14:18:19 2018 +0900 +++ b/trace.c Sun Jul 15 20:29:55 2018 +0900 @@ -58,6 +58,7 @@ int address; // physical address int laddr; int count; + int watch; // watch point struct bp *next; } BP, *BPTR; @@ -67,7 +68,23 @@ int stkskip = 0; int getarg(char *buf, char** next) { - return strtol(buf,(char**)next,0); + int value = strtol(buf,next,0); + for(;next;) { + if ( **next == '+' ) { + value += strtol(*next+1,next,0); + } else if ( **next == '*' ) { + value *= strtol(*next+1,next,0); + } else if ( **next == '/' ) { + value /= strtol(*next+1,next,0); + } else if ( **next == '-' ) { + value -= strtol(*next+1,next,0); + } else if ( **next == '&' ) { + value &= strtol(*next+1,next,0); + } else if ( **next == '|' ) { + value |= strtol(*next+1,next,0); + } else break; + } + return value; } void printhelp(void) @@ -110,7 +127,13 @@ int ppc = paddr(pcreg,mmu); BPTR *prev = &breakpoint; for(BPTR b = breakpoint; b ; prev=&b->next, b=b->next ) { - if (ppc==b->address /* || pcreg==b->laddr */) { +#ifdef USE_MMU + int watch = phymem[b->address]; +#else + int watch = mem[b->address]; +#endif + if (ppc==b->address || b->watch != watch ) { + b->watch = watch; if (b->count==-1) { // temporaly break point BPTR next = b->next; free(b); @@ -138,6 +161,7 @@ do_trace(stdout); if (trskip>1) { // show trace and step trskip--; + int watch; // watch point set_term(escchar); return; } @@ -181,9 +205,9 @@ case 'B': // break point list for(BPTR bp = breakpoint; bp ; bp = bp->next) { #ifdef USE_MMU - printf("%x %x %d\n", bp->laddr, bp->address, bp->count); + printf("0x%x p=0x%x c=%d w=0x%x\n", bp->laddr, bp->address, bp->count, bp->watch); #else - printf("%x %d\n", bp->address, bp->count); + printf("0x%x c=%d w=0x%x\n", bp->address, bp->count,bp->watch); #endif } goto restart; @@ -360,6 +384,11 @@ bp->count = count; bp->laddr = adr; bp->address = paddr(adr,mmu); +#ifdef USE_MMU + bp->watch = *mem0(phymem,adr,mmu); +#else + bp->watch = mem[adr]; +#endif } int nexti(void) {