Shop OBEX P1 Docs P2 Docs Learn Events
Cluso's Propeller OS (v2.43) - includes SD Driver and FAT32 Object plus Serial Driver — Parallax Forums

Cluso's Propeller OS (v2.43) - includes SD Driver and FAT32 Object plus Serial Driver

Cluso99Cluso99 Posts: 18,069
edited 2021-05-18 04:07 in Propeller 2

Here is the first official release of my OS for the P2.

2021-05-18: Update v2.43

  • The SD mailbox definition has been move to upper hub ram and the addresses defined in _HUBDEF.
  • The startSD(_hub._sd_mailbox, @sd_buffer, _hub._sdpins) now passes the sd_buffer address and the sdpins but the pins are currently fixed (ie ignored) in SD_DRIV.
  • Added a "Q"uit command to SD_DRIV
  • A few minor fixes and tweeks.
    Note: All object files updated and may be incompatible with previous releases

2021-05-14: Update v2.42
_hubdef2.spin Reorganised and added some more fields. Now located in hub just below $7C000
Improved information messages and general code tidy

2021-05-14: Update v2.41
DIFF improved
DIR & DIRCPM improved
COPY improved
general code tidy

2021-05-13: Update v2.40
Minor fixes and following commands added
RSECTOR nnnnn
DIRCPM

Previous thread discussing this is here
https://forums.parallax.com/discussion/comment/1499300

Included in this release.....

  • OS238 v238 - OS for P2 - uses an SD Card formatted as FAT32
  • SD_DRIV v270 - SD pasm driver (reqs a cog)
  • SD_FAT32 v237 - FAT32 object supporting FAT32 multiple files (converted/modified from Kye's FAT driver)
  • rr_format_IO v066 - A common formatting object derived from jonnymac's jm_fullduplexserial
  • rr_ser_drv_multiport16 v060 - Multiport Serial Driver - pasm (reqs a cog)

Please report any bugs here :)
Enjoy :sunglasses:

