changeset 1505:5d726c0e6238

shellplus back-ported to Level 1
author boisy
date Wed, 14 Jan 2004 02:44:52 +0000
parents d3a421a9f13f
children 9f3ff1c25f05
files level1/ChangeLog level1/cmds/makefile level1/cmds/shellplus.asm level1/modules/sysgo.asm
diffstat 4 files changed, 118 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/level1/ChangeLog	Tue Jan 13 21:56:38 2004 +0000
+++ b/level1/ChangeLog	Wed Jan 14 02:44:52 2004 +0000
@@ -1,4 +1,5 @@
 NitrOS-9/6809 Level 1 V03.02.01:
+- Shell+ has been backported and is now the default shell for Level 1.
 - vrn has been backported and the nil descriptor now requires vrn.
 - nildrv has been removed.
 - The F$PrsNam call has been fixed to allow 0-9 and _ as the first character
--- a/level1/cmds/makefile	Tue Jan 13 21:56:38 2004 +0000
+++ b/level1/cmds/makefile	Wed Jan 14 02:44:52 2004 +0000
@@ -5,16 +5,15 @@
 DEPENDS		= ./makefile
 
 BASIC09FILES	= runb.asm gfx.asm inkey.asm syscall.asm
-COCOCMDS	= asm attr backup binex build cmp cobbler config copy cputype \
+CMDS		= asm attr backup binex build cmp cobbler config copy cputype \
 		date dcheck debug ded deiniz del deldir devs dir disasm \
 		display dmode dsave dump echo edit error exbin exmode format \
 		free grfo help ident iniz irqs link list load login makdir \
 		mdir merge mfree os9gen padrom park prompt printerr procs pwd pxd \
-		rename runb save setime shell sleep tee tmode touch tsmon \
-		tuneport unlink verify xmode
+		rename runb save setime shell_21 shellplus sleep \
+		tee tmode touch tsmon tuneport unlink verify xmode
 SUBS		= gfx inkey syscall
-DRAGONCMDS	= cobbler_d64 format_d64 os9gen_d64 go51
-ALLOBJS		= $(COCOCMDS) $(DRAGONCMDS) $(SUBS)
+ALLOBJS		= $(CMDS) $(DRAGONCMDS) $(SUBS)
 
 all:	$(ALLOBJS)
 
@@ -24,6 +23,9 @@
 pxd:	pd.asm
 	$(AS) $(AFLAGS) $< $(ASOUT)$@ -aPXD=1
 
+shell:	shellplus.asm
+	$(AS) $(AFLAGS) $< $(ASOUT)$@
+
 clean:
 	$(RM) $(ALLOBJS)
 
@@ -34,7 +36,7 @@
 	@$(ECHO) $(ALLOBJS)
 
 showcocoobjs:
-	@$(ECHO) $(COCOCMDS) $(SUBS)
+	@$(ECHO) $(CMDS) $(SUBS)
 
 showdragonobjs:
 	@$(ECHO) $(CMDS) $(DRAGONCMDS)
--- a/level1/cmds/shellplus.asm	Tue Jan 13 21:56:38 2004 +0000
+++ b/level1/cmds/shellplus.asm	Wed Jan 14 02:44:52 2004 +0000
@@ -1,5 +1,5 @@
 ********************************************************************
-* Shellplus - Enhanced shell for OS-9 Level Two
+* Shellplus - Enhanced shell for NitrOS-9
 *
 * Modified by L. Curtis Boyle from original 2.2 disassembly
 *
@@ -15,7 +15,7 @@
 * History and numerous features added.
 
          nam   Shell
-         ttl   program module       
+         ttl   Enhanced shell for NitrOS-9
 
 * Disassembled 93/04/15 14:58:18 by Disasm v1.6 (C) 1988 by RML
 * Signals: Signals 2 & 3 are assigned new keys to handle forward/backward
@@ -497,12 +497,18 @@
          clr   <u0019
          tst   <u0013         Do we want to kill the parent process?
          beq   L02FC
+         IFEQ  Level-1
+         ldx   <D.Proc
+         ELSE
          os9   F$ID           Get our process ID # into A
          pshs  x              Preserve X
          leax  >u166D,u       Point to process descriptor buffer
          os9   F$GPrDsc       Get our process descriptor
+         ENDC
          lda   P$PID,x        Get our parents process #
+         IFGT  Level-1
          puls  x              Restore X
+         ENDC
          beq   L02A3          If parent's process # is 0 (system), skip back
          clrb                 S$Kill signal code
          os9   F$Send         Send it to parent
