With ToolKit 2 and some other utilities it is possible to read from and write to selected parts of a floppy disk. Based on that I wrote 3 short programs in SuperBasic:
1 – RELABEL
This lets you rename the disk if you want to ( or name it in case you formatted it without naming it).
2 – NOTRANDOM
This allows you to put a specific i.d. number on the disk instead of the one assigned at random by QDOS. QDOS uses this to see if the disk has been changed, so use different numbers for different disks.
3 – HEADROOM
QDOS reserved 20 bytes in the disk header for some as yet unknown (to me) purpose. All the disks I’ve looked at have this filled with 255, but if you can find a use for the space, it is there to be used. If you are aware of a use of this space, or any reason we should keep out of it, please let me know!
All of these programs read from the disk header on side 0, track 0, sector 1. They display the current contents, and default to make no changes. To make a change, just follow the prompts.
Practice first on some ‘scratch’ disks and make a backup of disks [BEFORE] you use these routines on them, just in case. After all we are messing around with the disk’s HEAD(er).
RELABEL
100 REMark relabel
110 TK2_EXT
120 REMark in case you want to change Formatted Name of disk
130 OPEN #3,'flp1_*d2d'
140 GET #3 \ 1, a$
150 CLOSE #3
160 CLS
170 label$=a$( 5 TO 14)
180 PRINT label$
185 PRINT \\" # ","CHR$", "dec","HEX"\\
190 FOR i = 1 TO 10
200 PRINT " ";i," ";label$(i)," ";CODE(label$(i)),HEX$(CODE(label$(i)),8)
210 END FOR i
220 DIM relabel$(10)
230 CLS#0
240 PRINT #0,"touch ENTER to keep present name"
245 PRINT \\
250 INPUT"Change name to ? (up to 10 chr$)"\relabel$
260 IF relabel$="" THEN relabel$=label$
270 CLS #0
280 PRINT relabel$
290 a$(5 TO 14)=relabel$
300 OPEN #3,'flp1_*d2d'
310 PUT #3 \ 1, a$
320 CLOSE #3
NOTRANDOM
100 REMark notrandom
110 TK2_EXT
120 REMark uses 'random' disk header bytes
130 WTV
140 CLS
150 OPEN #3,'flp1_*d2d'
160 GET #3 \ 1, a$
170 CLOSE #3
180 CLS
190 PRINT a$(1 TO 16)\\"CHR$","LSB","MSB","HEX$","decimal"\\
200 DIM random$(2)
210 random$=a$( 15 TO 16)
220 PRINT random$,CODE (random$(1)),CODE(random$(2)),
230 diskid = 256*CODE(random$(2))+CODE(random$(1))
240 PRINT HEX$(diskid,16),
250 PRINT diskid
260 CLS#0 :PRINT #0,"ENTER to keep default value of ";diskid
270 REPeat diskidtag
280 PRINT \"You may wish to assign a unique identification number to this disk"\"try not to use any identification number more than once"\\
290 INPUT"Positive Decimal Integer for this disk ( 1 to 65535 ) ? ";notrnd$
300 IF notrnd$="" THEN notrnd = diskid :EXIT diskidtag
310 notrnd = INT(notrnd$)
320 IF notrnd >0 AND notrnd < 65536 : EXIT diskidtag
330 END REPeat diskidtag
340 PRINT\\ notrnd
350 PRINT #0,notrnd$
360 high = INT(notrnd/256)
370 PRINT "high=";high,
380 low = notrnd-256*high
390 PRINT "low=";low,
400 a$(15 TO 16) = CHR$(low)&CHR$(high)
410 PRINT\ a$(15 TO 16)
420 PRINT\\ a$(1 TO 16)
430 OPEN #3,'flp1_*d2d'
440 PUT #3 \ 1, a$
450 CLOSE #3
460 PRINT\ 256*CODE(a$(16))+CODE(a$(15))
470 CLS#0
HEADROOM
100 REMark headroom
105 TK2_EXT
110 REMark uses 'spare' disk header bytes
120 OPEN #3,'flp1_*d2d'
130 GET #3 \ 1, a$
140 CLOSE #3
150 spare$=a$( 77 TO 96)
160 PRINT spare$
180 FOR i = 1 TO 20
190 PRINT spare$(i),CODE(spare$(i))
200 END FOR i
210 DIM insert$(20)
220 INPUT"Your.message.here...(up to 20 chr$)"\insert$
230 PRINT insert$
240 a$(77 TO 96)=insert$
250 IF insert$="" THEN a$(77 TO 96)=spare$
260 OPEN #3,'flp1_*d2d'
270 PUT #3 \ 1, a$
280 CLOSE #3
290 DIR
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.