DiskToUSB error (paging jgharston)

discussion of beeb/electron applications, languages, utils and educational s/w
User avatar
lurkio
Posts: 1285
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

DiskToUSB error (paging jgharston)

Postby lurkio » Sat Nov 04, 2017 8:28 pm

Am having a bit of trouble with DiskToUSB, trying to image a 3.5-inch 80-track ADFS floppy to a USB stick inserted into a DataCentre connected to a Master 128:

    FullSizeRender.jpg
    Screenshot of DiskToUSB error

Any idea what's going wrong?

:?:

User avatar
jgharston
Posts: 2756
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield

Re: DiskToUSB error (paging jgharston)

Postby jgharston » Sat Nov 04, 2017 11:44 pm

lurkio wrote:Am having a bit of trouble with DiskToUSB, trying to image a 3.5-inch 80-track ADFS floppy to a USB stick inserted into a DataCentre connected to a Master 128:

Odd. Try changing line 100 to:
100 max%=(HIMEM-LOMEM-2048)DIV256:oldfs%=FNfs

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

User avatar
lurkio
Posts: 1285
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: DiskToUSB error (paging jgharston)

Postby lurkio » Sun Nov 05, 2017 12:30 am

jgharston wrote:Try changing line 100 to:
100 max%=(HIMEM-LOMEM-2048)DIV256:oldfs%=FNfs

Thanks. That seemed to get the program going, although I did get that error again on the first attempt:

    FullSizeRender.jpg

Then there were a few error 48's:

    FullSizeRender-2.jpg

And then a load of error 50's:

    FullSizeRender-3.jpg

At which point the program seemed to get stuck in a loop, endlessly reading "0:0009FF+01", so I pressed Ctrl-Break, only to find that there was no sign of STAR3.ADL (complete or partial) on the USB stick!

The disc is copy-protected (the accompanying manual says so), but DiskToUSB can't seem to save even a partial image..?

:?:

User avatar
jgharston
Posts: 2756
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield

Re: DiskToUSB error (paging jgharston)

Postby jgharston » Sun Nov 05, 2017 1:28 pm

lurkio wrote:At which point the program seemed to get stuck in a loop, endlessly reading "0:0009FF+01",
That's the very last sector of the disk. Have you tried specifying a smaller disk size? Do *MAP and use as the disk size the start sector of the last free space entry.

lurkio wrote:so I pressed Ctrl-Break, only to find that there was no sign of STAR3.ADL (complete or partial) on the USB stick!
Why didn't you press Escape and give the program the chance to close the file and tidy up?

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

User avatar
lurkio
Posts: 1285
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: DiskToUSB error (paging jgharston)

Postby lurkio » Sun Nov 05, 2017 2:07 pm

jgharston wrote:
lurkio wrote:At which point the program seemed to get stuck in a loop, endlessly reading "0:0009FF+01",
That's the very last sector of the disk. Have you tried specifying a smaller disk size? Do *MAP and use as the disk size the start sector of the last free space entry.

I'll try that next.


jgharston wrote:
lurkio wrote:so I pressed Ctrl-Break, only to find that there was no sign of STAR3.ADL (complete or partial) on the USB stick!
Why didn't you press Escape and give the program the chance to close the file and tidy up?

I did try pressing Escape, but nothing happened -- the program just kept on going. Maybe I have to wait a while after I hit Escape?

:?:

UPDATE: I just tried DiskToUSB on a floppy that I formatted myself and then saved a small test program onto. It worked without any errors at all (but first I amended line 100 as above).

I'll now try the copy-protected disc again.

UPDATE 2: I've set it going on the copy-protected disc:

    FullSizeRender.jpg
:idea:

User avatar
lurkio
Posts: 1285
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: DiskToUSB error (paging jgharston)

Postby lurkio » Sun Nov 05, 2017 4:09 pm

This time, the program just got hung up reading 90C instead of 9FF!:

    FullSizeRender-2.jpg

So I pressed Escape. It didn't have any effect till I waited for a Read (or possibly a Write!) instead of a Write (or was it a Read?). On pressing Escape on a Read (or Write), I got this:

    FullSizeRender-3.jpg

And it just hung there, the DataCentre flashing away, for nearly an hour! So I killed it. No sign of STARCH.ADL.

:?:
Last edited by lurkio on Mon Nov 06, 2017 1:23 am, edited 1 time in total.

User avatar
jgharston
Posts: 2756
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield

Re: DiskToUSB error (paging jgharston)

Postby jgharston » Sun Nov 05, 2017 9:32 pm

I've done an update to DiskToUSB. It adds extra flushes to the USB system and backs down from disk errors more pragmatically, and only increases the buffer size after a good disk read.(*)

