PropCMD -- like PropDOS but with less music and more SD
localroger
Posts: 3,452
Update -- PropCMD is now in the obex, with the aigeneric video drive commented IN by default and a couple of other minor changes.· /roger
This is my rewrite of PropDOS to make it a lot more DOS like. I removed the music functions because I don't have the hardware but it would be pretty easy to put them back in. I was more interested in a tool for exploring the SD, and in the future I plan to redo the FAT file systme so it can open more than one file at a time.
As I mentioned elsewhere this version uses TV_TEXT instead of the aigeneric 25-line video driver, so it only gets 13 lines of text on the screen. I see in that thread that aigeneric is going MIT, but I'm leaving it as is for now because it's also quite a bit smaller using the built in font. The code has detailed instructions for converting; I'm all ears as to which version should be posted to the obex.
If I may quote my own documentation...
If there is a file on the SD named AUTOEXEC.BAT, when PropCMD
starts it will open the file, read the name of a file, and
load and run that file as if it were the argument of a SPIN
command. Holding ESC down during boot inhibits this. Note
that this is the opposite of PropDOS' autostart feature.
Also note this is not a true batch interpreter, and no other
commands can be included in autoexec.bat (so far).
PropCMD checks for AUTOEXEC.BAT before deciding to halt if
there is no keyboard, so it can be used to autoload a SD
program which does not in turn need a keyboard.
PropCMD COMMANDS:
MOUNT
Mount the SD.
This is done automatically at startup if possible.
UNMOUNT
Unmount the SD.
The SD can then safely be changed.
DIR [noparse][[/noparse]*.ext] [noparse][[/noparse]/w] [noparse][[/noparse]/h] [noparse][[/noparse]/c] [noparse][[/noparse]|more]
Show the root directory of the SD.
*.ext -- show only files with the indicated extension
/w -- wide format
/h -- show hidden files (based on attribute bit)
/c -- show starting clusters
|more -- pause between screens, ESC to quit
ctrl-C cancels
TYPE filename [noparse][[/noparse]|more]
Echo the file to the console.
|more -- pause between screens, ESC to quit
ctrl-C cancels
DEL filename
Delete the file. Does not ask for confirmation.
COPY CON filename
Echo lines of user input to the file until CTRL-Z pressed.
ESC cancels the current input line without ending input.
SPIN filename
Load the binary file and reboot the Propeller to run it.
Forces .BIN extension whether it or any other is specified.
DUMP filename [noparse][[/noparse]|more]
Display the file contents in hex and ASCII format.
|more -- pause between screens, ESC to quit
ctrl-C cancels
SD sectornum [noparse][[/noparse]|more]
Sector Dump = display contents of the given SD sector
in the Dump command format.
ROOTDIR
Display the SD sector where the root directory begins
CLUST2SD clusternum
Display the SD sector where DOS cluster begins
VER
display the version
COLOR colornum
Sets the display text color 0-7.
NUM number
Display the hex and decimal equivalents of number.
If number has no prefix or $, it is hexadecimal
# prefix means decimal, e.g. B == $B == #11
This format is used for all numeric arguments.
DIRA pin [noparse][[/noparse]value]
If value is supplied, set the given pin DIRA to
the value; otherwise display the pin DIRA value.
OUTA pin [noparse][[/noparse]value]
If value is supplied, set the given pin OUTA to
the value; otherwise display the pin OUTA value.
PULSE pin time
Invert the given pin OUTA for the time in system
waitcnt ticks.
INA pin
Display the INA value for the pin.
PropCMD does not attempt to SPIN commands it does not
recognize; it will reply Unknown Command.
Note that while this code observes the directory Hidden
Attribute bit, there are no functions to manipulate it.
fsrw does not expose this functionality and I would
rather work on a totally new filesystem capable of
opening multiple files than further patching to fsrw.
Object "PropCMD" Interface:
PUB mainProgram
Program: 2,999 Longs
Variable: 758 Longs
Note -- I am a Prop n00b although I've been programming for many years, and I've probably missed a lot of tricks that could make the code tighter. I am open to all suggestions.
Post Edited (localroger) : 4/4/2009 1:05:32 AM GMT
This is my rewrite of PropDOS to make it a lot more DOS like. I removed the music functions because I don't have the hardware but it would be pretty easy to put them back in. I was more interested in a tool for exploring the SD, and in the future I plan to redo the FAT file systme so it can open more than one file at a time.
As I mentioned elsewhere this version uses TV_TEXT instead of the aigeneric 25-line video driver, so it only gets 13 lines of text on the screen. I see in that thread that aigeneric is going MIT, but I'm leaving it as is for now because it's also quite a bit smaller using the built in font. The code has detailed instructions for converting; I'm all ears as to which version should be posted to the obex.
If I may quote my own documentation...
If there is a file on the SD named AUTOEXEC.BAT, when PropCMD
starts it will open the file, read the name of a file, and
load and run that file as if it were the argument of a SPIN
command. Holding ESC down during boot inhibits this. Note
that this is the opposite of PropDOS' autostart feature.
Also note this is not a true batch interpreter, and no other
commands can be included in autoexec.bat (so far).
PropCMD checks for AUTOEXEC.BAT before deciding to halt if
there is no keyboard, so it can be used to autoload a SD
program which does not in turn need a keyboard.
PropCMD COMMANDS:
MOUNT
Mount the SD.
This is done automatically at startup if possible.
UNMOUNT
Unmount the SD.
The SD can then safely be changed.
DIR [noparse][[/noparse]*.ext] [noparse][[/noparse]/w] [noparse][[/noparse]/h] [noparse][[/noparse]/c] [noparse][[/noparse]|more]
Show the root directory of the SD.
*.ext -- show only files with the indicated extension
/w -- wide format
/h -- show hidden files (based on attribute bit)
/c -- show starting clusters
|more -- pause between screens, ESC to quit
ctrl-C cancels
TYPE filename [noparse][[/noparse]|more]
Echo the file to the console.
|more -- pause between screens, ESC to quit
ctrl-C cancels
DEL filename
Delete the file. Does not ask for confirmation.
COPY CON filename
Echo lines of user input to the file until CTRL-Z pressed.
ESC cancels the current input line without ending input.
SPIN filename
Load the binary file and reboot the Propeller to run it.
Forces .BIN extension whether it or any other is specified.
DUMP filename [noparse][[/noparse]|more]
Display the file contents in hex and ASCII format.
|more -- pause between screens, ESC to quit
ctrl-C cancels
SD sectornum [noparse][[/noparse]|more]
Sector Dump = display contents of the given SD sector
in the Dump command format.
ROOTDIR
Display the SD sector where the root directory begins
CLUST2SD clusternum
Display the SD sector where DOS cluster begins
VER
display the version
COLOR colornum
Sets the display text color 0-7.
NUM number
Display the hex and decimal equivalents of number.
If number has no prefix or $, it is hexadecimal
# prefix means decimal, e.g. B == $B == #11
This format is used for all numeric arguments.
DIRA pin [noparse][[/noparse]value]
If value is supplied, set the given pin DIRA to
the value; otherwise display the pin DIRA value.
OUTA pin [noparse][[/noparse]value]
If value is supplied, set the given pin OUTA to
the value; otherwise display the pin OUTA value.
PULSE pin time
Invert the given pin OUTA for the time in system
waitcnt ticks.
INA pin
Display the INA value for the pin.
PropCMD does not attempt to SPIN commands it does not
recognize; it will reply Unknown Command.
Note that while this code observes the directory Hidden
Attribute bit, there are no functions to manipulate it.
fsrw does not expose this functionality and I would
rather work on a totally new filesystem capable of
opening multiple files than further patching to fsrw.
Object "PropCMD" Interface:
PUB mainProgram
Program: 2,999 Longs
Variable: 758 Longs
Note -- I am a Prop n00b although I've been programming for many years, and I've probably missed a lot of tricks that could make the code tighter. I am open to all suggestions.
Post Edited (localroger) : 4/4/2009 1:05:32 AM GMT
Comments
Did you keep the virtual folder stuff from 1.7b?
BTW, Both AiGeneric 2.1 and AiGeneric 2.1cf were released in OBEX last night.
obex.parallax.com/objects/439/
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
A quick glance at the code, I'll say you cleaned it up nicely. [noparse]:)[/noparse]
An odd thought..
If you stuck a copy of FemtoBASIC in the higher end of a 64K eeprom,
and added a little launch command for BASIC, this would make a perfect
introductory setup for new Propeller users that may not have SD yet.
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
localroger -- I think there's already a version of FSRW that allows multiple files to be open at a time. It may be in the ObEx.
Post Edited (Mike Green) : 4/1/2009 3:33:24 PM GMT
You should be able to get away with doing the same thing with AiGeneric as well.
OBC
Edit: I think someone did a nice copy routine in a mod of PropDOS somewhere,
I'll have to dig it up. It would make a nice addition.
Glad to hear you are moving toward directory support! Awesome.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Need to make your prop design easier or secure? Get a PropMod has crystal, eeprom, and programing header in a 40 pin dip 0.7" pitch module with uSD reader, and RTC options.
drop in the AiGeneric font. I'm a little surprised that you didn't include the ability
to spin binaries simply by typing their name. (A very doslike ability.) All in all, nicely done.
I'm looking forward to seeing more of your project as you continue with it.
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
I like what you have so far! If you can get FAT16/attributes sub directories working that would be great!
Since it sounds like Ariba is working on an 'OS' as well, it will be interesting to see what develops.
Mike Green's OS has an I/O kernel, which makes it a little more like "OS-like." Is that something that you have considered doing?
--trodoss
[noparse][[/noparse]Edit:] I missed the post in another thread where Mike Green mentions the same thing (kernel resources in his OS)...
http://forums.parallax.com/showthread.php?p=796163
Post Edited (trodoss) : 4/2/2009 2:48:37 PM GMT
The I/O kernal isn't something I need for my own use, though I wouldn't complain if someone were to use PropCMD as a starting point to add it in. My main focus is a particular app which will be doing a lot of disk access. I was thinking of doing I/O redirect within PropCMD mainly as a convenience, e.g. for blowing a file out of a serial port or logging a dump or the output of a file compare to a file. I will also be using the kernal I'm building to launch real applications but since they're going to be purpose written the current method of rebooting into them is fine.
Right now it seems to me that I/O-wise the Prop is about where operating systems were before CPU's started to have relative jump instructions. With for example CP/M on the 8080 programs had to be loaded to the fixed locations where they were compiled, so it was actually more efficient to just insert direct calls in your application source to the OS resources you needed. When it became possible to load programs anywhere, it made more sense to call a common agreed address or interrupt with a code so that the interface would work no matter where the programs were placed in memory. Since all prop apps pretty much start out as full source in the prop tool, so far nobody has really had much incentive to move to a common API model.
Keep up the good work and keep going guys
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBladeProp, SixBladeProp, website (Multiple propeller pcbs)
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index)
· Search the Propeller forums (via Google)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBladeProp, SixBladeProp, website (Multiple propeller pcbs)
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index)
· Search the Propeller forums (via Google)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
Schweeeet. I have put PropCMD up on the obex with a couple of mods, including that the aigeneric is commented IN by default. You will appreciate that |MORE and ctrl-c work with even the chain command with those big disk image files
PropCMD is stored in the eeprom. When the Prop on the TriBladeProp boots, it loads PropCMD. I am using a PC for the Terminal so I then load the ZiCog binary from the microSD card. This in turn executes on the Prop and loads the Z80 CPM code into the ZiCogs 64KB memory (external SRAM) and the image of a 960KB CPM drive from the microSD into the remaining SRAM. It then runs the emulator which can run MBASIC, DIR, TYPE, SURVEY, etc CPM commands/programs, all under Z80 emulation by the Prop.
Thanks to Michael Rychlik (heater) for ZiCog; Roger Williams(localroger)/Michelli Scales for PropCMD·& Jeff Ledger (OBC) for PropDOS; Radical Eye Software (Tomas Rokicki) and Mike Green for fswrFemto; Mike Green for sdspiFemto (which is the ultimate PASM driver for the SD and EEPROM); Andy Schenk for PC_Text & PC_Keyboard; Parallax, Inc.(Chip) and ?? for doing the Plus extensions for FullDuplexSerialPlus. My apologies to anyone I have wrong or missed -·please PM me so I can include you. There have been so many others who have helped me along the way·to learn the prop, including especially Hippy.
I am so happy I am going to break the rule and post this on both the·ZiCog and·PropCMD threads - please don't abuse me for this
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBladeProp, SixBladeProp, website (Multiple propeller pcbs)
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index)
· Search the Propeller forums (via Google)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
Post Edited (Cluso99) : 4/6/2009 12:27:28 AM GMT
That is way cool. BTW when crediting for PropCMD use Roger Williams / localroger -- I am giving Michelli the copyright since they're paying me to do a lot of this work, but I'm the one doing the work. (I do think it is excellent that they understand the usefulness of giving some of the stuff I'm doing to the community, such as PropCMD and the file system I'm working on now, but then I'll be using those tools to do other stuff that isn't public.)