RE: Moving BAM to a different track

From: Baltissen, GJPAA (Ruud) <ruud.baltissen_at_apg.nl>
Date: Thu, 30 Nov 2017 12:59:27 +0000
Message-ID: <54F350D2C6501448A3EE14B7854C5FB566986B3D@WSV10441N3.office01.internalcorp.net>
Hallo Michał,


The location of the track of the directory sector and the interleave between two sectors is hard coded. But that can be changed. During developing my 1541IDE project, a 1541 drive with an IDE HDD instead of a floppy, I developed my D16 image. This is a drive with 256 sectors end 255 tracks. These two numbers enabled me to keep using the link notation used by Commodore as on the other drives. 
Why only 254 tracks? Track 0 zero cannot be used _as number_ because it marks the end of a link. But I found out that I can use it to hold the BAM. Like with the other drives I can calculate which sector is needed. Then I load (or write) this sector directly from track 0. No track lost then.  The track I cannot use so far is track 255. If I use it, the Commodore part returns with an error. And I haven't found out yet why. And not having found another use like the BAM table for it, it is lost for the moment.

My directory starts on (18,0) like on a D64. But it contains not much more than what (38,0) of a 8x50 does. It then does point to (18,1), just like it does on a D64. And that's it! These two sectors are created and reserved in the BAM during the format process. Any other needed directory sector is created and reserved when needed. So it is possible that (18,1) could point to (123,89) and that one on its turn to (1,1). The moment an extra directory sector is needed, the number of free blocks decreases with one. 

I first tested the concept on D64 and it was realized by removing the limit to create a directory on track 18, skipping track 18 when looking for a free sector or calculating the number of free sectors and changing some BAM related routines.


> Yes, I am aware that if you were to place hundreds of files on the disk, the growing directory could overwrite these BAM sectors.

Eh, why? If things are hard coded then it should be possible to code that the BAM sectors should be avoided?


Met vriendelijke groet / With kind regards, Ruud Baltissen

www.Baltissen.org






-----Oorspronkelijk bericht-----
Van: owner-cbm-hackers@musoftware.de [mailto:owner-cbm-hackers@musoftware.de] Namens Michal Pleban
Verzonden: donderdag 30 november 2017 11:30
Aan: cbm-hackers@musoftware.de
Onderwerp: Moving BAM to a different track

Hello

Is it possible to move the BAM to a different place on the disk (I am speaking specifically about 8050 and 8250 drives)? Looking at the disk structure, it has first directory sector at 39,0, which then points to
38,0 (first sector of BAM), chained through 38,3, 38,6, 38,9 up to 38,1 (second directory sector). So the question is, does the drive actually follow this chain (which would mean the BAM sectors could be placed
anywhere) or is their location hardcoded in the drive DOS and this chain is just a leftover?

The rationale: my PC IMG to D80/D82 conversion tool reserves tracks 38 and 39 which contain the BAM and directory. The idea is that the user can do DIRECTORY from Commodore BASIC and, more importantly, the PC emulation layer files can be placed there.

But there are only 25 free sectors on track 38 in 8250 image, and the software already uses 22 of them, leaving only 3 sectors free for the software to grow. But if I moved the BAM to track 39 [*], I could gain additional 4 sectors.

Regards,
Michau

[*] Yes, I am aware that if you were to place hundreds of files on the disk, the growing directory could overwrite these BAM sectors.

       Message was sent through the cbm-hackers mailing list

De informatie in dit e-mailbericht is vertrouwelijk en uitsluitend bestemd voor de 
geadresseerde. Wanneer u dit bericht per abuis ontvangt, verzoeken wij u contact op te 
nemen met de afzender per kerende e-mail. Verder verzoeken wij u in dat geval dit 
e-mailbericht te vernietigen en de inhoud ervan aan niemand openbaar te maken. 
Wij aanvaarden geen aansprakelijkheid voor onjuiste, onvolledige dan wel ontijdige 
overbrenging van de inhoud van een verzonden e-mailbericht, noch voor daarbij 
overgebrachte virussen.

APG Groep N.V. is gevestigd te Heerlen en is ingeschreven in het 
handelsregister van de Kamer van Koophandel Limburg onder nummer 14099617


The information contained in this e-mail is confidential and may be privileged. 
It may be read, copied and used only by the intended recipient. 
If you have received it in error, please contact the sender immediately by 
return e-mail; please delete in this case the e-mail and do not disclose its 
contents to any person. We don't accept liability for any errors, omissions, 
delays of receipt or viruses in the contents of this message which arise as a 
result of e-mail transmission.

APG Groep N.V. is registered in the trade register of the Chamber 
of Commerce Limburg, The Netherlands, registration number: 14099617
1ë,j°jËžÛa®‹ †Ø^q¹¡iɮɚŠX§‚X¬
Received on 2017-11-30 14:00:03

Archive generated by hypermail 2.2.0.