RetroBrew Computers Forum
Discussion forum for the RetroBrew Computers community.

Home » RBC Forums » General Discussion » DOS/65 by Richard Leary (An update on where DOS/65 is)
DOS/65 by Richard Leary [message #9444] Wed, 01 December 2021 19:34 Go to next message
floobydust is currently offline  floobydust
Messages: 9
Registered: September 2020
Location: Boynton Beach, FL
Junior Member
As there was an interest recently regarding Richard's DOS/65 code, I've decided to make a post here to let everyone know what's out there.

First, I'm not the expert on this code, Richard is. I, like many, found a reference to it many years ago on a Z80 site. I eventually found Richard on LinkedIn and sent him an invite. He accepted and we eventually hooked up via email. Earlier this year, he sent me a lot of files which are his current working code base.

There is Version 2.xx code, which is what most folks would consider a more complete distribution, i.e., many of the utlities, compiler, assembler, sysgen, etc. This version of code is for a bootable version of DOS/65. This implies you will need a 6502 system with bootable media. There is also Version 3.xx code, which is a much smaller set of programs, but is designed to be held in ROM. Version 3.xx is a more current bit of code... Richard is (or was) working with two 6502 systems. First is Daryl Rictors SBC2.5 and the second is Western Design Centers W65C02SXB. With both systems, he is using a SD Card adapter that interfaces to a 6522 port along with a couple logic chips. Richard also has a S-100 based system that he continues to use.

As of late, I've not received any email replies from Richard since earlier this year. I've sent him a few emails, but he has not responded. I have no idea why, but I've sent him email just last week and still no reply. I'm just hoping he's doing okay. I believe he is in his upper 70's and perhaps some health issues have come into play.

So... Version 3.xx is what I've been working with. In Richards code, there is one main source file that contains CCM and PEM. This source code uses 6502 instructions/addressing modes only (no CMOS stuff). There is also a SIM module and a Monitor module of source code. The SIM calls routines in the Monitor code, which interfaces to the base hardware. Some of his SIM and Monitor code is using some CMOS instructions and for his ROM version for the WDC board, he is also using WDC Tools to assemble and link DOS/65 to an Intel HEX file. Part of the Monitor code initializes a top area of RAM during an initial start of DOS/65 (it's not a boot per se) by copying a section of ROM to upper RAM, then starting DOS/65 from ROM.

What I've managed to do is to integrate his current Version 3.xx code to work with my C02 Pocket SBC with my RTC/CF-Card adapter. My small 2-board system has it's own BIOS and Monitor code and I've written a single SIM module that was based on Richard's initial SIM code, but integrates a core set of routines that call my BIOS and a few Monitor calls. It also shares some common Page Zero variables. I also streamlined the RAM initialization and saved a lot of ROM space. All of my code makes use of the CMOS instructions and addressing modes. I finally modified the CCM and PEM code modules and was able to trim them down by using CMOS instructions and addressing modes. The end result, my total ROM space is 6.5KB for DOS/65 and it uses 4KB of upper RAM for the DOS/65 variables and pointers along with the MAPs required to support 7 drives, all of which are 8MB in size.

I'm happy to share the code I have and my CMOS Version 3.03 is on my GitHub page, along with the C02 Pocket SBC and RTC/CF-Card adapter. During my last email exchanges with Richard, he said he was fine with me sharing the code. I do know that at one point, he was hoping to have his DOS/65 code available on the 6502.org forum download area, but for some reason (unknown to me), that never happened. As of now, the additional utilities from the Version 2.xx have not been moved over to the Version 3.xx code base. That can be a fair amount of work and I've not had a chance to look into it at any level. The utility bits that I did some minor rework on include SUB, SD (Super Directory), UCOPY and XMODEM. Note however that XMODEM is an odd bit of code that has been modified quite a bit by more than one person. On my last update of Serial (terminal app on OSX) it stopped working. I think Serial broke their side of Xmodem using simple byte checksum... my Xmodem upload/download (in my Monitor) uses CRC-16 and still works fine.

