Changes for gsh version 2.0d9:

Added additional optional debug code. A version of gsh with the memory
checking debug code turned on is available as an exe file.

Lock and unlock the hash mutual exclusion key in when disposing of the
hash table.

Allow five digits rather than four when printing the process number in
the ps command.

Piping the output of a command into a non-executable file no longer
causes gsh to hang.
This commit is contained in:
tribby 1999-01-14 17:44:25 +00:00
parent d4ee658beb
commit e586eeefeb
10 changed files with 98 additions and 50 deletions

View File

@ -1,6 +1,25 @@
GSH 2.0 UPDATES
^^^^^^^^^^^^^^^
Jan 12 99 [dmt] Add debug routine DB~CHKBNK, which causes BRK B0 if
program bank is not the same as data bank (mmdebug.asm).
Modify lock and unlock macros to call DB~CHKBNK (gsh.mac).
Needed to change branch instructions to jump macros in several
files because the code got larger.
Jan 11 99 [dmt] Lock/unlock hashmutex in dispose_hash (hash.asm).
Jan 3 99 [dmt] Allow five digits rather than four when printing process
id number in the ps command (builtin.asm).
Jan 1 99 [dmt] Piping the output of a command to a non-executable
file caused gsh to hang. Instead of going directly to done
after printing "Not executable" error message, go to chkpipe
in invoke.asm.
Dec 31 98 [dmt] Changes to this point checked-in to master archive.
Released as version 2.0d8
Dec 30 98 [dmt] Added mutual exclusion to ~NEW and ~DISPOSE macros. Lack
of mutex could cause one fork to modify a memory table while
another fork was searching it, leaving one or both processes

View File

