{"id":2201,"date":"2018-07-07T23:13:18","date_gmt":"2018-07-07T23:13:18","guid":{"rendered":"http:\/\/www.sydneysmith.com\/wordpress\/?p=2201"},"modified":"2018-07-07T23:15:21","modified_gmt":"2018-07-07T23:15:21","slug":"cdos-ver-0-20-on-8-inch-disks","status":"publish","type":"post","link":"https:\/\/www.sydneysmith.com\/wordpress\/2201\/cdos-ver-0-20-on-8-inch-disks\/","title":{"rendered":"CDOS Ver 0.20 on 8 inch disks"},"content":{"rendered":"<p><img loading=\"lazy\" src=\"http:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2018\/07\/cdos0020-8inch.png\" alt=\"\" width=\"512\" height=\"512\" class=\"alignnone size-full wp-image-2202\" srcset=\"https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2018\/07\/cdos0020-8inch.png 512w, https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2018\/07\/cdos0020-8inch-150x150.png 150w, https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2018\/07\/cdos0020-8inch-300x300.png 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/p>\n<p>CDOS Ver 0.20 is available on the internet for systems with small (5&#8243;) floppy disks. However, 5&#8243; systems are painfully small. STAT.COM will tell you a 5&#8243; disk holds 83KB but that includes 2KB of directory entries, I have always thought of them as 81KB disks.<\/p>\n<p>There&#8217;s not a lot you can fit in 81KB so I&#8217;d standardized on 8&#8243; single-sided, single-density disks for everything &#8211; other than CDOS Ver 0.20. 8SSSD was the universally agreed format for interchangeability between CP\/M systems at the time so it&#8217;s a good one to pick for emulators of computers of that time.<\/p>\n<p>CDOS came on 8&#8243; disks or 5&#8243; disks. Later versions included CDOSGEN.COM which allowed you to reconfigure the operating system to work with different amounts of installed memory and different drive configurations. My guess is, Ver 0.20 preceded CDOSGEN. There doesn&#8217;t seem to be a way to reconfigure what you have for different systems. However, &#8230;<!--more--><\/p>\n<p>If you use DEBUG.COM (the Cromemco CDOS version of CP\/M&#8217;s DDT.COM or ZSID.COM) to explore what CDOS ver 0.20 is doing during disk accesses, you&#8217;ll eventually find mention of FFF8. The sequence looks like:<br \/>\n<code><\/p>\n<pre>\r\nCROMEMCO CDOS version 00.20\r\n\r\nA.debug\r\nDEBUG version 00.20\r\n-l0\r\n0000  JP   FC00\r\n...\r\n-lfc00\r\nFC00  JP   F1EE\r\nFC03  JP   FC51\r\nFC06  JP   FC59\r\nFC09  JP   FC6E\r\nFC0C  JP   FCA1\r\nFC0F  JP   FCC1\r\nFC12  JP   FCCC\r\nFC15  JP   FCD5\r\nFC18  JP   FCF1\r\nFC1B  JP   FCF6\r\nFC1E  JP   FCFB\r\nFC21  JP   FD00\r\nFC24  JP   FD05\r\nFC27  JP   FD39 ; goes to ...\r\nFC2A  JP   F1EE\r\nFC2D  JP   FCB9\r\n-lfd39\r\nFD39  CALL FD78\r\nFD3C  RET  NZ\r\nFD3D  CALL FDE8 ; goes to ...\r\nFD40  ...\r\n-lfde8\r\nFDE8  LD   A,80\r\nFDEA  CALL FDF4 ; goes to ...\r\nFDED  ...\r\n-lfdf4\r\nFDF4  LD   C,A      ; C=80 for autowait, else 00\r\nFDF5  LD   A,(FE69)\r\nFDF8  LD   B,A      ; A=0-3 for Drive A-D\r\nFDF9  INC  B\r\nFDFA  SUB  A,A    ;\\\r\nFDFB  SCF         ; \\\r\nFDFC  RLA         ;  \\\r\nFDFD  DJNZ FDFC   ;   \\ set drive bit B=1-4 => 0001, 0010, 0100, 1000\r\nFDFF  LD   B,A\r\nFE00  CALL FE0B\r\nFE03  LD   A,(HL) ; get drive params 1\r\nFE04  AND  A,10   ; set maxi bit if 8\"\r\nFE06  OR   A,20   ; motor on\r\nFE08  OR   A,B    ; add in drive\r\nFE09  OR   A,C    ; add in autowait\r\nFE0A  RET\r\n;\r\nFE0B  LD   A,(FE69) ; drive 0-3 for A-D\r\nFE0E  ADD  A,A      ; *=2\r\nFE0F  LD   HL,FFF8  ; looks like FFF8 is drive size table\r\nFE12  ADD  A,L\r\nFE13  LD   L,A\r\nFE14  RET  NC\r\nFE15  INC  H\r\nFE16  RET\r\n;\r\n-dmfff8s8\r\nFFF8   28 09 28 00  28 00 28 00   (.(.(.(.\r\n-\r\n<\/pre>\n<p><\/code><br \/>\nCDOS is getting a byte from a table at FFF8H and using bit 4 of that (FE04: AND A,10) to turn on the floppy disk controller&#8217;s MAXI bit (8&#8243; disk instead of 5&#8243; disk).<\/p>\n<p>It should be more complicated than this; but it doesn&#8217;t seem to be.<\/p>\n<p>Normally, we then go through all the trouble of noting that 5&#8243; drives have 40 tracks and 18 sectors per track and a skew table of &#8230; but 8&#8243; ones have &#8230;. However, it looks like CDOS handles all of that from this single bit. I know that&#8217;s how it is supposed to work in an ideal world; but it is rare to see that in the real world.<\/p>\n<p>FFF8 is pretty high in memory so there&#8217;s a chance this gets initialized by some startup code. However, after looking, it&#8217;s just loaded from disk during bootup. Here&#8217;s how it looks:<br \/>\n<code><\/p>\n<pre>\r\n-g0\r\n\r\nA.wrtsys a:sysarea.sys=a:\r\nWRTSYS version 00.09\r\nSystem written and verified\r\nA.dump sysarea.sys\r\nDUMP version 00.05\r\n\r\n        RECORD:  0\r\n0000 3E 01 D3 40 3E 21 D3 34-21 00 EA 11 02 2C 3E 0F  >.S@>!S4!.j..,>.\r\n0010 D3 30 DB 34 1F 30 FB DB-30 E6 98 20 E3 7B D3 32  S0[4.0{[0f. c{S2\r\n0020 01 33 80 3E A1 D3 34 3E-88 D3 30 DB 34 1F 38 0A  .3.>!S4>.S0[4.8.\r\n0030 ED A2 C2 AB 00 DB 34 1F-30 FB DB 30 E6 9C 20 C0  m\"B+.[4.0{[0f. @\r\n0040 15 CA 09 EA 1C 7B FE 13-38 D3 1E 01 3E 5F 18 C0  .J.j.{~.8S..>_.@\r\n0050 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  ................\r\n0060 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  ................\r\n0070 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  ................\r\n\r\n...\r\n        RECORD:  44\r\n1600 1B 19 5E C9 01 07 0D 13-19 05 0B 11 17 03 09 0F  ..^I............\r\n1610 15 02 08 0E 14 1A 06 0C-12 18 04 0A 10 16 01 06  ................\r\n1620 0B 10 03 08 0D 12 05 0A-0F 02 07 0C 11 04 09 0E  ................\r\n1630 CD 22 FE CD 06 FC FE 03-CA 00 FC E6 5F FE 52 28  M\"~M.|~.J.|f_~R(\r\n1640 03 3E 01 C9 2A 84 FE E5-CD D5 FC E1 22 84 FE A7  .>.I*.~eMU|a\".~'\r\n1650 20 DE C9 00 00 09 AD 66-C0 80 88 AD 66 C0 C0 BD   ^I...-f@..-f@@=\r\n1660 AD 66 00 CD F1 66 CD 7F-67 C3 F9 66 CD 7A 67 C3  -f.MqfM.gCyfMzgC\r\n1670 F9 66 C9 FD 7E 00 E6 38-28 00 28 00 28 00 28 00  yfI}~.f8(.(.(.(.\r\n\r\n...\r\nA.\r\n<\/pre>\n<p><\/code><br \/>\nYou can see the boot sector, and then the 4 entries of &#8220;28 00&#8221; at the end of &#8220;RECORD 44&#8221;.<\/p>\n<h2>Making changes<\/h2>\n<p>It shouldn&#8217;t be this easy but it is.<\/p>\n<p>You need to change those four 28H bytes to 38H for a four by 8&#8243; drive system.<\/p>\n<p>Alright, it does need to be bootable too, so you do need to modify the boot sector to also work with an 8&#8243; drive. This involves:<\/p>\n<ul>\n<li>There are two &#8220;OUT (34),A&#8221; instructions in the boot sector that need the MAXI bit turned on in the &#8220;LD A,&#8230;&#8221; instruction that precedes them, and<\/li>\n<li>A &#8220;LD A,E; CP 13H; JR C,&#8230;&#8221; sequence that checks for &lt;=18 sectors per track needs to be changed to &#8220;CP 1BH&#8221; for &lt;=26 sectors per track.<br \/>\n<h2>Download a copy<\/h2>\n<p>I&#8217;ve changed the four bytes and updated the boot sector for you. You can download a fully functional 8&#8243; CDOS Ver 0.20 system from <a href=\"http:\/\/www.sydneysmith.com\/products\/cpm\/z80sim\/run-cdos0020-2.zip\">run-cdos0020-2.zip<\/a>.<\/p>\n<p>You can use INIT.COM to create disks in drives B, C and\/or D. You can use STAT.COM to check disk sizes. Everything seems to work as an 8&#8243; system.<\/p>\n<h2>Conclusions<\/h2>\n<p>My guess is Cromemco wanted to make it easy for themselves to reconfigure. It&#8217;s nice that we can too.<\/p>\n<p>There are other bits in the &#8220;28H&#8221; byte. They probably serve some purpose but I haven&#8217;t found out what yet. They might control seek speeds or other aspects of the drive. Leaving them alone worked fine in my case.<\/p>\n<p>It is likely that the second byte (after the 28H &#8211; or 38H on 8&#8243; systems) stores the current track number for each drive.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CDOS Ver 0.20 is available on the internet for systems with small (5&#8243;) floppy disks. However, 5&#8243; systems are painfully small. STAT.COM will tell you a 5&#8243; disk holds 83KB but that includes 2KB of directory entries, I have always thought of them as 81KB disks. There&#8217;s not a lot you can fit in 81KB &hellip; <a href=\"https:\/\/www.sydneysmith.com\/wordpress\/2201\/cdos-ver-0-20-on-8-inch-disks\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">CDOS Ver 0.20 on 8 inch disks<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,59],"tags":[],"_links":{"self":[{"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/2201"}],"collection":[{"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/comments?post=2201"}],"version-history":[{"count":3,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/2201\/revisions"}],"predecessor-version":[{"id":2205,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/2201\/revisions\/2205"}],"wp:attachment":[{"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/media?parent=2201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/categories?post=2201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/tags?post=2201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}