DOS nightmares

A place to discuss everything Dragon related that doesn't fall into the other categories.
Julian
Posts: 51
Joined: Mon Nov 21, 2011 1:06 pm

DOS nightmares

Post by Julian »

After my previous request for help on finding the right tools I am now happily building and compiling code outside of a Dragon environment, I'm also sort of happily compiling it inside of a Dragon environment too but it is driving me nuts and the stability of the emulator snapshots seems a little questionable so I keep losing work. The big problem is getting externally compiled code onto a dragon disk, I've read all sorts of solutions but so far I've yet to actually get anything to work.

A few years ago I briefly played around with T3 and had a modicum of success in loading cassette images and the like but realistically that is the sum total of my positive experience with these emulators.

As I understand it the dragondos format is not supported in MESS so I'm having a real fun (not) time trying to get any disk images to work there.
In XROAR I can use disk images I've downloaded but any attempt to write to them ends in misery, but then again so does loading from them.

In order to use Rainbow built code I need a method for adding the binary output to a dragondos formatted disk image and from what I've seen no such tool exists (I find his hard to believe given the enthusiasm I've seen so far) so I've resigned myself to putting such a tool together, hoping to keep to the same commandline switches as provided by imgtool in order to maintain compatibility with Rainbow but some tweaks to trick it into doing what I want.

The stumbling block is finding some definitions of what constitutes a dragondos formatted image. As I understand it the images are basically raw binary blocks taken in track, side, sector order but that doesn't explain the content of the blocks. I can take a stab at the content as it can't be that different from other formats but that doesn't tell me what the directory/addressing blocks contain. Does anyone know where this information is located?

I am aware of the helpful file info at http://www.grempc.demon.co.uk/dragon/info/drgndos.txt and I'm hoping it is all I need but is that it?
Julian
Posts: 51
Joined: Mon Nov 21, 2011 1:06 pm

Re: DOS nightmares

Post by Julian »

To sort of answer my own question I did just find some relevant code here http://www.grempc.demon.co.uk/dragon/pc/ but only for reading and extracting from disks, not adding to them...
User avatar
rolfmichelsen
Posts: 299
Joined: Wed Apr 08, 2009 8:43 pm
Location: Oslo, Norway
Contact:

Re: DOS nightmares

Post by rolfmichelsen »

This is exactly the problem that I try to address with the Dragon Toolkit, announced in this post viewtopic.php?f=5&t=530

The released version doesn't expose all the functionality that you need, but a new and updated release is imminent. In the meantime, I should be able to provide a simple tool for writing files to a virtual DragonDos disk image. What is it exactly that you need? The ability to save binary files as machine code programs on a DragonDos diskette, or anything more?

-- Rolf
User avatar
robcfg
Posts: 1533
Joined: Sat Apr 04, 2009 10:16 pm
Location: Stockholm, Sweden
Contact:

Re: DOS nightmares

Post by robcfg »

Hey Rolf!

I was playing with my .VDK file reader and managed to decode the directory info, but it would be nice to have a tool that can extract and insert files on a disk image. I might need such a tool in a not so distant future ;)

By the way, could anybody provide a formula to convert a track and sector number to LSN and viceversa?
Last edited by robcfg on Tue Dec 06, 2011 9:47 pm, edited 1 time in total.
User avatar
rolfmichelsen
Posts: 299
Joined: Wed Apr 08, 2009 8:43 pm
Location: Oslo, Norway
Contact:

Re: DOS nightmares

Post by rolfmichelsen »

robcfg wrote:By the way, could anybody provide a formula to convert a track and sector number to LSN and viceversa?
I believe this one is accurate:

LSN = track * HEADS * SECTORS + head * SECTORS + sector

Where track, head and sector is the location you want to convert. All variables are zero-based. HEADS (usually 1) is the total number of disk heads, and SECTORS (usually 18) is the number of sectors per track and per head.

-- Rolf
User avatar
robcfg
Posts: 1533
Joined: Sat Apr 04, 2009 10:16 pm
Location: Stockholm, Sweden
Contact:

Re: DOS nightmares

Post by robcfg »

Thanks a bunch!

Seems to work pretty well!

Now I have to take a look at how to convert the LSN to sector, track and head values for extracting files. Just as an exercise.

And it's also useful for forging your own disks to get the most of it ;)
User avatar
rolfmichelsen
Posts: 299
Joined: Wed Apr 08, 2009 8:43 pm
Location: Oslo, Norway
Contact:

Re: DOS nightmares

Post by rolfmichelsen »

track = lsn / (SECTORS * HEADS)
head = lsn % (SECTORS *HEADS) / SECTORS
sector = lsn % (SECTOR * HEADS) % SECTORS

...or something very similar to that...

-- Rolf
Julian
Posts: 51
Joined: Mon Nov 21, 2011 1:06 pm

Re: DOS nightmares

Post by Julian »

I was going to look at that formula last night to make sense of it - quite glad someone has done the work for me :) Instead I had to reattach a radiator to a wall and find a wiring fault on my car, not exactly the most enjoyable of pass times...

All I was aiming to achieve was a replacement for the MESS imgtool that is referenced in Rainbow IDE so it could be substituted using the same command-line parameters, just a matter of convenience so that the job of building the disks is done for me. The primary task is adding files to a disk.

The alternative is putting an OS9 based setup together and using the built-in support in imgtool and MESS but honestly, right now I'd rather use XROAR.

With any luck I'll be getting my real hardware back in the next few weeks so I can test the coding for real but that presents its own problems - like sourcing a dos cartridge and more annoyingly suitable drives (as I binned my last pair just a couple of months back on the basis that I would probably never, ever use them)
User avatar
robcfg
Posts: 1533
Joined: Sat Apr 04, 2009 10:16 pm
Location: Stockholm, Sweden
Contact:

Re: DOS nightmares

Post by robcfg »

I've tested the formulas and they seem to work ok.

I also managed to extract a file from a .vdk image :D

Now, I'll try to inject a file. The weird thing here, is that I'm having a lot of fun :mrgreen:

[EDIT] I forgot to ask... Does DragonDOS report the size of the files as 1 byte greater than it should?
User avatar
rolfmichelsen
Posts: 299
Joined: Wed Apr 08, 2009 8:43 pm
Location: Oslo, Norway
Contact:

Re: DOS nightmares

Post by rolfmichelsen »

robcfg wrote:I forgot to ask... Does DragonDOS report the size of the files as 1 byte greater than it should?
Which reporting are you asking about?

-- Rolf
Post Reply