@ -6,7 +6,7 @@
* Jawaid Bazyar
* Tim Meekins
*
* $Id: builtin.asm,v 1.9 1998/12/31 18:29:11 tribby Exp $
* $Id: builtin.asm,v 1.10 1999/01/14 17:44:22 tribby Exp $
*
**************************************************************************
*
@ -1544,7 +1544,7 @@ loop kvmnextproc ps
ldy #2
lda [ps],y ;ps->pid
Int2Dec (@a,#pidstr,#4,#0)
Int2Dec (@a,#pidstr,#5,#0)
ldx #^pidstr
lda #pidstr
jsr puts
@ -1714,8 +1714,8 @@ return return 2:status
usage dc c'Usage: ps',h'0d00'
kvmerrstr dc c'ps: error in kvm_open()',h'0d00'
header dc c' ID STATE TT MMID UID TIME COMMAND',h'0d00'
pidstr dc c'0000 ',h'00'
header dc c' ID STATE TT MMID UID TIME COMMAND',h'0d00'
pidstr dc c'00000 ',h'00'
userstr dc c' 0000 ',h'00'
puidstr dc c'0000 ',h'00'
timestr dc c'000:00 ',h'00'

View File

@ -6,7 +6,7 @@
* Jawaid Bazyar
* Tim Meekins
*
* $Id: cmd.asm,v 1.9 1998/12/31 18:29:12 tribby Exp $
* $Id: cmd.asm,v 1.10 1999/01/14 17:44:22 tribby Exp $
*
**************************************************************************
*
@ -128,7 +128,8 @@ SINGQUOTE equ 4 ;single quote string
;
loop lda [buf]
incad buf
and2 @a,#$FF,ch ch = next character.
and #$00FF
sta ch ch = next character.
bne switch
; End of string detected. Action depends upon current state.

View File

@ -6,7 +6,7 @@
* Jawaid Bazyar
* Tim Meekins
*
* $Id: edit.asm,v 1.10 1998/12/31 18:29:12 tribby Exp $
* $Id: edit.asm,v 1.11 1999/01/14 17:44:24 tribby Exp $
*
**************************************************************************
*
@ -1290,7 +1290,7 @@ filematch anop
cmp #6 == $00000006?
bne filematch
lda nwAux+2
bne filematch No; try next wildcard.
jne filematch No; try next wildcard.
bra notdir It's shell cmd file.
;
; Not looking for a command
@ -1359,7 +1359,7 @@ q equ 4 locations.
jeq endhash
ldy #0
ldx t_size
eq_endhash beq endhash
eq_endhash jeq endhash
;
; loop through every hashed file and add it the string vector
;

View File

@ -1928,13 +1928,10 @@ skip&syscnt anop
MACRO
&lab ~NEW
&lab anop
* -- Portion needed for debug version
* jsl DB~NEW
*
* -- Rest is for non-debug version
using memglobal
lock memmutex
jsl ~NEW
* jsl DB~NEW ; DEBUG VERSION
jsl ~NEW ; NON-DEBUG VERSION
unlock memmutex
MEND
@ -1945,13 +1942,10 @@ skip&syscnt anop
MACRO
&lab ~DISPOSE
&lab anop
* -- Portion needed for debug version
* jsl DB~DISPOSE
*
* -- Rest is for non-debug version
using memglobal
lock memmutex
jsl ~DISPOSE
* jsl DB~DISPOSE ; DEBUG VERSION
jsl ~DISPOSE ; NON-DEBUG VERSION
unlock memmutex
MEND
@ -1971,9 +1965,11 @@ skip&syscnt anop
* lock
********************
MACRO
&lab lock &a1
&lab lda #1
tsb &a1
&lab lock &key
&lab anop
* jsr DB~CHKBNK ; TEMPORARY DEBUG CODE
lda #1
tsb &key
beq *+6
cop $7F
bra *-7
@ -1983,6 +1979,8 @@ skip&syscnt anop
* unlock
********************
MACRO
&lab unlock &a1
&lab stz &a1
&lab unlock &key
&lab anop
* jsr DB~CHKBNK ; TEMPORARY DEBUG CODE
stz &key
MEND

View File

@ -1,7 +1,7 @@
/*
* Resources for version and comment
*
* $Id: gsh.rez,v 1.10 1998/12/31 18:29:13 tribby Exp $
* $Id: gsh.rez,v 1.11 1999/01/14 17:44:24 tribby Exp $
*/
#define PROG "gsh"
@ -16,7 +16,7 @@
resource rVersion (1, purgeable3) {
{ 2, 0, 0, /* Version 2.0.0 */
development, /* development|alpha|beta|final|release */
8 }, /* non-final release number */
9 }, /* non-final release number */
verUS, /* Country */
PROG, /* Program name */
DESC

View File

@ -6,7 +6,7 @@
* Jawaid Bazyar
* Tim Meekins
*
* $Id: hash.asm,v 1.8 1998/12/31 18:29:13 tribby Exp $
* $Id: hash.asm,v 1.9 1999/01/14 17:44:24 tribby Exp $
*
**************************************************************************
*
@ -644,7 +644,7 @@ loop lda entry If number of processed entries
; Check for filetype $B0, subtype $0006: Shell command file (EXEC)
cmp #$B0
bne nextfile
jne nextfile
lda DRecAuxType
cmp #$06
bne nextfile
@ -1146,6 +1146,7 @@ dispose_hash START
using hashdata
lock hashmutex
ora2 hash_table,hash_table+2,@a
beq done
@ -1178,7 +1179,8 @@ next1 ply Restore path index
stz hash_table
stz hash_table+2
done rts
done unlock hashmutex
rts
END

View File

@ -6,7 +6,7 @@
* Jawaid Bazyar
* Tim Meekins
*
* $Id: invoke.asm,v 1.10 1998/12/31 18:29:13 tribby Exp $
* $Id: invoke.asm,v 1.11 1999/01/14 17:44:25 tribby Exp $
*
**************************************************************************
*
@ -327,10 +327,10 @@ badfile ldx cpath+2
ldx #^err1 Print error message:
lda #err1 'Not executable.'
jsr errputs
free pei (ptr+2) Free memory used to hold
pei (ptr+2) Free memory used to hold
pei (ptr) GS/OS string with path.
jsl nullfree
jmp done
jmp chkpipe If pipe was allocated, clean up.
*
* ---------------------------------------------------------------
@ -477,7 +477,11 @@ doShell anop
case off
jsr postfork
jmp free
pei (ptr+2) Free memory used to hold
pei (ptr) GS/OS string with path.
jsl nullfree
jmp done
;
; Forked shell starts here...

View File

@ -6,7 +6,7 @@
* Jawaid Bazyar
* Tim Meekins
*
* $Id: main.asm,v 1.7 1998/09/08 16:53:11 tribby Exp $
* $Id: main.asm,v 1.8 1999/01/14 17:44:25 tribby Exp $
*
**************************************************************************
*
@ -82,7 +82,7 @@ ok stz FastFlag
; Parse gsh's command-line arguments.
argloop dec argc Decrement argument count.
beq go_start If none left, ready to start working.
jeq go_start If none left, ready to start working.
clc
lda argv Point to next
adc #4 argument pointer.

View File

@ -6,7 +6,7 @@
* Jawaid Bazyar
* Tim Meekins
*
* $Id: mmdebug.asm,v 1.5 1998/12/21 23:57:07 tribby Exp $
* $Id: mmdebug.asm,v 1.6 1999/01/14 17:44:25 tribby Exp $
*
**************************************************************************
*
@ -78,20 +78,20 @@ deref lda [hand] Dereference the handle.
lda [hand],y
sta ptr+2
;
; Fill memory with recognizable pattern
;
lda #"~~"
ldy size
dec_index dey
dey
bmi full
sta [ptr],y
bra dec_index
full short a In case size was odd,
sta [ptr] be sure the first byte
long a gets the pattern.
*;
*; Fill memory with recognizable pattern
*;
* lda #"~~"
* ldy size
*dec_index dey
* dey
* bmi full
* sta [ptr],y
* bra dec_index
*
*full short a In case size was odd,
* sta [ptr] be sure the first byte
* long a gets the pattern.
goback return 4:ptr Return pointer to caller.
@ -156,3 +156,27 @@ okay DisposeHandle hand Deallocate the memory.
goback return
END
DB~CHKBNK START
; Verify that data bank = program bank
; Call with jsr DB~CHKBNK
php Save Status Flags.
short m Go to 8-bit mode.
pha Save Accumulator.
phk Put Program Bank reg on stack.
phb Copy Data Bank register
pla into Accumulator.
cmp 1,s Compare DBR (in acc) to PBR (stack)
beq cleanup If not equal,
brk $B0 complain.
;
; Ready to return to the caller
;
cleanup pla Remove Program Bank reg from stack.
pla Restore original Accumulator and
plp Status Flags (including 8/16 bit mode)
rts
END