Jump to content
IGNORED

CPM/Z-80 card for the 1090XL -- Calling anyone with Z-80 experience!


Recommended Posts

Posted (edited)
13 minutes ago, reifsnyderb said:

I noticed the C version is humongous and experience tells me it's a library being a hog.  Given that an import utility wouldn't be used too often, I figured being able to develop it at a higher speed, by using C, was a reasonable tradeoff.

Yes. There's no problem in using C for embedded devices (which is basically what a 6502 amounts to), but avoid the standard library as much as possible. toupper() is mostly fine, printf is not :)

 

13 minutes ago, reifsnyderb said:

Makes sense.  I've noticed the write.com file I compiled changes the selected disk from B back to A, when done.

The z88dk cpm target probably calls warmboot at exit. That should be up to the user IMHO. AFAICT ack doesn't do that, unless you specifically end your program with cpm_exit();

 

13 minutes ago, reifsnyderb said:

I mainly set up the z88dk environment as I didn't realize ack was used.

Sorry. I should have been clearer on that.

 

13 minutes ago, reifsnyderb said:

I'll check out the dos2dir and dos2copy next.

Thanks!

I tested them under emulation, but there might be bugs ofcourse :)

 

I'm also curious if sysgen works on real hardware, i.e. you can create a new bootable disk on another drive after booting from drive A.

Edited by ivop
Link to comment
Share on other sites

@ivop:

 

I just found the dos2dir.com and dos2copy.com you posted.  I'll be testing them soon.

 

sysgen will be tested soon as well.

 

After that, I'll need stat, asm, load, pip, ed, and submit.  I think that we'll have the base utilities taken care of to permit others to use the card.  I think it makes sense to track down a copy of wordstar and try that as well.

 

Once I get the basics working, I am going to release my sources and we'll see where this goes.

 

 

  • Like 2
Link to comment
Share on other sites

1 minute ago, reifsnyderb said:

After that, I'll need stat, asm, load, pip, ed, and submit.  I think that we'll have the base utilities taken care of to permit others to use the card.  I think it makes sense to track down a copy of wordstar and try that as well.

 

The standard official files are here: http://www.viara.eu/museum/cpm/cpm2-plm.zip

 

Or you can try the freshly cross-compiled binaries from here: https://github.com/ivop/cpm22-from-source/ (see Releases on the right side), or even compile them yourself :)

 

I got WS 3.3 from here: https://winworldpc.com/download/0bcb8604-c290-c398-c2b3-11c3a5c28f13

This was the last one that ran on an i8080. As you card has a Z80, it can run WS4, too. For both you'll need a terminal emulator though. WS3 can be patched with the WINSTALL utility. ADM-3A is probably the easiest terminal to implement and is supported by a boatload of old CP/M programs as it was more or less a standard. VT52 needs entering hex values, but can be made to work, too.

 

1 minute ago, reifsnyderb said:

Once I get the basics working, I am going to release my sources and we'll see where this goes.

Great work! Looking forward to that.

 

  • Thanks 1
Link to comment
Share on other sites

Posted (edited)

Well.....dos2copy.com doesn't work.  It runs.  I can't give any more info as it fails without an error message.    😞

 

I tried to copy from c to a.  After the last question of "Are you sure?"  I entered "Y" and it just exited back to the command prompt.  No attempt to read anything.  Nothing.

<sigh>

 

Edited by reifsnyderb
Link to comment
Share on other sites

Posted (edited)
8 minutes ago, reifsnyderb said:

Well.....dos2copy.com doesn't work.  It runs.  I can't give any more info as it fails without an error message.    😞

Does dos2dir work?

 

Where does dos2copy fail? After you said Y to "ARE YOU SURE?" or earlier/later? What arguments do you provide (drives, filespec, etc)? Does it print the first file it is supposed to be copying? Does it read anything at all? Does it start writing or fails before that?

Lots of questions ;)

Edited by ivop
Link to comment
Share on other sites

