Cluso's Propeller OS (v2.43) - includes SD Driver and FAT32 Object plus Serial Driver
Cluso99
Posts: 18,069
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
Comments
The following is a sample output from running the OS
The following is the contents of the _HELP2.TXT file that should be included on the SD Card
Reserved
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
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.
A new update in the first post v2.41
DIFF improved
DIR & DIRCPM improved
COPY improved
general code tidy
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
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.
V2.43 Update in the first post
2021-05-18: Update v2.43
Note: All object files updated and may be incompatible with previous releases
Just a push to show this is available