The problem with testing it when imaging dodgy ADFS disks - as you'll have found out - is that it takes aaaaages as ADFS retries and retries and retries before getting back to the user and letting them do something. I counted it trying 16 times before it returns and lets the program react.

On my system if it is stuck at the Escape message you can press Break and the image file is created. You can stop it at almost any time by pressing Escape when there aren't any disk errors, but when ADFS is stuck in a retry loop you have to keep pressing Escape in the hope you'll get in when interupts are briefly turned on. I'm thinking about adding some background machine code to break put of a long retry loop.

(*)When reading, initially it reads as much data as will fit in memory. If a disk error occurs it divides by four the amount of data to try to read, until it is successful or it gets down to only one sector. After that it only reads as much data as was successfully read last time, increasing the amount each time the read was successful.

So, you might get: read &50, read &50, attempt &50, attempt &14, read &05, read &0A, read &14, attempt &50, read &14, etc.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

User avatar
jgharston
Posts: 2756
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield

Re: DiskToUSB error (paging jgharston)

Postby jgharston » Sun Nov 05, 2017 9:34 pm

lurkio wrote:I'll now try the copy-protected disc again.
UPDATE 2: I've set it going on the copy-protected disc:
Image
In that image, 90D is the length of the last free space entry. You want the start of the last free space entry, which is F3.

Edit: ggrrrrr how do I specify the size to display an image to prevent it being huuuge?

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

User avatar
lurkio
Posts: 1285
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: DiskToUSB error (paging jgharston)

Postby lurkio » Sun Nov 05, 2017 10:14 pm

jgharston wrote:In that image, 90D is the length of the last free space entry. You want the start of the last free space entry, which is F3.

Yes. My mistake.

Thanks for the updated DiskToUSB. I've just set it going on the copy-protected disc, inputting F3 at the "Total disk sectors" prompt.

:idea:

User avatar
lurkio
Posts: 1285
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: DiskToUSB error (paging jgharston)

Postby lurkio » Sun Nov 05, 2017 10:31 pm

It finished! Here are the two screenshots I took:

    FullSizeRender.jpg
    FullSizeRender-2.jpg

The program finished shortly after the second screenshot was taken -- but I forgot to take a photo at the end because I was too eager to check out the result! Which is here:

    STARCH.ADL.zip
    .ADL ADFS disc-image (broken) of Star Chaser (eduware)
    (14.65 KiB) Downloaded 9 times

As you'll see, if you try the disc-image in BeebEm, it doesn't work! That may be because the copy-protection (wonky formatting) of the disc is too cunning to be cracked as easily as just by running it through DiskToUSB -- but I thought we'd at least get valid data in the files! Apparently not.

I do remember I made an earlier attempt at cracking this particular disc, manually, where I got a bit further -- but not much. The disc does actually boot and run during normal use, by the way. (I think I might have been running it on a Master Compact, because that's what the manual says it's for.)

:idea:

UPDATE: With the physical disc and my M128, I can do this:

    FullSizeRender-3.jpg
But even that seems to be impossible using the .ADL disc-image I attached above.

:?:

User avatar
jgharston
Posts: 2756
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield

Re: DiskToUSB error (paging jgharston)

Postby jgharston » Mon Nov 06, 2017 12:00 am

lurkio wrote:UPDATE: With the physical disc and my M128, I can do this:
    FullSizeRender-3.jpg
But even that seems to be impossible using the .ADL disc-image I attached above.

Can you do a *EX of that disk so we can see where the files are?

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

User avatar
lurkio
Posts: 1285
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: DiskToUSB error (paging jgharston)

Postby lurkio » Mon Nov 06, 2017 1:13 am

jgharston wrote:Can you do a *EX of that disk so we can see where the files are?

image.jpeg

User avatar
lurkio
Posts: 1285
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: DiskToUSB error (paging jgharston)

Postby lurkio » Tue Nov 07, 2017 6:40 pm

Here's the (partial) output of *VERIFY:

    image.jpeg
The *VERIFY process really slowed down after about track 50 -- every track was chewed over and spat out, with a grinding noise.

:?:

User avatar
jgharston
Posts: 2756
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield

Re: DiskToUSB error (paging jgharston)

Postby jgharston » Tue Nov 07, 2017 10:42 pm

Ta, I'll have a look at what you managed to get into the image when I've worken up a bit.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

User avatar
billcarr2005
Posts: 1098
Joined: Fri Sep 09, 2005 3:01 pm
Location: UK
Contact:

Re: DiskToUSB error (paging jgharston)

Postby billcarr2005 » Wed Nov 08, 2017 12:49 am

So far as I can tell...

!BOOT is at offset &700 of the file STARCH.ADL
Amen is at offset &2000
Acha at &3600
Aim1 at &5300 (screen)
Aim2 at &A300 (screen)
MENU is just filled with "G"

