Wednesday, 21 March 2018

how to make a C64 CP/M or DOS/65 disk without using the CP/M cartridge and utility from CP/M simply using BASIC v2.

how to make a C64 CP/M or DOS/65 disk without using the CP/M cartridge and utility from CP/M simply using BASIC v2. may be usefull for DOS/65 user since DOS/65 doesn't come with a format utility.

code:
0 open 15,8,15
1 print "initializing..."
2 print#15,"i:"
3 print "cbm formating..."
4 print#15,"n:dos/65,65"
5 close 15
10 open 15,8,15:open 5,8,5,"#"
11 for d = 0 to 255
12 print#5,chr$(229);
13 next d
14 print "writing cp/m or dos/65 dir..."
15 for b = 0 to 3
16 print#15,"u2:"5;0;3;b
17 next b
18 close 5:close 15
19 print "allocating blocks..."
20 open 15,8,15
21 for t=1 to 17:for b= 0 to 20
22 print#15,"b-a:"0;t;b
23 next b:next t
24 for t=19 to 24:for b= 0 to 18
25 print#15,"b-a:"0;t;b
26 next b:next t
27 for t=25 to 30:for b= 0 to 17
28 print#15,"b-a:"0;t;b
29 next b:next t
30 for t=31 to 35:for b= 0 to 16
31 print#15,"b-a:"0;t;b
32 next b:next t
33 close 15

2 comments:

  1. Nice! Thanks.

    Being able to send data raw like that to the drives sure makes a lot of things possible, even if it's not easy.

    ReplyDelete
  2. Christopher Gaul well a 1541 CP/M disk isn't much complicated it is just a logical layer on top of the CBM DOS format, the First 2 tracks are system reserved area, the directory start a track 3 and logical block are 1K so 4 cbm blocks, you just need to write a 1K empty directory structure starting at track 3 block 0 then allocate all the blocks to prevent data overwrite on the cbm side, of course as cbm B-W is obviously bugged we use U2 command instead for writing the empty directory structure.

    ReplyDelete