@@ -1211,8 +1217,10 @@
 L07F5    lda   ,x
          cmpa  #'*
          beq   L0832
+         IFGT  Level-1
          ldy   #$0000         Force temporarily to super-user
          os9   F$SUser
+         ENDC
          leax  >u0CBD,u
          ldd   #$0203
          lbsr  L0C79
@@ -1230,8 +1238,11 @@
          os9   I$WritLn 
 L082D    lda   <u0012
          os9   I$Close  
-L0832    ldy   <u005A         Get original user # back
+L0832   
+         IFGT  Level-1 
+         ldy   <u005A         Get original user # back
          os9   F$SUser        Change user # to original
+         ENDC
          puls  pc,x
 
 * Parse input line
@@ -1407,7 +1418,11 @@
          leax  L000D,pc       Point to 'shell' (module name)
          leau  L0961,pc       Point to 'startup' (parameter for 'shell')
          ldy   #$0008         Size of 'startup<CR>'
+         IFGT  Level-1
          ldd   #$111F         Program+Objct / 7.5K data area
+         ELSE
+         ldd   #$1102         Program+Objct / 512 byte data area
+         ENDC
          os9   F$Fork         Fork a shell to run the startup file
          bcs   L0983          Couldn't fork, exit
          os9   F$Wait         Wait until 'startup' is done
@@ -2496,9 +2511,11 @@
          ldx   #$000A         Signal $A is the one to send
          os9   I$SetStt 
          lbcs  L0191          Error, use main shell error handler
+         IFGT  Level-1
          ldb   #SS.MsSig      Send signal on mouse button press
          os9   I$SetStt 
          lbcs  L0191
+         ENDC
          ldx   #$0000         Go to sleep until one of the 2 is received
          os9   F$Sleep  
          ldb   #SS.Relea      Signal gotten, release all signals
@@ -2708,7 +2725,7 @@
 errexit  coma                 Yes, set carry & exit
 L1308    puls  pc,a
 
-* If data area <4.25K, force up to 7.5K
+* Level 2: If data area <4.25K, force up to 7.5K
 * Exit: A=Type/language
 *       X=Current source line parsing ptr (module name to chain)
 *       Y=Size of parameter area
@@ -2716,10 +2733,12 @@
 *       B=Size of data area
 L130A    lda   #Prgrm+Objct   Module type/language
          ldb   <u0003         Get # pages of data mem needed for forked module
+         IFGT  Level-1
          cmpb  #$11           Is it at least 17?
          bhs   L1316          Yes, skip ahead
          ldb   #$1F           Otherwise, force to 7.5K minimum
          stb   <u0003         Save it
+         ENDC
 L1316    andcc #^Carry        Clear carry
          ldx   <u0004         Get mem module ptr
          ldy   <u0006         Get size of current command group
@@ -2818,10 +2837,22 @@
          lbcs  L162B
          lbra  L14AF
 L13EF    leax  >u00E3,u
-         os9   F$NMLink 
+         IFGT  Level-1
+         os9   F$NMLink
+         ELSE
+         pshs  u
+         os9   F$Link
+         puls  u
+         ENDC
          bcc   L1400
          ldx   <u0004
-         os9   F$NMLoad 
+         IFGT  Level-1
+         os9   F$NMLoad
+         ELSE
+         pshs  u
+         os9   F$Load
+         puls  u
+         ENDC
          bcc   L1400
          rts   
 L1400    leax  >u00E3,u
@@ -2848,7 +2879,15 @@
          puls  u              Restore U
          lbcs  L162B          If we couldn't link, Exit with error
          ldx   <u0004         Get ptr to module name again
+         IFGT  Level-1
          os9   F$UnLoad       Unlink it
+         ELSE
+         pshs  a,b,x,y,u
+         os9   F$Link
+         os9   F$Unlink
+         os9   F$Unlink
+         puls  a,b,x,y,u
+         ENDC
          lbcs  L162B          If we couldn't unlink exit with error
          ldx   <u0008         Get ptr to current group (param ptr for shellsub)
          ldd   <u0006         Get size of param area for shellsub
@@ -2859,7 +2898,15 @@
          clrb  
          std   <u0010         ? (originally pointing to E3 if type $11 module)
          ldx   <u0004         Get shellsub module ptr
+         IFGT  Level-1
          os9   F$UnLoad       Unlink it
+         ELSE
+         pshs  a,b,x,y,u
+         os9   F$Link
+         os9   F$Unlink
+         os9   F$Unlink
+         puls  a,b,x,y,u
+         ENDC
          std   <u0004         Clear shellsub module ptr
          inc   <u005D         Set flag that we should wait for module to exit?
          puls  pc,u,y,x,d,cc  restore regs & return
