6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri May 10, 2024 1:48 pm

All times are UTC




Post new topic Reply to topic  [ 36 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Thu Jun 08, 2023 9:39 pm 
Offline

Joined: Fri Dec 21, 2018 1:05 am
Posts: 1076
Location: Albuquerque NM USA
cjs wrote:
BigDumbDinosaur wrote:
No confusion here—I had some experience with CP/M in the 1970s. We considered the BIOS integral to CP/M because the latter could not run without the former.

Well, in that case the separate "BIOS" you're proposing for DOS/65 will be just as integral to DOS/65, since DOS/65 will not be able to run without it.

Regardless, CP/M did have the exact split between machine-independent code and machine-dependent code that you are proposing for DOS/65: that was a key feature of its design, and a major part of the reason for its popularity.

CRC65 only has 64 bytes of ROM located inside CPLD, just enough to either serially load program via a simple serial port in the CPLD or bootstrap from CF disk, so there are no ROM-based BIOS to be called by SIM. Yes, I do have a monitor loadable into memory from CF and I suppose the various monitor routines can be called by SIM. However, only very few monitor routines are reused by DOS/65, so it is simpler and easier and smaller code to just integrate the few routines into SIM.

For debugging purpose I do load the monitor into RAM just below DOS/65 but that monitor is not needed to boot DOS/65. At reset CRC65 loads CCM/PEM/SIM (CP/M equivalent of CCP/BDOS/BIOS) into RAM and jumps into SIM's cold boot routine to start DOS/65. So I don't need the overhead of a monitor just to reuse a few of its routines for SIM.
Bill


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 09, 2023 1:32 am 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1373
Hi Bill,

I've been looking more closely at your code, the SIM module specifically. There's a few things here that might be the cause, coupled with whatever your coldstart process for the CRC65.

One of the things that was part of the SYSGEN was to zero out the page zero space before creating the new image. Note that the "switch" routine in PEM swaps some key bytes between the page zero locations and it's own internal variables. There's a good chance that this is causing the problem with an invalid drive from the alloc program. If the page zero space is not cleared, there could be an invalid value there which gets swapped in.

Note that on my systems coldstart process, I clear ALL of page zero before initializing any of the hardware. I also clear the unallocated page zero space from a warm boot in SIM. This ensures you don't have some garbage out there which can cause some odd issues.

Based on the above, I would suggest (as a test) that you clear out page zero on a SIM cold start and then clear out the rest of page zero that's NOT used by your hardware and DOS/65 for a warm start. This might clear up some issues.

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 09, 2023 2:26 am 
Offline

Joined: Fri Dec 21, 2018 1:05 am
Posts: 1076
Location: Albuquerque NM USA
The alloc problem is because of page zero usage, but not because ZP not initialized in SIM cold boot. The ALLOC208.ASM has a variable "pzstrt" that was originally set to $2 so its zero page variables starts from $2 and I believe it is conflicting with DOS/65 ZP usage. To test that theory, I did not change my DOS/65 but changed ALLOC208.ASM so pzstrt is set to $10. Now ALLOC is working correctly. The lesson-learned is ZP usage of DOS/65 utility programs must not conflict with ZP usage of DOS/65.

Thanks for taking the time to look over my SIM code. It is a good idea to clear ZP variables used by DOS/65. I'll update my SIM accordingly.

Bill


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 09, 2023 4:22 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8178
Location: Midwestern USA
cjs wrote:
BigDumbDinosaur wrote:
Leary had the foresight to make the SIM the point of demarcation between the PEM (the analog of CP/M’s BDOS) and the machine-specific malarkey, since he was banking on the fact that all of the 6502 machines of the time (early 1980s) had built-in functions for read/writing mass storage and working with a keyboard and display. The SIM was never intended to be the analog of a true BIOS...only an interface to the target machine’s BIOS (hence the ‘I’ in SIM).

I don't actually see the difference here. If the SIM is a firm interface, how would the PEM know if the SIM is calling a "BIOS" or the SIM itself is doing all the work? The PEM should neither know nor care.

As written, DOS/65’s SIM was expected to use the host machine’s BIOS, not replace it. So, yes, there is a difference, although not one the PEM would know about. The SIM is actually quite simple...just some calls to read/write the disk and read/write the console.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 09, 2023 4:23 am 
Offline

Joined: Fri Dec 21, 2018 1:05 am
Posts: 1076
Location: Albuquerque NM USA
okwatts wrote:
Hi Bill and floobydust I have downloaded and tried this version of Bill's on the CRC65. Without having any real answers I have a few observations.
1) when programs end with a warm boot the system always reverts to drive A even if you have been working on another drive. I presume this is somehow related to what floobydust mentioned about the default drive parameter in his new PEM.
2) Basic (Microsoft version) can save programs but if you try and load them the system hangs. Not sure what has changed from version 3.
3) I haven't tried to recompile DBASIC (ehbasic) for the new TEA so I can't comment on save and load on that.

okwatts,
The reason for warm boot reverting to drive A is because I write 0x0 to iostat in my warm boot routine. That was a leftover from troubleshooting a problem and I forgot to remove it. Search for the word ";diagnostic" and you'll find 5 consecutive instructions in wboot routine. These instructions can (should be) be removed.

I, too, find BASIC unable to load file--it hangs just as you've said. This is different than rev 3.0 DOS/65. It appears able to save file with the command, SAVE "FILENAME.BAS". I'll check into possible zero page conflict.

Attached is DBASIC (EhBASIC) with TEA changed to 0x400. Instruction for installing it in DOS/65:
1. At DOS/65 prompt, type "go $b400" to run CRC65 monitor.
2. In CRC65 monitor environment, send DBASIC.HEX to CRC65
3. At CRC Monitor prompt, type "gdc00" to boot DOS/65
4. At DOS/65 prompt, type "save 44 dbasic.com" to install DBASIC.

In DBASIC you can load FILENAME.BAS with "LOAD A:FILENAME" and you can save FILENAME.BAS with "SAVE A:FILENAME". FILENAME.BAS is a binary file, not human readable.
Bill


Attachments:
dbasic_tea400.zip [174.19 KiB]
Downloaded 43 times
Top
 Profile  
Reply with quote  
PostPosted: Fri Jun 09, 2023 2:09 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1373
plasmo wrote:
The alloc problem is because of page zero usage, but not because ZP not initialized in SIM cold boot. The ALLOC208.ASM has a variable "pzstrt" that was originally set to $2 so its zero page variables starts from $2 and I believe it is conflicting with DOS/65 ZP usage. To test that theory, I did not change my DOS/65 but changed ALLOC208.ASM so pzstrt is set to $10. Now ALLOC is working correctly. The lesson-learned is ZP usage of DOS/65 utility programs must not conflict with ZP usage of DOS/65.

Thanks for taking the time to look over my SIM code. It is a good idea to clear ZP variables used by DOS/65. I'll update my SIM accordingly.

Bill


Yes, a page zero overlap will certainly mess things up. I didn't specifically look at the alloc program source. For my systems, I allocate page zero space from the top ($FF) to the bottom ($00). My current system allocates the top 48 bytes for BIOS use, followed by the next 48 bytes for Monitor use. Right below that is DOS/65. As a result, page zero space from $00 - $97 is free for applications. Note the Basic Compiler, Run time and Assembler use a fair amount of page zero space.

I have noticed that most of the 2.1 utilities source code started their page zero use at $02. The logical conclusion for that was due to the MOS6510 CPU having a built-in port at the bottom of zero page.

Anyway, glad you found that and hopefully version 3.20 is working better.

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 36 posts ]  Go to page Previous  1, 2, 3

All times are UTC


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: