Shop OBEX P1 Docs P2 Docs Learn Events
Propeller 2 OS - it's alive! And CPM2.2 is running! — Parallax Forums

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

Cluso99Cluso99 Posts: 18,066
edited 2020-07-17 01:22 in Propeller 2
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 :)
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:>
«13

Comments

  • Nice work :-)
  • Nice
  • Sweet! You've been busy!
  • roglohrogloh Posts: 5,122
    edited 2020-05-18 22:57
    Interesting. Once you add a loader to this Cluso it would become very useful for interactive control of different applications, even if there is no way back out except for pressing reset at which point it reloads and starts again.

    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.
  • Nice work Cluso

    Yes we do need to check out SD reboot
  • Cluso99Cluso99 Posts: 18,066
    rogloh wrote: »
    Interesting. Once you add a loader to this Cluso it would become very useful for interactive control of different applications, even if there is no way back out except for pressing reset at which point it reloads and starts again.

    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.
    There should be no need to re-initialise the SD card, even if you access the Flash in between, so long as you leave the I/O pins tristated when Flash access is done. My SD driver always leaves the pins tristated after initialisation/readCSDCID/readSector/writeSector.
  • roglohrogloh Posts: 5,122
    edited 2020-05-19 04:56
    Yes hopefully there will be a way to use both flash and SD reliably like this after multiple resets etc. Though if we change a card into SD mode it will stay that way until a power down I believe. For now we don't have SD mode drivers so it is not an issue. IIRC the P2D2 has the ability to power cycle the SD card so that could fix that issue too on reset.
  • Cluso99Cluso99 Posts: 18,066
    clear, del, diff, free, help, lf, ls, ren, testsd, type, used, ver all working :)

    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:>
    
  • Cluso99Cluso99 Posts: 18,066
    To permit the same SD card to be used on both P1 and P2 I will be using the following naming conventions...

    .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).
  • Cluso99Cluso99 Posts: 18,066
    DIRCPM working :)

    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:>
    
  • cool
  • Cluso99Cluso99 Posts: 18,066
    edited 2020-05-21 09:20
    Here is x220 :)

    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
  • Eureka! It runs. Thanx for posting the sources. Question: What short extension should we use for spin2 sources? sp2? For that matter, what 3-character extension should we use for spin. It would be nice for Fastspin and PNut to accept the short extensions as equivalent.
  • sp1 and sp2 would make sense.

    Mike
  • Cluso99Cluso99 Posts: 18,066
    edited 2020-05-21 23:23
    For P2
    .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


  • Wuerfel_21Wuerfel_21 Posts: 4,371
    edited 2020-05-21 23:06
    Cluso99 wrote: »
    For P1 I use
    .spn ? from Michael Parks compiler (I’ll check today) and some intermediates
    .bin for binaries
    .cmd for OS command binaries
    .dsk for CPM Disks (will be the same for P2)
    For completeness sake, VentilatorOS additionally has .RAM for SPI RAM preload files - might be useful to have HyperRAM preload on P2?
  • Ahle2Ahle2 Posts: 1,178
    Cluso,
    this is a really cool project. I will try it out!

    Wuerfel, what is VentilatorOS?
  • Wuerfel_21Wuerfel_21 Posts: 4,371
    edited 2020-05-22 19:14
    Ahle2 wrote: »
    Wuerfel, what is VentilatorOS?
    My somewhat customized/improved fork of Cluso's P1 OS. [Relevant forum post]

    (Also, while you're here, have you seen the cool Retronitus-related things I've made?)
  • Cluso99Cluso99 Posts: 18,066
    edited 2020-05-22 23:11
    @Wuerfel_21
    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.
  • Ahle2Ahle2 Posts: 1,178
    Wuerfel,
    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! ;) Since I left Retrontus in the dust, I havn't been following the thread much or bothered testing things out. The reason is that I got burned out three years ago and went home with sick-leave for a year. I couldn't think straight and I lost interested in all my "babies". When I got better a new shiny thing called the P2 layed on my desktop. End of story. (I am interested thugh!)
  • https://www.youtube.com/watch?time_continue=130&v=q5fOpF1_uxQ&feature=emb_logo

    I had somehow missed these! NICE WORK! Very enjoyable chip tunes.

  • Ahle2Ahle2 Posts: 1,178
    edited 2020-05-23 07:39
    Wuerfel,

    Can it still play this example tune I made for my latest release?
  • Ahle2 wrote: »
    Wuerfel,

    Can it still play this example tune I made for my latest release?
    Not without some adjustments. Instruments need to be adapted to 64kHz sample rate and some data would need to be shuffled around a bit. I should probably do this at some paint.
  • Cluso99Cluso99 Posts: 18,066
    edited 2020-06-03 12:58
    And another step forward to Z80/CPM2.2...

    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 :sunglasses::sunglasses::sunglasses:
    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
    *
    
  • Cluso99Cluso99 Posts: 18,066
    Getting closer...
    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
    *
    
  • Cluso99Cluso99 Posts: 18,066
    And more progress :sunglasses:
    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).
  • cgraceycgracey Posts: 14,133
    Looks pretty neat, Ray. Will you be able to run WordStar on it?
  • Cluso99Cluso99 Posts: 18,066
    edited 2020-06-09 07:50
    cgracey wrote: »
    Looks pretty neat, Ray. Will you be able to run WordStar on it?

    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 :sunglasses:
  • @Cluso99 Up above you mentioned ".cm2 for OS command binaries". I was curious what the form your executables take. Is it CP/M-style where it's a single segment with a fixed loading location and entry point? Something more elaborate?
  • Cluso99Cluso99 Posts: 18,066
    In my P1 OS each command such as DIR was a separate program that used a bios like resident code. That’s the same vision I have for P2 but it’s not there yet.
    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.
Sign In or Register to comment.