Posted (edited)
18 minutes ago, reifsnyderb said:

I tried to copy from c to a.  After the last question of "Are you sure?"  I entered "Y" and it just exited back to the command prompt.  No attempt to read anything.  Nothing.

<sigh>

If you look at the relevant code, it should always read at least one sector (the first Atari DOS directory sector). If no file matches your file specification, and the directory ends in the first directory sector (less than 8 files on DOS 2 disk), it'll stop after that and return to the A> prompt. Could it be that the file(s) you specified are wrong? Can you tell exactly what answers you gave to the questions and the console output? Can you also perhaps try copying from B: to A:, as that mimics my test environment even though it should work with C:, too.

 

Edited by ivop
Link to comment
Share on other sites

1 hour ago, ivop said:

Does dos2dir work?

 

Where does dos2copy fail? After you said Y to "ARE YOU SURE?" or earlier/later? What arguments do you provide (drives, filespec, etc)? Does it print the first file it is supposed to be copying? Does it read anything at all? Does it start writing or fails before that?

Lots of questions ;)

I didn't try dos2dir yet.  Right now, it's not easy to get one file into a CP/M atr image.  I was hoping to copy the dos2dir file next then try it.

 

I answered all the questions and it was the last question in the list.  (Line 234 in the source code.)

 

It doesn't even start to read.  No beeps at all.

Link to comment
Share on other sites

1 hour ago, ivop said:

If you look at the relevant code, it should always read at least one sector (the first Atari DOS directory sector). If no file matches your file specification, and the directory ends in the first directory sector (less than 8 files on DOS 2 disk), it'll stop after that and return to the A> prompt. Could it be that the file(s) you specified are wrong? Can you tell exactly what answers you gave to the questions and the console output? Can you also perhaps try copying from B: to A:, as that mimics my test environment even though it should work with C:, too.

 

Are the file names case sensitive?

 

Link to comment
Share on other sites

Posted (edited)
31 minutes ago, reifsnyderb said:

I didn't try dos2dir yet.  Right now, it's not easy to get one file into a CP/M atr image.  I was hoping to copy the dos2dir file next then try it.

You are on Linux, right? Assuming you are on Debian or derivative (Ubuntu, Linux Mint), have you tried apt install cpmtools ? That's how I copy files to and from CP/M images all the time and prepend the ATR header to mount them in an emulator.

 

31 minutes ago, reifsnyderb said:

I answered all the questions and it was the last question in the list.  (Line 234 in the source code.)

It doesn't even start to read.  No beeps at all.

That's really strange, because after the conin() it should print ABORTED if you don't type y or Y, and then it goes into a for loop, looping over all the directory sectors, which does a cpm_read (BIOS call), which if it returns 1, prints another error, and exits. If no error, it goes on to handle the read sector (handle_dir()) but up to this point it should have read one sector, but apparently it doesn't.

 

To rule out copy problems, I attached an atari1090ed CP/M disk with both files already in them. Note that this is a CP/M disk, so boot from A, dos2tools.atr as drive B:, and check B:dos2dir (select drive C) with your DOS 2.x disk in drive C.

 

30 minutes ago, reifsnyderb said:

Are the file names case sensitive?

No, nothing is. Drive letters and file names are all converted to uppercase before processing occurs. You can specify "foo.bar", but also "*.*" to copy everything all at once.

 

Here's how I created dos2tools.atr with cpmtools:

 

dd if=/dev/zero of=cpmfs.img bs=128 count=1040
mkfs.cpm -f atari1090ed cpmfs.img
cpmcp -f atari1090ed cpmfs.img dos2dir.com dos2copy.com 0:
cpmls -f atari1090ed cpmfs.img
cat atrheader.dat cpmfs.img > dos2tools.atr

 

With the following diskdefs file:

diskdef atari1090ed
    seclen 128
    tracks 40
    sectrk 26
    blocksize 1024
    maxdir 64
    boottrk 3
    os 2.2
end

 