@@ -2878,12 +2925,26 @@
          lbra  L162B
 
 L1473    clra                 Wildcard NMLink
+         IFGT  Level-1
          os9   F$NMLink       Link to module
+         ELSE
+         pshs  u
+         os9   F$Link         Link to module
+         puls  u
+         ENDC
          lbcs  L1329          Error, do something
          cmpa  #ShellSub+Objct  ShellSub module?
          beq   L1427          Yes, go set up for it
          ldx   <u0004         Get ptr to name back
+         IFGT  Level-1
          os9   F$UnLoad       Drop the link count back down
+         ELSE
+         pshs  a,b,x,y,u
+         os9   F$Link
+         os9   F$Unlink
+         os9   F$Unlink
+         puls  a,b,x,y,u
+         ENDC
          pshs  y              Save data area size
          ldx   <u0004         Get ptr to module name again
          leay  >L000D,pc      Point to 'Shell'
@@ -3046,11 +3107,29 @@
 L15D5    stx   <u0004         Save ptr to module name to fork
 L15D7    ldx   <u0004         Get ptr to module name to fork
          lda   #Prgrm+Objct
+         IFGT  Level-1
          os9   F$NMLink       Get memory requirement stuff from it
+         ELSE
+         pshs  u
+         os9   F$Link         Get memory requirement stuff from it
+         tfr   u,y
+         puls  u
+         ENDC
          bcc   L15E5          Got it, continue
+         IFGT  Level-1
          os9   F$NMLoad       Couldn't get, try loading it
+         ELSE
+         pshs  u
+         os9   F$Load         Couldn't get, try loading it
+         tfr   u,y
+         puls  u
+         ENDC
          bcs   L162B          Still couldn't get, can't fork
-L15E5    tst   <u0003         Memory size specified?
+L15E5    
+         IFEQ  Level-1
+         ldy   M$Mem,y
+         ENDC
+         tst   <u0003         Memory size specified?
          bne   L15F2          Yes, skip ahead
          tfr   y,d            No, tfr modules mem size to D
          addd  <u000A         ??? Add to something
@@ -3059,9 +3138,13 @@
 L15F2    clr  ,-s             Clear byte on stack to store original priority
          ldb   <u0022         Get priority we want to set new program at
          beq   DnePrior       0=Use inherited priority, skip ahead
+         IFEQ  Level-1
+         ldx   <D.Proc
+         ELSE
          leax  >u166D,u       Point to place to hold Process descriptor
          os9   F$ID           Get our process #
          os9   F$GPrDsc       Get our process descriptor
+         ENDC
          ldb   P$Prior,x      Get our priority
          stb   ,s             Save it
          ldb   <u0022         Get priority for new process
@@ -3077,7 +3160,16 @@
          ldx   <u0010         Get ptr to some other module name (?)
          bne   L1611          There is one, unlink it instead
          ldx   <u0004         Get ptr to command name
-L1611    os9   F$UnLoad       Bump link count down back to normal?
+L1611    
+         IFGT  Level-1
+         os9   F$UnLoad       Bump link count down back to normal?
+         ELSE
+         pshs  a,b,x,y,u
+         os9   F$Link
+         os9   F$Unlink
+         os9   F$Unlink
+         puls  a,b,x,y,u
+         ENDC
          clra  
          clrb  
          std   <u0010         Zero out other module name ptr
@@ -3087,7 +3179,15 @@
          bne   L1627          No, skip ahead
          lda   #Data          Data module
          ldx   <u0061         Get ptr to name of data module
+         IFGT  Level-1
          os9   F$UnLoad       Bump link count down back to normal
+         ELSE
+         pshs  a,b,x,y,u
+         os9   F$Link
+         os9   F$Unlink
+         os9   F$Unlink
+         puls  a,b,x,y,u
+         ENDC
 L1627    puls  cc,d           Get back F$FORK error/process #
          leas  1,s            Eat priority byte
          puls  pc,u,y,x       Restore regs & return
--- a/level1/modules/sysgo.asm	Tue Jan 13 21:56:38 2004 +0000
+++ b/level1/modules/sysgo.asm	Wed Jan 14 02:44:52 2004 +0000
@@ -75,7 +75,7 @@
          fcb   C$CR,C$LF
 * For ROM version, cut down on verbage
          IFEQ  ROM
-         fcc   "Release Date: Ill 00, 2004"
+         fcc   "Release Date: Feb 01, 2004"
          fcb   C$CR,C$LF
          fcc   !http://www.nitros9.org!
          fcb   C$CR,C$LF