Propeller 2 OS - it's alive! And CPM2.2 is running!

It's alive" 
And so is CPM2.2
forums.parallax.com/discussion/comment/1500868/#Comment_1500868
Only DIR, LS, HELP and VER working so far

And so is CPM2.2

forums.parallax.com/discussion/comment/1500868/#Comment_1500868
Only DIR, LS, HELP and VER working so far

P2-Monitor V1.55
P2-SDDriver x212
SD:>dir
BOOT05M0.EEP BOOT10M0.EEP BOOTCUST.EEP BOOTP8X2.EEP BOOTV112.ZIP
BOOT_RB1.EEP OS .BIN OSV114SC.ZIP OSV114SD.ZIP P8X2_SCH.PDF
P8X2_T03.BIN P8X2_T03.ZIP P8X2_USB.JPG PIN_005A.OBJ RESET_SD.OBJ
RESET_~1.SPI SYSTEM~1. _BOOTROM.OBJ _BOOT_P2.BLU _BOOT_P2.BUX
_BOOT_P2.BUY _BOOT_P2.GRN _BOOT_P2.RED _BOOT_SD.OBJ _CLEAR .CMD
_CMD .CMD _CMD_ .CMD _CODEGEN.CMD _COPY .CMD _DEL .CMD
_DIFF .CMD _DIR .CMD _DIRCPM .CMD _DNLOAD .CMD _DUMPFIL.CMD
_DUMPHUB.CMD _DUMPSOB.CMD _DUMPTOK.CMD _ECHO .CMD _EEPROM .CMD
_FREE .CMD _GETCPM .CMD _GETFAT .CMD _HELP .CMD _HELP .TXT
_LEX .CMD _LF .CMD _LINK .CMD _LS .CMD _MAPCPM .CMD
_OS .CMD _P2_LED_.BIX _P2_LED_.BIY _PUTCPM .CMD _PUTFAT .CMD
_REBOOT .CMD _REN .CMD _RUN .CMD _TESTSD .CMD _TYPE .CMD
_USED .CMD _VER .CMD
SD:>ver
*** Cluso's Propeller 2 Operating System v2.??a***
--------------------------------------------------
Originally derived from KyeDOS...
by Kwabena W. Agyeman & J. Moxham & Cluso99
& acknowledgements to M. Park (Sphinx) etc
ClockFreq 297000000Hz, ClockMode $014D28FB, Cog 0
SD card on pins 60,61,59,58
Serial on pins 63,62, Mode 00, Baud 00115200, Cog 0
Screen size: 080 x 025
<LF> is ON
Resident Cogs : This Cog: 0
Cogs available: -1234567(=7)
SD:>
Comments
If we always remain in SPI mode the SD card can hopefully be re-initialized over and over this way after each reset without needing removal.
Yes we do need to check out SD reboot
copy (not working - bug), reboot (not converted), run (not converted)
Note that I've removed the cpm routines for now.
Speed will need improving but that can come later.
P2-Monitor V1.55 P2-SDDriver x218 SD:>help *** Cluso's Propeller 2 Operating System v.218? *** (19 May 2020) ------------------------------------------------------------------------------- ===Not everything implemented at this time=== clear ' Clear screen copy <source_file> <destination_file> ' Copy a file del <file> ' Delete a file diff <file1> <file2> ' Display file differences dir [mask] ' Display directory of files free ' Display FAT16/32 used/free space help ' Display help info lf ' Toggles LF on/off ls [mask] [A] ' Display directory of files reboot ' Reboot the Propeller Chip ren <source_file> <destination_file> ' Rename a file run <file> ' Run a ".BIN" file (kills PropOS) testsd ' Tests the SD card (writes to SD) type <file> [-Hn] ' Display the contents of a file used ' Display FAT16/32 used/free space ver ' Display info about PropOS ------------------------------------------------------------------------------- To RUN any Propeller Binary (replaces the OS completely)... SD:>RUN xxxxxxxx ' Runs xxxxxxxx.bin file ------------------------------------------------------------------------------- SD:>
.BIX for binary files (.BIN on P1) that can be loaded and run using the "RUN" command, and will overwrite the OS.
.CMX for the binary command files (.CMD on P1) for OS programs such as "DIR" etc. "RUN" is not required to run OS progams.
Currently on P2 they (.CMX files) are in the one binary until I work out how to load them. By residing in separate files the OS can easily be extended without recompiling the master OS file(s).
This command lists the files within a CPM disk file held on the SD card.
In the CPM emulation, disks are held as a contiguous file (one per cpm disk drive) under the FAT32 file system. Each cpm drive (ie FAT32 file) is 8MB although some of these were created to be 32MB to permit possible later expansion in cpm.
P2-Monitor V1.55 P2-SDDriver x218 SD:>dircpm zicog_a2.dsk ASM .COM AUTOEXEC.SUB BDOS .COM BDOS .MAC BDOS .PRN BOOT .COM BOOT .MAC BOOTGEN .COM BOOTGEN .SPL CBIOSX .COM CBIOSX .MAC CBIOSX .PRN CCP .COM CCP .MAC CCP .PRN CFGCCP .LIB COPY .COM CPMBOOT .COM CREF80 .COM DDT .COM DIF .COM DO .COM DSKBOOT .COM DSKBOOT .MAC DUMP .COM EC8080 .LIB ECZ80ALL.LIB ECZ80DOC.LIB ED .COM EX .MAC EX8080 .COM EXZ80DOC.COM FORMAT .COM GO .COM HALT .COM HDSKBOOT.MAC L80 .COM LIB80 .COM LOAD .COM LS .COM LU .COM M80 .COM MC .SUB MCC .SUB MCCL .SUB MOVER .COM MOVER .MAC MOVER .PRN PIP .COM SHOWSEC .COM STAT .COM SUBMIT .COM SURVEY .COM SURVEY .MAC SYSCOPY .COM SYSCPM2 .SUB UNCR .COM UNERA .COM UNERA .MAC XFORMAT .COM XSUB .COM ZIBOOT .COM ZIBOOT .MAC SD:>
Compile OS2.spin with pnut
You will need to copy _HELP2.TXT to the SD card to get help.
Commands that require parameters have their own simple help by just entering the command without any additional parameters. eg COPY
Mike
.sp2 for spin source
.bix for binaries (_BOOT_P2.BIX and _BOOT_P2/BIY are used in the ROM) see note below
.cm2 for OS command binaries
Note: I saw Eric use .biz for an OS test he did.
We should choose just one of .BIX .BIY .BIZ BI2 now!
For P1 I use
.spn for Sphinx (P1 spin source files)
.sob for Sphinx (spin objects while compiling spin)
.tok for Sphinx (tokens while compiling spin)
.bin for binaries
.cmd for OS command binaries
.dsk for CPM Disks (will be the same for P2)
Sphinx is Michael Parks P1 spin compiler and OS that runs on a P1.
I have converted this to run on my P1 OS but it was never thoroughly tested
Postedit
Updated Sphinx extensions
this is a really cool project. I will try it out!
Wuerfel, what is VentilatorOS?
(Also, while you're here, have you seen the cool Retronitus-related things I've made?)
Yes, add any .RAM or whatever you need. Would be great to get a list we all can use
Unfortunately haven't had any P1 time to look and try your modified P1 OS. What you've done sounds great!
When I get a bit further with my P2 OS perhaps we can work to improve it. Currently there is no optimisation or much error checking. It's a very basic conversion of the spin but because I cannot get any info from Chip, I'm at a loss (without decoding pnut/spin) to get to the next stage. Meanwhile, I have plenty to go on with.
The only thing that I don't want touched (for now) is the SD PASM driver. There are a number of gotchas in there that MUST be obeyed or the SD card fails/locks. And there are a few things I want to add. But substitution of the driver is fine with me.
Currently the serial/monitor calls remain in the same position as the ROM calls, except for the cog register usage which has been mandated to move by Chip's pnut/spin2. The hub code positioning will change later.
I don't have a P1 setup to try out VentilatorOS at the moment since I switched focus to the P2. But it sounds like cool additions to what Cluso and others have done. Nice team effort!
I have actually seen YouTube clips of your Retronitus compositions, but it's hard to tell what's changed just by hearing!
I had somehow missed these! NICE WORK! Very enjoyable chip tunes.
Can it still play this example tune I made for my latest release?
It's (only walking the tree and locating files in the FAT Directory table) all pasm and running in its' own cog...
And it's finding the Z80 CPM files
C:\P2\Propeller_II_Latest\ClusoZ80>l420 tmp.binary -b115200 -t -SINGLE ( Entering terminal mode. Press Ctrl-] to exit. ) P2 SD Demo v.??? 2020-05-31 Initialise Find Directory Find file(s) A: ZICOG_A2.DSK sector 0000E580 size 00800000 B: ZICOG_B .DSK sector 00012580 size 00800000 C: ZICOG_C .DSK sector 00016580 size 02000000 D: ZICOG_D .DSK sector 00026580 size 00800000 E: DRAC_A .DSK sector 000064C0 size 00800000 F: DRAC_B .DSK sector 0000A4C0 size 00800000 G: ZICOG_G .DSK sector 00032580 size 00100000 H: ZICOG_H .DSK sector 00032D80 size 00100000 Z: BOOTHDSK.ROM sector 00006480 size 00000400 *
C:\P2\Propeller_II_Latest\ClusoZ80>l420 clusoz80-038a.binary -b115200 -t -SINGLE ( Entering terminal mode. Press Ctrl-] to exit. ) Auto Detected P2EVAL Cluso's P2 Z80 Emulation: Experimental v038a PC B C D E H L A F R R2 IF SP alu ea OpCode(s) Vector3 V-1 V-2 V-3 PC++ ---------------------------------------------------------------------------------------------------- 0000 0000 0000 0000 00 40 00 00 03 0000 = 12EC 0000: C3 00 F1 00 000BF054: 054 0BF 000 0001 F100 0000 0000 0000 00 40 00 00 03 0000 = 1024 F100: 11 08 F1 D3 0009C054: 054 09C 000 F101 F103 0000 F108 0000 00 40 00 00 03 0000 = 132C F103: D3 00 C3 00 2E46107A: 07A 061 0B9 F104 oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo F105 0000 F108 0000 00 40 00 00 03 0000 = 01000000 0000F108 =BOOT= oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo PC B C D E H L A F R R2 IF SP alu ea OpCode(s) Vector3 V-1 V-2 V-3 PC++ F105 0000 F108 0000 00 40 00 00 03 0000 = 12EC F105: C3 00 01 3D 000BF054: 054 0BF 000 F106 0100 0000 F108 0000 00 40 00 00 03 0000 = 12EC 0100: C3 13 01 00 000BF054: 054 0BF 000 0101 0113 0000 F108 0000 00 40 00 00 03 0000 = 1088 0113: 2A 06 00 F9 2908B07C: 07C 08B 0A4 0114 0116 0000 F108 F000 00 40 00 00 03 0000 = 13C4 0116: F9 11 C9 16 000BB068: 068 0BB 000 0117 0117 0000 F108 F000 00 40 00 00 03 F000 = 1024 0117: 11 C9 16 0E 0009C054: 054 09C 000 0118 011A 0000 16C9 F000 00 40 00 00 03 F000 = 1018 011A: 0E 09 CD BD 00099052: 052 099 000 011B 011C 0009 16C9 F000 00 40 00 00 03 F000 = 1314 011C: CD BD 16 21 0002F054: 054 02F 000 011D 16BD 0009 16C9 F000 00 40 00 00 03 EFFE = 13B4 16BD: F5 C5 D5 E5 0003206B: 06B 032 000 16BE 16BE 0009 16C9 F000 00 40 00 00 03 EFFC = 12F4 16BE: C5 D5 E5 CD 00032062: 062 032 000 16BF 16BF 0009 16C9 F000 00 40 00 00 03 EFFA = 1334 16BF: D5 E5 CD 05 00032065: 065 032 000 16C0 16C0 0009 16C9 F000 00 40 00 00 03 EFF8 = 1374 16C0: E5 CD 05 00 00032068: 068 032 000 16C1 16C1 0009 16C9 F000 00 40 00 00 03 EFF6 = 1314 16C1: CD 05 00 E1 0002F054: 054 02F 000 16C2 0005 0009 16C9 F000 00 40 00 00 03 EFF4 = 12EC 0005: C3 00 F0 00 000BF054: 054 0BF 000 0006 F000 0009 16C9 F000 00 40 00 00 03 EFF4 = 0FE0 F000: 00 D3 00 00 00000003: 003 000 000 F001 F001 0009 16C9 F000 00 40 00 00 03 EFF4 = 132C F001: D3 00 00 01 2E46107A: 07A 061 0B9 F002 oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo F003 0009 16C9 F000 00 40 00 00 03 EFF4 = 01000000 000016C9 Z80doc instruction exerciser oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo PC B C D E H L A F R R2 IF SP alu ea OpCode(s) Vector3 V-1 V-2 V-3 PC++ F003 0009 16C9 F000 00 40 00 00 03 EFF4 = 0FE0 F003: 00 01 22 22 00000003: 003 000 000 F004 F004 0009 16C9 F000 00 40 00 00 03 EFF4 = 0FE4 F004: 01 22 22 11 00094054: 054 094 000 F005 F007 2222 16C9 F000 00 40 00 00 03 EFF4 = 1024 F007: 11 33 33 21 0009C054: 054 09C 000 F008 F00A 2222 3333 F000 00 40 00 00 03 EFF4 = 1064 F00A: 21 44 44 C9 000A4054: 054 0A4 000 F00B F00D 2222 3333 4444 00 40 00 00 03 EFF4 = 1304 F00D: C9 00 00 00 000000BE: 0BE 000 000 F00E 16C4 2222 3333 4444 00 40 00 00 03 EFF6 = 1364 16C4: E1 D1 C1 F1 000000A3: 0A3 000 000 16C5 *
Cluso's P2 Z80 Emulation: Experimental v042a PC B C D E H L A F R R2 IF SP alu ea OpCode(s) Vector3 V-1 V-2 V-3 PC++ ---------------------------------------------------------------------------------------------------- 0000 0000 0000 0000 00 40 00 00 03 0000 = 130C 0000: C3 00 FF 00 000C3058: 058 0C3 000 0001 FF00 0000 0000 0000 00 40 00 00 03 0000 = 130C FF00: C3 05 FF 00 000C3058: 058 0C3 000 FF01 FF05 0000 0000 0000 00 40 00 00 03 0000 = 13CC FF05: F3 06 80 3E 000001A9: 1A9 000 000 FF06 FF06 0000 0000 0000 00 40 00 00 00 0000 = 1018 FF06: 06 80 3E 0E 0009B056: 056 09B 000 FF07 FF08 8000 0000 0000 00 40 00 00 00 0000 = 10F8 FF08: 3E 0E D3 FE 000B5056: 056 0B5 000 FF09 FF0A 8000 0000 0000 0E 40 00 00 00 0000 = 134C FF0A: D3 FE 05 C2 2F46507E: 07E 065 0BD FF0B oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo --- Write to Port: 01 00FE 0E . stdio oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo PC B C D E H L A F R R2 IF SP alu ea OpCode(s) Vector3 V-1 V-2 V-3 PC++ FF0C 8000 0000 0000 0E 40 00 00 00 0000 = 1014 FF0C: 05 C2 0A FF 26CDB05D: 05D 0DB 09B FF0D FF0D 7F00 0000 0000 0E 16 00 00 00 0000 = 1308 FF0D: C2 0A FF 3E 100D8091: 091 0D8 040 FF0E FF0A 7F00 0000 0000 0E 16 00 00 00 0000 = 134C FF0A: D3 FE 05 C2 2F46507E: 07E 065 0BD FF0B oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo --- Write to Port: 01 00FE 0E . stdio oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo PC B C D E H L A F R R2 IF SP alu ea OpCode(s) Vector3 V-1 V-2 V-3 PC++ FF0C 7F00 0000 0000 0E 16 00 00 00 0000 = 1014 FF0C: 05 C2 0A FF 26CDB05D: 05D 0DB 09B FF0D F
This is stepping thru' the CPM BIOS as it prepares to read from the disk (SD Card).Yes.
Wordstar already runs on my P1 RamBlade plus lots of the other CPM2.2 programs too, including msbasic. The RamBlade has 512KB SRAM and uSD and fits in a matchbox.
clusos.com/home/ramblade/
This is the forum link but lots of things got lost in the forum upgrades.
https://forums.parallax.com/discussion/116893/ramblade-prop-sram-microsd-addon-to-run-zicog-cpm-propdos-catalina-etc/p1
BTW heater wrote the Z80 emulation (ZiCog) for P1. My P2 Z80 emulation is based more along the lines Pullmoll did in his qz80 which is a more thorough Z80 implementation which includes many of the undocumented instructions.
My Z80 implementation is running and works up to reading the SD card. I have the SD card driver already working in a separate program, so it's only a matter of combining the two programs together now. I should have that done in the next day or so
Each .cm2 would load into cog $0. They are compiled separately although they are aware of the resident hubexec code. This allows extension commands/programs without the need to recompile all OS commands and programs.
So it’s similar to CPM and DOS.
Standalone programs can be launched that take over the whole P2 - eg CPM takes over the whole P1 although my intention was to have CPM run as an OS command.