atrheader.dat is just the first 16 bytes of an ED atr file.

dd if=someEDatrfile.atr of=atrheader bs=1 count=16

dos2tools.atr

Edited by ivop
  • Like 4
Link to comment
Share on other sites

Posted (edited)

@ivop

 

I hadn't installed cpmtools as I figured I'd only need it once.  I was using a script and utility to add the files to a cp/m disk image.  It was working.

 

Your dos2tools.atr image worked.  I've now got the following utilities loaded onto a cp/m boot disk image:

 

dump.com

ed.com

ddt.com

load.com

dos2copy.com

dos2dir.com

mac.com

atsysgen.com

 

While I am not a CP/M guru by a long shot, they appears to have copied correctly and appear to be working.

 

I am thinking the next step is to put this on a real floppy disk. 

Having a valid format command is necessary as well.  I am thinking it makes sense to make that a BIOS call.

 

 

Edit:

To save space in the BIOS, I am contemplating allowing bit 7, of the drive number, to be set to indicate the next write is a format command with the directory

to be filled by whatever is loaded in the sector buffer.  (Ideally $E5)

 

 

 

Edited by reifsnyderb
  • Like 3
Link to comment
Share on other sites

Posted (edited)
1 hour ago, reifsnyderb said:

Your dos2tools.atr image worked.

Good to hear! I was really scratching my head as to why it didn't work at first.

 

1 hour ago, reifsnyderb said:

I've now got the following utilities loaded onto a cp/m boot disk image:

 

dump.com

ed.com

ddt.com

load.com

dos2copy.com

dos2dir.com

mac.com

atsysgen.com

I'd rename atsysgen.com to just sysgen.com and do away with the old Atari naming of things. In fact, it is plain sysgen from DRI, with only the number of reserved tracks increased to 3 and the sectran table changed to a 1-1 mapping with sectors counting from 0 to 25 instead of the default 1-26 for MDS-800 systems.

 

1 hour ago, reifsnyderb said:

While I am not a CP/M guru by a long shot, they appears to have copied correctly and appear to be working.

Have you tested sysgen yet? You can just run it on an empty ATR disk in drive B,C, or D. After that you should be able to boot from that new disk.

 

1 hour ago, reifsnyderb said:

To save space in the BIOS, I am contemplating allowing bit 7, of the drive number, to be set to indicate the next write is a format command with the directory

to be filled by whatever is loaded in the sector buffer.  (Ideally $E5)

Yes, I figure you could take a shortcut to format a new disk by (ab)using the write sector command. You'd have to change seldsk slightly to accept drive numbers with the top bit set, but only your format program would know about that. Other programs, like CCP will never try to set anything other than A-P (0-15), so seldsk can still return an error if it is not in the 0-3 (and 128-131) range. After seldsk(128+drivenumber), the next write sector is the format command. When finished, set the drivenumber without the top bit set and fill the reserved tracks with E5h. There's no need to fill the directory, but the boot block has to be filled by either all E5h or the boot code (run sysgen). Otherwise a DIR command on the newly formatted disk won't work correctly. Yeah, it's weird that the directory itself doesn't have to be filled with E5h. You could make filling optional by asking the user first, in case the user plans to run sysgen anyway, as to save time by not needlessly filling 78 sectors that will be overwritten again anyway.

 

Edited by ivop
  • Like 1
Link to comment
Share on other sites

4 minutes ago, ivop said:

I'd rename atsysgen.com to just sysgen.com and do away with the old Atari naming of things. In fact, it is plain sysgen from DRI, with only the number of reserved tracks increased to 3 and the sectran table changed to a 1-1 mapping with sectors counting from 0 to 25 instead of the default 1-26 for MDS-800 systems.

 

Have you tested sysgen yet? You can just run it on an empty ATR disk in drive B,C, or D. After that you should be able to boot from that new disk.

 