Comments

  • Cluso99Cluso99 Posts: 18,069
    edited 2021-05-15 06:50

    The following is a sample output from running the OS

    C:\P2\_RetroBlade2\OS\OS242>C:\P2\_RetroBlade2\loadp2 os242.binary -b115200 -t -SINGLE
    ( Entering terminal mode.  Press Ctrl-] or Ctrl-Z to exit. )
    wait ...
    
    --------------------------------------------------
    === Cluso's Propeller 2 Operating System OS242 ===
    --------------------------------------------------
      User code     running in cog 0 ClockFreq 200000000Hz, Mode $ 10009FB
      Serial Driver running in Cog 1 on pins 63,62  Mode 0, Baud 115200
      SD Driver     running in Cog 2 on pins 60,61,59,58
      Resident Cogs   -12-----(=2)  This is Cog 0
      Cogs available  ---34567(=5)
      Screen          80 x 25  <LF> is ON   2021-05-15  10:00:00
    --------------------------------------------------
    SD:>dir
    BOOTHDSK.ROM   DELETE  .ME    DRAC_A  .DSK   DRAC_B  .DSK   P56     .BIX
    RETROCPM.BIX   RETROOS2.BIX   SYSTEM~1.      TEST10  .BIX   ZICOG_A2.DSK
    ZICOG_B .DSK   ZICOG_C .DSK   ZICOG_CX.DSK   ZICOG_D .DSK   ZICOG_E .DSK
    ZICOG_F .DSK   ZICOG_G1.DSK   ZICOG_H1.DSK   ZICOG_SC.DSK   ZICOG_VP.DSK
    _BOOT_P2.BIZ   _DIR    .CM2   _HELP   .TXT   _HELP1  .TXT   _HELP2  .TXT
    _HELP4  .TXT   _HELP6  .TXT   _ILI9163.BIN
    SD:>copy _help2.txt _help8.txt
     Copy File _help2.txt ---> _help8.txt
     File copied, 2064 bytes
    SD:>diff _help2.txt _help8.txt
     Comparing...
     Files identical, 2064 bytes.
    SD:>ren _help8.txt _help9.txt
     Renaming File _help8.txt    --->  _help9.txt
    SD:>del _help9.txt
     Deleting File _help9.txt
    SD:>
    

    The following is the contents of the _HELP2.TXT file that should be included on the SD Card

    *** Cluso's Propeller 2 Operating System v.241  ***               (14 May 2021)
    -------------------------------------------------------------------------------
    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 FAT32 used/free space
    help                                          ' Display this help info
    lf                                            ' Toggles LF on/off
    ls      [mask] [A]                            ' Display directory of files
    ren     <source_file> <destination_file>      ' Rename a file
    rsector <sectornum_in_hex>                    ' Read and display sector#
    type    <file> [-Hn]                          ' Display the contents of a file
    used                                          ' Display FAT32 used/free space 
    ver                                           ' Display info about PropOS 
    -------------------------------------------------------------------------------
    dircpm  <cpm_disk> [mask]                     ' Display directory of CPM files
    ===============================================================================
    Still to do/fix...
    -------------------------------------------------------------------------------
    reboot                                        ' Reboot the Propeller Chip
    run     <file>                                ' Runs binary .BIX file (repl.OS)
    testsd                                        ' Tests SD card (writes to SD)
    -------------------------------------------------------------------------------
    cpm2fat <cpm_disk> <cpm_file> <fat_file> -T/B ' Copy CPM file to FAT32
    fat2cpm <fat_file> <cpm_disk> <cpm_file>      ' Copy FAT32 file to CPM
    -------------------------------------------------------------------------------
    fat2pc  <fat_file>                            ' Copy FAT32 file to PC
    pc2fat  <fat_file>                            ' Copy PC file to FAT32
    -------------------------------------------------------------------------------
    
  • Cluso99Cluso99 Posts: 18,069

    Reserved

  • Cluso99Cluso99 Posts: 18,069
    edited 2021-05-13 08:03

    V2.40 update in the top/first post.

    Minor fixes...
    OS240 v240 updated
    SD_DRIV v272 updated
    _PINDEF added

    Commands added...
    RSECTOR < sector_number_in_hex >
    DIRCPM < cpm_diskname > [ < cpm_filename > ]

    Entering any command without parameters will display the command syntax unless the command operates alone (ie DIR) where the command followed by ? (eg DIR ?) will display the syntax.

  • Hi Cluso,
    this sounds nice.
    Some years ago I earned some money programming a LSI11 running RT11XM. Later 68k with OS9.
    I am thinking, if I should build a P2 computer to control experiments.
    It should be able to run for xx days running at least one foreground job to control the experiment.
    I would like to log in and be able to start different background programs for example viewing the data while the experiment is still working.
    Can your system load resident programs into P2 cogs as such foreground jobs?
    Regards Christof

  • Cluso99Cluso99 Posts: 18,069

    @"Christof Eb." said:
    Hi Cluso,
    this sounds nice.
    Some years ago I earned some money programming a LSI11 running RT11XM. Later 68k with OS9.
    I am thinking, if I should build a P2 computer to control experiments.
    It should be able to run for xx days running at least one foreground job to control the experiment.
    I would like to log in and be able to start different background programs for example viewing the data while the experiment is still working.
    Can your system load resident programs into P2 cogs as such foreground jobs?
    Regards Christof

    Not yet although that is the intention. It’s not that difficult.

    Currently you could recompile with the extra code.

    I’ve been busy lately and now just getting enough free time to find the FAT32 bugs that have prevented me making progress on this. I just need to get load and run working next. Also, I need to make part of the OS stay resident and be able to load new commands. My P1 OS had separate loadable commands (eg DIR etc) so you just needed to make a new command and add that binary to the SD, without any changes to the existing OS. Currently they are all part of the one big binary requiring recompile when adding a new command to the source.

  • Cluso99Cluso99 Posts: 18,069

    A new update in the first post v2.41

    DIFF improved
    DIR & DIRCPM improved
    COPY improved
    general code tidy

  • Cluso99Cluso99 Posts: 18,069

    A new update in the first post v2.42

    _hubdef2.spin Reorganised and added some more fields. Now located in hub just below $7C000

    Improved information messages and general code tidy

  • Sounds super, can't wait to try it out.
    I just need to get an adapter I can plug into the pc then copy your OS to the SD Card.

  • Hey @Cluso99, I noticed a bug in your SD_Driv

    The first thing startSD does is call stopSD() and in stopSD it fills2 bytes with -1 at ptr_mailbox, but it's not been initialised yet.

    you might want to put the
    ptr_mailbox := sd_mailbox
    before
    stopSD() ' stop cog if running

    PUB startSD(sd_mailbox) : result ' start SD Driver - uses a cog
    stopSD() ' stop cog if running
    ptr_mailbox := sd_mailbox
    sdcog := coginit(COGEXEC_NEW, @sddriver, ptr_mailbox) + 1 ' start sd driver cog
    return sdcog

    PUB stopSD() ' Stop SD Driver - frees a cog if driver was running
    if (sdcog) ' cog active?
    cogstop(sdcog-1) ' yes, shut it down
    sdcog := 0 ' and mark stopped
    bytefill(ptr_mailbox, -1, 2) ' reset object globals cmd=status=$FF

    Great work though as always bud :D

  • Cluso99Cluso99 Posts: 18,069

    Thanks for finding this baggers. Could be a nasty bug to find.

    There is actually no need for the stopSD in my OS as stopSD will not be present in the OS once it starts as soon as I get the commands back into separate binaries.

    I'm planning to put the sd_mailbox into fixed top hub with _HUBREF2 next.

  • No worries, saw it and thought I best mention it, in case it bites you at a later date. :)

  • Cluso99Cluso99 Posts: 18,069
    edited 2021-05-18 04:08

    V2.43 Update in the first post

    2021-05-18: Update v2.43

    • The SD mailbox definition has been move to upper hub ram and the addresses defined in _HUBDEF.
    • The startSD(_hub._sd_mailbox, @sd_buffer, _hub._sdpins) now passes the sd_buffer address and the sdpins but the pins are currently fixed (ie ignored) in SD_DRIV.
    • Added a "Q"uit command to SD_DRIV
    • A few minor fixes and tweeks.
      Note: All object files updated and may be incompatible with previous releases
  • Cluso99Cluso99 Posts: 18,069

    Just a push to show this is available

Sign In or Register to comment.