View Single Post
Old 22nd Oct 2019, 8:24 pm   #1
NealCrook
Tetrode
 
Join Date: May 2019
Location: Reading, Berkshire, UK.
Posts: 51
Default Creating new NASCOM PolyDos magnetic media

cosmocat wrote:

I was mulling the possibility of writing a program on the Nascom to read the disk image (in sections) over the serial port (from a PC) then using low level NASDOS routines to write the disk tracks so that when the PolyDos boot rom was installed the files would appear correctly. I was unsure if this approach would work though.
I think I may instead look at your SDcard adaptor as you suggest.

This is definitely do-able. Here are some suggestions. First, NAS-DOS uses 16 sectors per track while PolyDos uses 18. So, you don't really want to use a NAS-DOS formatted disk (you could get it to work.. the geometry is abstracted in the ROM. BUT then you would have to use NAS-DOS for all your formatting, rather than the PolyDos format program),

Step 1, create a PolyDos3 format disk.

grab https://github.com/nealcrook/nascom/...iles/FORMAT.GO and transfer it (somehow!!) to your NASCOM. You can store it on a NAS-DOS disk. Load it to memory at $1000 but before executing it patch location $1104 from 18 07 to DF 5B. This will return to NAS-SYS after doing the formatting step. Usually the program would create a directory entry and verify the disk, but that will only work on a booted PolyDos system, whereas the formatting part does not have that requirement.

Execute the patched program at $1000 and it should guide you through the formatting of a disk.

Step 2. Use NAS-DOS to copy the PolyDos3 image to the newly-formatted disk

polydos_vfs reports that the PolyDos3 disk image only has $de sectors assigned used.
Each track of the disk image is 18 * 256 = 4608 bytes (4,5k) and $de sectors is just less than 13 tracks-worth. Break the image into chunks of 4608 bytes (eg, use "split" from unix)

write an assembler program for the nascom that takes 2 arguments and executes this algorithm:

writetrack(addr, track)
for sector = 0 to 15
call nas_dos_sector_write(sector, track, addr)
addr = addr + 256
next sector


now, transfer the first 13 chunks of the PolyDos3 disk to a NAS-DOS disk and then write protect it!! Load them into memory one by one, swap disks to the PolyDos disk and run the program with the correct arguments to write a tracks-worth of data

Note1: you could used bigger chunks than 4.5K but this keeps the program simple
Note2: use the NAS-DOS write-sector call; don't be tempted to try to use the write-track call because that will not work at all (it will overwrite the formatting).
Note3: NAS-DOS doesn't care that you're trying to write to a sector number that is not "legal" for a NAS-DOS disk

Step 3: make a ram-resident "boot rom"

Assemble the PolyDos3 boot ROM with a start address of $B800 (PolyDos uses workspace at $C000). Put the executable onto a NAS-DOS disk

Step 4: ready to go!

Load the PolyDos $B800 image into RAM and execute at $B800. It should prompt for a boot disk, Insert your carefully prepared disk and away you go.

I'll be really excited to hear if this works!

Long-term tho you might prefer my solid-state solution (especially as I'm working on making it work with NAS-DOS as well). If you do like magnetic disks, you still might like my solid-state solution as a mechanism for creating new disks: I wrote a program that I called "scrape" to copy all the sectors from a floppy onto a SDcard file, and it would be simple to do the reverse: a program that takes a disk image on SDcard and writes it to a floppy.

If you're comfortable with a bit of soldering and you'd like a PCB for the sdcard, PM me your address.

Neal.
NealCrook is offline