I'm hoping to get around to working towards getting more of the Version 2.xx utilities and such moved over, but I don't have any timeframe for doing this. In any case, I'm probably going to add the Version 2.xx code to my GitHub account, but would prefer to get a reply from Richard first. I'll wait a bit longer and see if I get a reply from him. In the meantime, I'm happy to answer anything I can and to share what I have.


Re: DOS/65 by Richard Leary [message #10147 is a reply to message #9444] Sun, 16 October 2022 07:42 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
My summer gardening activities are done except one, so I have time for the winter electronic projects. Top of my list is porting DOS/65 to CRC65. Since CRC65 bootstrap from CF disk, it seems a good match for version 2 of DOS/65 which is designed to boot from disk. Looking over the various programs and documentations for DOS/65 v2, I couldn't find the source code for PEM and CCM. Are they released but hidden away somewhere? I've looked for them in GitHub: https://github.com/osiweb/DOS65 and here:
retro.hansotten.nl/6502-sbc/dos-65

I did find PEM and CCM combined with SIM and BIOS in floobydust's GitHub, but that is V3.03; I'm looking for version 2.

Bill
Re: DOS/65 by Richard Leary [message #10148 is a reply to message #10147] Mon, 17 October 2022 07:15 Go to previous messageGo to next message
danwerner is currently offline  danwerner
Messages: 50
Registered: October 2015
Member
There is a copy here that is being used for the Nhyodyne project.

https://github.com/lynchaj/nhyodyne/tree/main/6502PROC/DOS65
Re: DOS/65 by Richard Leary [message #10153 is a reply to message #10148] Fri, 21 October 2022 19:14 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
Thanks for the link.

I recognize your name as author of sedit, screen editor for DOS/65. I found a copy of sedit.asm following your link, is that the latest? I have it running in DOS/65 on my hardware (CRC65), but I notice it makes lots of access to CF disk even for relatively small file. Perhaps my CF read routine in my SIM is not efficient, but the editor that came with DOS/65 (edit205.asm) seems to write the file to CF disk quickly. Do you have an instruction for using it? Thanks,
Bill

Edit: Please ignore my comment regarding the slowness of writing data to disk. It turns out I have a conflict with zero page utilization, so once I've moved sedit's zero page assignments away from SIM's zero page usage, the sedit program works much better.

[Updated on: Fri, 21 October 2022 22:04]

Report message to a moderator

Re: DOS/65 by Richard Leary [message #10162 is a reply to message #10153] Wed, 09 November 2022 17:47 Go to previous messageGo to next message
danwerner is currently offline  danwerner
Messages: 50
Registered: October 2015
Member
This is something I hacked together for the port I did for the original DOS/65 port for the Retrobrew 6x0x SBC here: https://retrobrewcomputers.org/doku.php?id=boards:sbc:6x0x-a tx-6u:start

I also included it in the DOS/65 port for the 6502 processor for Nhyodyne. I did not spend much time on it and is not nearly the quality of Richard's work on DOS/65. There is no real docs for it and only supports ANSI-ish (VT-xxx) terminals and was never really optimized.

As far as the disk access, if I recall it uses pretty simple DOS/65 file IO, nothing fancy. The source is included in the Nhyodyne and is reasonably well documented.

Dan Werner

[Updated on: Wed, 09 November 2022 17:49]

Report message to a moderator

Re: DOS/65 by Richard Leary [message #10200 is a reply to message #9444] Mon, 16 January 2023 04:00 Go to previous messageGo to next message
ian-may is currently offline  ian-may
Messages: 12
Registered: October 2015
Junior Member
Hi Dan, last year (after having a 6x0x-ATX-6U board for 8 years!) I attempted to bring up DOS/65 using the quick-start software package. I could not make a boot-able SD card, though I could run DOS/65 by jumping to the cold start address at $CC00. During the install PPPBOOT briefly flashed the SD card LED consistent with a single sector write and the LED stayed on much longer when running PPPWROS consistent with writing many sectors. But when I looked at the data on the SD card where DOS/65 should be it was not there. When I disassembled PPPBOOT.S19 and PPPWROS.S19 I discovered that they were both using memory location $57 for the sector number whereas the drivers in the ROM use location $53. So PPPBOOT was writing to the sector number in location $53 (which seems to be unaltered by the monitor and therefore rather random) and PPPWROS overwrote that sector with all of DOS/65.

Since I'm running LINUX and have used the "AS" cross assembler (http://john.ccac.rwth-aachen.de:8000/as/) previously, I modified your assembly code to "AS" syntax. The modified PPPBOOT and PPPWROS ($57->$53) then worked and I had a boot-able system. Later I changed your monitor code to "AS" syntax and found that a line of code in the ASSMB.ASM file produced an addressing mode error. From your R52PPP.LST file in the dos65-072714.zip package m6502 directory:
ENTER_DIGIT_OUT: ;
0104+ F70D 48 PHA
0105+ F70E 20 23 F1 JSR IOF_OUTCH ; PRINT OUT CHAR
0106+ F711 68 PLA
0107+ F712 85 32 STA (WORKPTR)
0108+ F714 4C D9 FD JMP INCWORKPTR

Line 107+ is not NMOS 6502 assembler and TASM just blindly ignored the indirection. As far as I can see that line of code makes no sense, it is overwriting the low byte of a 16 bit pointer with the character just printed to the console. It also wouldn't make sense with the indirection honored. Was it an accidental paste in an editor?

The only other issue I have identified is that SD cards less than 2GB do not work. 4GB and 2GB Verbatim SD cards work. A 1GB SanDisk SD card and an unbranded 1GB micro SD card both crash after printing the sign on message (A> prompt never appears). A 512MB SanDisk SD card manages to crash the MONITOR when trying to download S-Records. The cards that don't work on the 6x0x-ATX-6U do work in a PC. Have you been successful with SD cards less than 2GB?

So could you please have a look at the quick-start software package? Preferably from the https://retrobrewcomputers.org/doku.php?id=boards:sbc:6x0x-a tx-6u:start page rather than what is on your PC just in case the wiki page actually has the wrong version.
Thanks, Ian.
Re: DOS/65 by Richard Leary [message #10201 is a reply to message #10200] Wed, 18 January 2023 19:45 Go to previous messageGo to next message
danwerner is currently offline  danwerner
Messages: 50
Registered: October 2015
Member
I suspect you are correct, that I had a bad cut/paste and TASM ignored the extra parentheses. I probably will not get a chance to look at this until the weekend, but I will take some time and run this down. It has been a bit since I used my 6x0x board, so it might take a day or two though. I do know that boot from SD did work at one time, so I expect the bug is minor.

I honestly do not remember what SD cards that I tested with DOS/65 -- but I will try to run this down as well.

This code is not included in the work that I have done porting DOS/65 to the Nhyodyne computer and so I completely missed it in my latest work. I don't really use TASM any longer for 6502 code opting instead for CA65 since it will run on my linux based build server.

Thanks for the bug report!!! I will keep you updated as I work through the issues.

Dan


Re: DOS/65 by Richard Leary [message #10202 is a reply to message #10201] Thu, 19 January 2023 03:44 Go to previous messageGo to next message
ian-may is currently offline  ian-may
Messages: 12
Registered: October 2015
Junior Member
Hi Dan, I've had another look at the PPPBOOT/PPPWROS issue today. I started with a new 2GB SD card (DOS partition on it) and put $20 into location $53. Much to my surprise PPPBOOT.S19 wrote the boot loader to the first sector on the disk, though at the moment I don't know why. The last line of PPPBOOT.S19 has a load address of $0300 and the following hex:
20E9FF JSR $FFE9 (PPP_SOFT_RESET)
A900 LDA #0
8551 STA $51
8552 STA $52
8557 STA $57
20DAFF JSR $FFDA (PPP_WRITE_SECTOR)
00 BRK
$FFDA in R52PPP.BIN has 4CBFF1 JMP $F1BF

At $F1CC A553 LDA $53 NOT $57 so I don't know why it wrote to the boot sector.

PPPWROS performed exactly as predicted, I found the last sector of DOS/65 was written to the SD card at address $4000 ($20x$200 i.e. contents of location $53 times 512 bytes per sector). It had of course written all of DOS/65 to that single sector because it increments location $57 instead of $53 to go to the next sector.

A possible reason why you did not observe this problem is that you used an SD card that already contained DOS/65. Provided the contents of location $53 is more than $12, that last sector of DOS/65 (that starts at $2600 on the card) would either be written in the right place if $53 was $13 or somewhere after that if $53 was >$13. Provided there is nothing vital on the SD card from $2800 to $20000 (512 bytes after $FF times 512) you would not know there was a problem. When I looked on my now working SD card I found a copy of the last sector of DOS/65 at location $19800, which means I must have run the faulty PPPWROS at some stage with $CC in location $53.
Cheers, Ian.
Re: DOS/65 by Richard Leary [message #10203 is a reply to message #10202] Thu, 19 January 2023 05:29 Go to previous messageGo to next message
danwerner is currently offline  danwerner
Messages: 50
Registered: October 2015
Member
That is entirely possible . . . I will be starting from zero in this instance since I do not want to corrupt my running system, so hopefully it will show up in testing with new media. I will likely also do the conversion to my new toolchain at this time as well.

I did download the files from the Wiki and will be doing a compare of the BIN and S19 files to the ones on my server just to ensure that the ones on the Wiki are the same ones I am running locally.

Dan
Re: DOS/65 by Richard Leary [message #10252 is a reply to message #10203] Sat, 18 February 2023 11:46 Go to previous messageGo to next message
danwerner is currently offline  danwerner
Messages: 50
Registered: October 2015
Member
There has been some progress on this . . .

The new 6x0x DOS/65 distribution is here:

https://github.com/danwerner21/6x0x-DOS65

There is still plenty to do, and I still need to update the WIKI page -- but I wanted to get the link to the repo out.


** Please note that this version of DOS/65 uses the ROMWBW track/sector mapping and is thus not compatible with disk images created with the old distribution. Please backup your data prior to installing this version.

Dan Werner
Re: DOS/65 by Richard Leary [message #10253 is a reply to message #10252] Sun, 19 February 2023 04:54 Go to previous messageGo to next message
plasmo is currently offline  plasmo
Messages: 916
Registered: March 2017
Location: New Mexico, USA
Senior Member
I've ported DOS/65 to CRC65. Here is the description.
https://www.retrobrewcomputers.org/doku.php?id=builderpages: plasmo:crc65:dos65:dos65home
Bill
Re: DOS/65 by Richard Leary [message #10255 is a reply to message #9444] Mon, 20 February 2023 15:00 Go to previous message
floobydust is currently offline  floobydust
Messages: 9
Registered: September 2020
Location: Boynton Beach, FL
Junior Member
Hi Bill,

I have your port running on my CRC65 as well. I've run it with both a compact flash card and am currently running it on the original IBM 340MB Microdrive. I did try using an older Hitachi 20GB Travelstar DK14FA-20, but it wouldn't boot.... probably due to the time for the drive to come ready after a reset signal.

Early on with V3, I found a drive related bug in PEM... if you do a DIR to a drive that doesn't exist, PEM will loop endlessly on an INVALID DRIVE error. I fixed that in PEM by defaulting to the A drive and sent the fix to Richard long ago... but it never got into the official source.

Some recent stuff I found includes an occasional crash when existing from some applications. COPY203 can do that as can others. I added a short routine to the warm boot code to zero out the free area in page zero that applications can use. This seems to fix these odd crash issues. Granted, I've not made any changes to the port you did for the CRC65, but I've found the same on my C02 Pocket as the CRC65... so nothing more than a FYI.

I'm hoping to finish up Version 3.20 soon... now at Beta 2 level. All modules use CMOS instructions and addressing modes. All disk accesses are now done with records only (no track sector translation in PEM or SIM). The code is both smaller and a bit faster as well. Hoping to have it completed soon...


Previous Topic: Design help
Next Topic: Any i860 fans here?


Current Time: Sat Mar 15 19:41:38 PDT 2025

Total time taken to generate the page: 0.00670 seconds