Yes, I figure you could take a shortcut to format a new disk by (ab)using the write sector command. You'd have to change seldsk slightly to accept drive numbers with the top bit set, but only your format program would know about that. Other programs, like CCP will never try to set anything other than A-P (0-15), so seldsk can still return an error if it is not in the 0-3 (and 128-131) range. After seldsk(128+drivenumber), the next write sector is the format command. When finished, set the drivenumber without the top bit set and fill the reserved tracks with E5h. There's no need to fill the directory, but the boot block has to be filled by either all E5h or the boot code (run sysgen). Otherwise a DIR command on the newly formatted disk won't work correctly. Yeah, it's weird that the directory itself doesn't have to be filled with E5h. You could make filling optional by asking the user first, in case the user plans to run sysgen anyway, as to save time by not needlessly filling 78 sectors that will be overwritten again anyway.

 

I'll rename atsysgen to sysgen....that makes perfect sense.

 

I have tested sysgen.  It booted but the directory was corrupted.  I resolved any directory corruption issues by just filling a blank directory with $e5.  I think that, really, only the first directory entry byte needs to be $e5, though.

 

I just changed the seldsk to accept the special drive numbers and the atariio code to check for and handle the special drive numbers.  Since only format will ever use the special drive numbers, it should work fine.

 

Right now, I have the drive numbers set to use only A to D.

 

 

 

 

 

 

 

Link to comment
Share on other sites

3 minutes ago, reifsnyderb said:

I have tested sysgen.  It booted but the directory was corrupted.  I resolved any directory corruption issues by just filling a blank directory with $e5.  I think that, really, only the first directory entry byte needs to be $e5, though.

Seems I remembered it wrong then :) and you do need to put something in the directory sector. Makes sense. But it's not sysgen that should do that, but your format utility. Perhaps you can even skip filling the bootsectors entirely and only set the first directory sector to $e5 after the format command finishes. That would be much faster. If you need any help with the format program, let me know.

Link to comment
Share on other sites

Posted (edited)

your stream of consciousness is correct in a way as I feel the same about filling the sectors, it may have had something to do with a particular drive, controller, or cp/m machine combination. It's gnawing away at me as we type. There has to be something about it out there. So long as the project works, such things can be looked into later.

@foft, @reifsnyderb

8-inch CP/M floppies came formatted with a filler of E5h. Digital Research formatting tools did this. The value also found its way to Atari ST and Amstrad/Schneider formatted FATs as a result. Some utilities simply put E5h as the first entry in the directory when deleting a file. If I recall any of this correctly

Edited by _The Doctor__
Link to comment
Share on other sites

looks like it says the same for the most part.