When *DUMPing Amen, the resulting data is from offset &4000 of the file STARCH.ADL... :?:

Both Amen and Acha are encrypted BASIC programs which decrypt and then load &400 bytes at memory location &900 using the following control blocks

Amen

Code: Select all

00 00 09 00 00 08 00 02 80 00 00 00 04 00 00


Acha

Code: Select all

00 00 09 00 00 08 00 02 84 00 00 00 04 00 00


(I presume) this attempts to read data from track 50 / offset 50000 onwards (as that's the area it loaded on BeebEM's MasterWelcome.ADL that i tested it on) - the "problem" area and without this code, the programs don't really function!
Are standard sectors on ADFS disks &200 bytes in length? It would appear that the imaged disk has only &100 bytes per sector...
If it's possible to load and save the code for both Amen and Acha using the original disk and the control blocks above, then it can simply be loaded directly instead of via OSWORD &72! :)
The result byte also needs to be noted, since this is used too...

EDIT: I had uploaded a SSD of the recovered files, but since they are useless without the additional code, i removed it. :roll:

User avatar
lurkio
Posts: 1285
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: DiskToUSB error (paging jgharston)

Postby lurkio » Wed Nov 08, 2017 12:25 pm

billcarr2005 wrote:So far as I can tell...

!BOOT is at offset &700 of the file STARCH.ADL
Amen is at offset &2000
Acha at &3600
Aim1 at &5300 (screen)
Aim2 at &A300 (screen)
MENU is just filled with "G"

When *DUMPing Amen, the resulting data is from offset &4000 of the file STARCH.ADL... :?:

A weird, clever method of copy-protection? Or corruption while imaging the disc? Or..?

billcarr2005 wrote:Both Amen and Acha are encrypted BASIC programs which decrypt and then load &400 bytes at memory location &900 using the following control blocks

Amen

Code: Select all

00 00 09 00 00 08 00 02 80 00 00 00 04 00 00

Acha

Code: Select all

00 00 09 00 00 08 00 02 84 00 00 00 04 00 00

(I presume) this attempts to read data from track 50 / offset 50000 onwards ... the "problem" area and without this code, the programs don't really function! Are standard sectors on ADFS disks &200 bytes in length?

Dunno!

billcarr2005 wrote:It would appear that the imaged disk has only &100 bytes per sector... If it's possible to load and save the code for both Amen and Acha using the original disk and the control blocks above, then it can simply be loaded directly instead of via OSWORD &72! :) The result byte also needs to be noted, since this is used too...

Thanks. Here's my attempt at doing that:

I saved the data read in by my programs $.AMEN and $.ACHA as $.D1 and $.D2 respectively. The result byte (which I'm presuming is the first byte in the control block) was zero in both cases.

:idea:

User avatar
billcarr2005
Posts: 1098
Joined: Fri Sep 09, 2005 3:01 pm
Location: UK
Contact:

Re: DiskToUSB error (paging jgharston)

Postby billcarr2005 » Wed Nov 08, 2017 2:06 pm

lurkio wrote:A weird, clever method of copy-protection? Or corruption while imaging the disc? Or..?


Wouldn't be corruption, i don't think, since all the data is there and readable.
Could have something to do with the emulation of the size of the sectors, at a complete guess, since I'm not used to ADFS...
The page you linked to, http://beebwiki.mdfs.net/OSWORD_%2672#Specification, says sectors are only 256 bytes, so it could be down to the number of sectors per track?

lurkio wrote:Thanks. Here's my attempt at doing that:

    STAR72.SSD.zip
I saved the data read in by my programs $.AMEN and $.ACHA as $.D1 and $.D2 respectively. The result byte (which I'm presuming is the first byte in the control block) was zero in both cases.

:idea:


I renamed D1 to Amen0 and D2 to Acha0.
I also had to add LOAD as a BASIC file after the !BOOT because otherwise my Watford DFS was crashing with Channel error.
Everything seems to work OK now :)
Attachments
Star Chaser.zip
Star Chaser De-ADFSed / DFSified
(11.88 KiB) Downloaded 8 times

User avatar
lurkio
Posts: 1285
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: DiskToUSB error (paging jgharston)

Postby lurkio » Wed Nov 08, 2017 7:12 pm

billcarr2005 wrote:Everything seems to work OK now :)

Great! Thanks.

=D> =D>

User avatar
lurkio
Posts: 1285
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: DiskToUSB error (paging jgharston)

Postby lurkio » Wed Nov 08, 2017 8:19 pm

[Deleted]
Last edited by lurkio on Fri Nov 10, 2017 11:32 am, edited 2 times in total.



Return to “software: other”

Who is online

Users browsing this forum: Bing [Bot] and 2 guests