-The first byte in a directory entry simply states whether the entry is used or not (if it holds E5h, it's empty). This is actually how the ERA (file delete) command works: it looks up which directory entry matches the filename it should delete, then places the value E5h in the first byte of that directory entry.-

Link to comment
Share on other sites

4 hours ago, reifsnyderb said:

 

cpmand80colcards.thumb.jpg.9ad0b6d325081ac239e6c1113a258e44.jpg

Are my eyes deceiving me, perhaps an optical illusion. But that CPM card looks huge, and greatly unpopulated. Was there a reason for this, because it sure looks like it could be condensed down to a third of its present size. This would also impact the PCB manufacture cost and perhaps the shipping as well.

Link to comment
Share on other sites

1 minute ago, mytek said:

Are my eyes deceiving me, perhaps an optical illusion. But that CPM card looks huge, and greatly unpopulated. Was there a reason for this, because it sure looks like it could be condensed down to a third of its present size. This would also impact the PCB manufacture cost and perhaps the shipping as well.

The picture is a little deceiving.  But it is pretty big.  It's the size of an Atari 1090XL card as per Atari's spec.  The manufacturing cost increase isn't bad as it's a 2 layer board.  It's an extra $4 or so....if memory serves.  I may have been able to make the board around 2/3 of it's current size.  But it still would be over 100mm on a side so I'd still have that pesky engineering fee.

 

Since there were so many through-hole components, I decided to make the board look almost like something from 1984.  It even has the part number and logo on it.   🙂

 

  • Like 4
Link to comment
Share on other sites

Posted (edited)

About card sizes....

 

Here's a better picture of 5 different cards. 

On the top row, from left to right, is the 80 column card, the 320k card, and the cx-85 numeric keypad card.

On the bottom row, from left to right, is the z-80 card (with 64k of RAM) and the 64k/256k replica.  (The replica is an almost exact replica of the Atari card.)

 

5cards.thumb.jpg.bd361f626391e44b284b34fb6e396f6c.jpg

 

Here's the two memory cards.  The replica is on the bottom and the 320k card is laying on top.

 

z80and80columncard.thumb.jpg.cd93225fa67b164975870642db68f5dd.jpg

 

For the sake of comparison, here's an Apple II 16k card on top of the 64k replica card.

 

atariandapplecards.thumb.jpg.67d586f1040acd53c635164df5322332.jpg

 

 

 

Here's the 320k card on top of the 64k/256k replica card...

 

 

memory card sizes.jpg

 

 

Here's the Apple II 16k card above the 64k/256k replica card.

 

atari and apple cards 2.jpg

Edited by reifsnyderb
  • Like 3
Link to comment
Share on other sites

This is an out of left field idea, but could a Z80 conversion be made for the original 800 by replacing the CPU card with a Z80 based CPU card and replacing the "personality' board with ROMs for the CP/M bios, etc.  The CPU card could contain a CRT controller for an 80 column video output instead of the Antic and GTIA chips.

 

This is just a weird idea that popped into my head while pondering how the 400/800 were developed using  Cromemco machines due to their modularity.  I can't see a real reason to do this.

Link to comment
Share on other sites

Posted (edited)

CP/M machines also had graphics cards in the mix as well, no reason not to leverage the graphics chips at the same time. Why, because they are there and it could be fun. Real world use, old software or none, since it's all ancient like us!

Edited by _The Doctor__
Link to comment
Share on other sites

Posted (edited)
8 minutes ago, Geister said:

This is an out of left field idea, but could a Z80 conversion be made for the original 800 by replacing the CPU card with a Z80 based CPU card and replacing the "personality' board with ROMs for the CP/M bios, etc.  The CPU card could contain a CRT controller for an 80 column video output instead of the Antic and GTIA chips.

 

This is just a weird idea that popped into my head while pondering how the 400/800 were developed using  Cromemco machines due to their modularity.  I can't see a real reason to do this.

Without doing too much research on this, I think it would be possible with some slight modification.  The immediate issue I see is that the 6502 starts with the vector at $FFFC and the 800 used a select line system to select 8k memory regions.  The Personality card doesn't have the correct select lines and the Z-80 starts running at $0000.  So, the ROMs would not be addressable.  That being said, the RAM slots really don't have to have RAM chips installed.  So, a ROM could be installed in RAM slot 0.  I'd have to do more research on the video side of things.  Some other considerations would have to be made due to the I/O region.  I'd guess it would take a couple hours of research and careful consideration to fully answer your question, though.

Edited by reifsnyderb
Link to comment
Share on other sites

  • 2 weeks later...
Posted (edited)

Source Code Dump:

 

Atari boot sector and I/O code:

Note:  May have some disabled test code.

 

atariio.asm

 

CP/M BIOS:

Note:  May have some disabled test code.

 

CBIOS.asm

 

Format

C code that has yet to be compiled and tested.  Best to consider to be pseudo-code.

 

format.c

 

 

 

 

CP/M Boot Disk:

Note:  Contains boot loader code, CCP, BDOS, and BIOS.  Requires 1090XL CP/M card.

 

cpm.atr

 

CP/M Utilities Disk:

Note:  Accessible with CP/M only.  Requires 1090XL CP/M Card.

 

cpm_utils.atr

 

 

 

 

Edited by reifsnyderb
  • Like 2
  • Thanks 6
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...