{"id":1687,"date":"2017-11-09T03:59:37","date_gmt":"2017-11-09T03:59:37","guid":{"rendered":"http:\/\/www.sydneysmith.com\/wordpress\/?p=1687"},"modified":"2018-11-10T01:07:33","modified_gmt":"2018-11-10T01:07:33","slug":"cpmfs-version-0-03-released","status":"publish","type":"post","link":"https:\/\/www.sydneysmith.com\/wordpress\/1687\/cpmfs-version-0-03-released\/","title":{"rendered":"cpmfs version 0.03 released"},"content":{"rendered":"<p><a href=\"http:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2017\/11\/cpmfs-dir.png\"><img loading=\"lazy\" src=\"http:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2017\/11\/cpmfs-dir-300x152.png\" alt=\"\" width=\"300\" height=\"152\" class=\"alignnone size-medium wp-image-1688\" srcset=\"https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2017\/11\/cpmfs-dir-300x152.png 300w, https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2017\/11\/cpmfs-dir-672x343.png 672w, https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2017\/11\/cpmfs-dir.png 677w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>cpmfs is a tool for copying files in and out of CP\/M disk images.<\/p>\n<p>It allows you to copy any files you like from Windows onto a &#8220;disk&#8221; for an emulator or simulator. This also means you can copy files off old diskimage files and put them, in whatever combination you need, on new blank &#8220;disks&#8221;.<\/p>\n<p>Version 0.03 supports a lot more disk formats. The list (from the program) is:<!--more--><\/p>\n<p><code><\/p>\n<pre>\r\nC:>cpmfs types\r\n\r\nCP\/M File System Utility Ver 0.03\r\nCopyright 2017 Greg Sydney-Smith\r\n\r\nSupported imagefile types are:\r\n\r\nType       : Description\r\n---------------------------------------------------------------\r\n8SSSD      : 77Tk 1Hd 26sec128 skew06 1K  64Dir1\r\n8DSSD      : 77Tk 2Hd 26sec128 skew06 1K  64Dir1\r\n8SSDD      : 77Tk 1Hd 16sec512 skew11 2K 128Dir1 (SD T0H0)\r\n8SSDD2     : 77Tk 1Hd 16sec512 skew11 2K 128Dir2 (SD T0H0)\r\n8DSDD      : 77Tk 2Hd 16sec512 skew04 2K 256Dir2 (SD T0H0)\r\n5SSSD      : 40Tk 1Hd 18sec128 skew05 1K  64Dir1\r\n5DSDD      : 40Tk 2Hd 10sec512 skew04 2K 128Dir1 (SD T0H0)\r\n8          : 77Tk 1Hd 26sec128 skew06 1K  64Dir1 (shortcut)\r\n5          : 40Tk 1Hd 18sec128 skew05 1K  64Dir1 (shortcut)\r\n\r\nUse \"cpmfs -t (type) info\" for more detail.\r\n\r\nC:>\r\n<\/pre>\n<p><\/code><\/p>\n<p>That&#8217;s quite a few floppy disk types that you can read. As an example of the more detail option, here&#8217;s the 8 inch double-sided double-density floppy disk format supported:<\/p>\n<p><code><\/p>\n<pre>\r\nC:>cpmfs -t 8DSDD info\r\n\r\nName              : 8DSDD\r\nDescription       : 77Tk 2Hd 16sec512 skew04 2K 256Dir2 (SD T0H0)\r\nImage size        :  9818 records (1256704 bytes)\r\nSystem area size  :    90 records\r\nData area size    :  9728 records\r\nBlock size        :    16 records (2K)\r\nDir size          :    64 records (4 blocks, 256 entries)\r\nDir type          :     2 (2 byte block numbers)\r\nTracks            :    77\r\nHeads             :     2\r\nReserved tracks   :     2 (track*head)\r\nRecords per sector:     4 (sector size 512 bytes)\r\nSectors per track : 16\r\nSkew table        : 1,5,9,13,2,6,10,14,3,7,11,15,4,8,12,16\r\n\r\nC:>\r\n<\/pre>\n<p><\/code><\/p>\n<p>Of interest, this is far from the standard 8 inch single sided single density image that is fairly easy to support. Disk blocks (or Cromemco &#8220;clusters&#8221;) are 2K in size; rather than the usual 1K. There are 256 directory entries; which is unusual when compared to smaller disk capacities. It even has two byte block numbers. Originally, I suspect, those were an idea for when hard disks came around. Just about every thing you&#8217;ll see for CP\/M disk formats will talk about 16 entries in the File Control Block (FCB) and 1K block sizes. Block numbers run from 00 to FF. They are a single byte and there&#8217;s room for 16 of them in each FCB extent&#8230;<\/p>\n<p>Well, this one has two byte block numbers. It&#8217;s a big disk. DSDD with 77 tracks gives you about 1.2M on a disk. That was unthinkably large at the time. Even hard disks, when they arived, only stored about 10M of data. The point here is 9728 records and 2K blocks (16 records per block) is 608 blocks. Those sorts of block numbers are never going to fit in a single byte.<\/p>\n<p>Anyway, the updated cpmfs program allows you to copy files to and from those style disks too.<\/p>\n<p>It has the standard options:<br \/>\n<code><\/p>\n<pre>\r\nC:>cpmfs\r\n\r\nCP\/M File System Utility Ver 0.03\r\nCopyright 2017 Greg Sydney-Smith\r\n\r\nUsage: cpmfs [-d dbg] [-t type] imagefile cmd [fn1 [fn2]]\r\n\r\ncmd: dir              : list   cpm files in imagefile\r\n     era fn1          : erase  cpm file fn1\r\n     r fn1 [fn2]      : read   cpm fn1 -> win fn2\r\n     w fn1 [fn2]      : write  cpm fn1 <- win fn2\r\n\r\ndbg: use 1 for block info, 2 for track, sector, disk addr\r\nDefault fn2 is same name as fn1.\r\nDefault type is worked out from the imagefile size.\r\nUse \"cpmfs types\" for a list of supported types.\r\nUse \"cpmfs adv\" for advanced commands.\r\n\r\nC:>\r\n<\/pre>\n<p><\/code><br \/>\nThese allow you to see what is on a disk (dir), read files from the disk (r), write files onto the disk (w), and to delete (&#8220;erase&#8221; in CP\/M terms) files off the disk (era).<\/p>\n<p>You can see a &#8220;dir&#8221; in the picture above. The read looks pretty simple:<br \/>\n<a href=\"http:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2017\/11\/cpmfs-r.png\"><img loading=\"lazy\" src=\"http:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2017\/11\/cpmfs-r-300x152.png\" alt=\"\" width=\"300\" height=\"152\" class=\"alignnone size-medium wp-image-1689\" srcset=\"https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2017\/11\/cpmfs-r-300x152.png 300w, https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2017\/11\/cpmfs-r-672x343.png 672w, https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2017\/11\/cpmfs-r.png 677w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>As does a write:<br \/>\n<a href=\"http:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2017\/11\/cpmfs-w.png\"><img loading=\"lazy\" src=\"http:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2017\/11\/cpmfs-w-300x152.png\" alt=\"\" width=\"300\" height=\"152\" class=\"alignnone size-medium wp-image-1690\" srcset=\"https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2017\/11\/cpmfs-w-300x152.png 300w, https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2017\/11\/cpmfs-w-672x343.png 672w, https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2017\/11\/cpmfs-w.png 677w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>This next one shows a sequence of copying a file onto the disk image, reading it back and comparing it, erasing the file from the image, and then trying to read the erased file:<br \/>\n<a href=\"http:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2017\/11\/cpmfs-wrer.png\"><img loading=\"lazy\" src=\"http:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2017\/11\/cpmfs-wrer-300x152.png\" alt=\"\" width=\"300\" height=\"152\" class=\"alignnone size-medium wp-image-1691\" srcset=\"https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2017\/11\/cpmfs-wrer-300x152.png 300w, https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2017\/11\/cpmfs-wrer-672x343.png 672w, https:\/\/www.sydneysmith.com\/wordpress\/wp-content\/uploads\/2017\/11\/cpmfs-wrer.png 677w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Version 0.03 also has some advanced commands that let you examine what&#8217;s on a &#8220;disk&#8221; in more detail, create new ones, format existing ones, and copy all or parts of the system image to and from your Windows file system. The advanced options look like:<br \/>\n<code><\/p>\n<pre>\r\nC:>cpmfs adv\r\n\r\nCP\/M File System Utility Ver 0.03\r\nCopyright 2017 Greg Sydney-Smith\r\n\r\nUsage: cpmfs [-d dbg] [-t type] imagefile cmd [fn1 [fn2]]\r\n\r\ncmd: make             : create imagefile\r\n     init             : reset  imagefile to empty\r\n     info             : show   auto\/selected imagefile format\r\n     dir2             : list   cpm files in raw FCB format\r\n     used             : show   block allocations\r\n     rsys fn1         : read   system tracks -> win fn1\r\n     wsys fn1         : write  system tracks <- win fn1\r\n     rr start len fn1 : read   system records -> win fn1\r\n     wr start len fn1 : write  system records <- win fn1\r\n                        (boot= 0 1, bios varies)\r\n\r\n\r\nC:>\r\n<\/pre>\n<p><\/code><\/p>\n<p>The cpmfs dir2 command produces output like this:<br \/>\n<code><\/p>\n<pre>\r\nC:>cpmfs drivea.dsk dir2\r\n00 43 52 4F 42 49 4F 53 20 41 53 4D 00 00 00 7C .CROBIOS ASM...|\r\n02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 ................\r\n00 43 52 4F 42 4F 4F 54 20 41 53 4D 00 31 00 0C .CROBOOT ASM.1..\r\n12 13 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................\r\n00 43 52 4F 42 4F 4F 54 20 50 52 4E 00 00 00 17 .CROBOOT PRN....\r\n14 15 16 00 00 00 00 00 00 00 00 00 00 00 00 00 ................\r\n00 43 52 4F 42 4F 4F 54 20 48 45 58 00 00 00 03 .CROBOOT HEX....\r\n18 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................\r\n00 43 52 4F 42 4F 4F 54 20 53 59 4D 00 00 00 03 .CROBOOT SYM....\r\n17 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................\r\n00 43 52 4F 42 49 4F 53 20 50 52 4E 00 00 00 80 .CROBIOS PRN....\r\n19 1A 1B 1C 1F 20 21 22 23 24 26 27 28 29 2A 2B ..... !\"#$&'()*+\r\n00 43 52 4F 42 49 4F 53 20 48 45 58 00 00 00 14 .CROBIOS HEX....\r\n25 2E 36 00 00 00 00 00 00 00 00 00 00 00 00 00 %.6.............\r\n00 43 52 4F 42 49 4F 53 20 50 52 4E 01 00 00 62 .CROBIOS PRN...b\r\n2C 2D 2F 30 31 32 33 34 35 37 38 39 3C 00 00 00 ,-\/012345789<...\r\n...\r\n\r\nC:>\r\n<\/pre>\n<p><\/code><\/p>\n<p>It understands the Cromemco CDOS label so, whilst it doesn&#8217;t adapt its behaviour according to it, it will provide information from it. Here&#8217;s a disk with a CDOS label:<br \/>\n<code><\/p>\n<pre>\r\nC:>cpmfs itc-cpm.dsk dir2\r\n\r\nDisk label     : Userdisk\r\nDate on disk   : 2000-00-00\r\nCluster size   : 2K\r\nDirectory type : 2 byte block numbers\r\nDirectory size : 256 entries\r\n\r\n81 55 73 65 72 64 69 73 6B 00 00 00 10 80 00 40 .Userdisk......@\r\n00 00 01 00 02 00 03 00 00 00 00 00 00 00 00 00 ................\r\n00 41 53 4D 20 20 20 20 20 43 4F 4D 00 00 00 40 .ASM     COM...@\r\n04 00 05 00 06 00 07 00 00 00 00 00 00 00 00 00 ................\r\n00 43 42 49 4F 53 20 20 20 41 53 4D 00 00 00 17 .CBIOS   ASM....\r\n08 00 09 00 00 00 00 00 00 00 00 00 00 00 00 00 ................\r\n00 43 44 4F 53 43 50 4D 20 43 4F 4D 00 00 00 0B .CDOSCPM COM....\r\n0A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................\r\n00 43 44 4F 53 43 50 4D 20 48 4C 50 00 00 00 14 .CDOSCPM HLP....\r\n0B 00 0C 00 00 00 00 00 00 00 00 00 00 00 00 00 ................\r\n00 43 4F 4D 48 45 58 20 20 43 4F 4D 00 00 00 06 .COMHEX  COM....\r\n0D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................\r\n...\r\n<\/pre>\n<p><\/code><\/p>\n<p>You can see that the label flags the directory entries as having two byte block numbers. Had there been a date, you&#8217;d see when it was created (or maybe updated).<\/p>\n<p>You may have noticed that cpmfs is automatically choosing the correct format as I choose different disk image files. It does this from the size of the disk. Double-sided ones will be larger than single-sided ones and double density also changes the sizes. Cpmfs copes with CDOS style disks that have different formatting on track 0 compared to the rest of the disk. This also affects the size of the image and so cpmfs can detect whether it is in this format or not.<\/p>\n<p>You can override the choice if you want or need to. For example, there are two 8&#8243; SSDD format choices. They are identical except for the use of two byte block numbers. The capacity of the disk exceeds what&#8217;s accessible with one byte values. You&#8217;d think that this would \/ should be the trigger to automatically go to two byte versions. But it doesn&#8217;t. Unless there is a CDOS label on the disk telling it to use 2, it stubbornly sticks with one. Cpmfs can cater for either case. Read the label if any (dir2) and then choose whichever applies to the disk you&#8217;ve got.<\/p>\n<p>The debugging options can help you understand what&#8217;s where on the disk. Here&#8217;s debug level 1:<br \/>\n<code><\/p>\n<pre>\r\nC:>cpmfs -d 1 itc-cpm.dsk r usq.h\r\nRead  block 0000\r\nRead  block 0001\r\nRead  block 0002\r\nRead  block 0003\r\nRead  block 00F7\r\nOK.\r\n\r\nC:>\r\n<\/pre>\n<p><\/code><br \/>\nBlocks 0, 1, 2 and 3 are the directory (for this disk format). It needs to read that to find where the file is stored. Then it discovers it&#8217;s at block 00F7 and so it copies it from there.<\/p>\n<p>Here&#8217;s the same with level 2:<br \/>\n<code><\/p>\n<pre>\r\nC:>cpmfs -d 2 itc-cpm.dsk r usq.h\r\nRead  block 0000\r\nRead  record     0 (track  1, head 0, sector  1 ( 1), address 002D00)\r\nRead  record     1 (track  1, head 0, sector  1 ( 1), address 002D80)\r\nRead  record     2 (track  1, head 0, sector  1 ( 1), address 002E00)\r\nRead  record     3 (track  1, head 0, sector  1 ( 1), address 002E80)\r\nRead  record     4 (track  1, head 0, sector  2 ( 5), address 003500)\r\nRead  record     5 (track  1, head 0, sector  2 ( 5), address 003580)\r\nRead  record     6 (track  1, head 0, sector  2 ( 5), address 003600)\r\nRead  record     7 (track  1, head 0, sector  2 ( 5), address 003680)\r\nRead  record     8 (track  1, head 0, sector  3 ( 9), address 003D00)\r\nRead  record     9 (track  1, head 0, sector  3 ( 9), address 003D80)\r\nRead  record    10 (track  1, head 0, sector  3 ( 9), address 003E00)\r\nRead  record    11 (track  1, head 0, sector  3 ( 9), address 003E80)\r\nRead  record    12 (track  1, head 0, sector  4 (13), address 004500)\r\nRead  record    13 (track  1, head 0, sector  4 (13), address 004580)\r\nRead  record    14 (track  1, head 0, sector  4 (13), address 004600)\r\nRead  record    15 (track  1, head 0, sector  4 (13), address 004680)\r\nRead  block 0001\r\nRead  record    16 (track  1, head 0, sector  5 ( 2), address 002F00)\r\n...\r\nRead  block 00F7\r\nRead  record  3952 (track 31, head 1, sector 13 ( 4), address 07D300)\r\nRead  record  3953 (track 31, head 1, sector 13 ( 4), address 07D380)\r\nRead  record  3954 (track 31, head 1, sector 13 ( 4), address 07D400)\r\nRead  record  3955 (track 31, head 1, sector 13 ( 4), address 07D480)\r\nRead  record  3956 (track 31, head 1, sector 14 ( 8), address 07DB00)\r\nRead  record  3957 (track 31, head 1, sector 14 ( 8), address 07DB80)\r\nRead  record  3958 (track 31, head 1, sector 14 ( 8), address 07DC00)\r\nRead  record  3959 (track 31, head 1, sector 14 ( 8), address 07DC80)\r\nRead  record  3960 (track 31, head 1, sector 15 (12), address 07E300)\r\nRead  record  3961 (track 31, head 1, sector 15 (12), address 07E380)\r\nRead  record  3962 (track 31, head 1, sector 15 (12), address 07E400)\r\nRead  record  3963 (track 31, head 1, sector 15 (12), address 07E480)\r\nRead  record  3964 (track 31, head 1, sector 16 (16), address 07EB00)\r\nRead  record  3965 (track 31, head 1, sector 16 (16), address 07EB80)\r\nRead  record  3966 (track 31, head 1, sector 16 (16), address 07EC00)\r\nRead  record  3967 (track 31, head 1, sector 16 (16), address 07EC80)\r\nOK.\r\n\r\nC:><\/pre>\n<p><\/code><br \/>\nYou can see which track would be selected, which head would be active, and which sector it is reading from the track. Both the logical sector number (unskewed) and the actual, physical, sector that it reads; are shown. You can see the logical progression of the read and where it actually goes to on the disk. Also present is the address within the disk image file. This can be helpful if you&#8217;re checking \/ looking for \/ making changes to the disk image with a binary \/ hexadecimal editor.<\/p>\n<p>I hope it is useful for you. I&#8217;m certainly going to use it.<\/p>\n<p>You can download it from <a href=\"http:\/\/www.sydneysmith.com\/products\/cpm\/cpmfs\/cpmfs-0.03.exe\">cpm\/cpmfs\/cpmfs-0.03.exe<\/a>.<\/p>\n<p>As it&#8217;s open source software, you can also download the source code <a href=\"http:\/\/www.sydneysmith.com\/products\/cpm\/cpmfs\/cpmfs-0.03.c\" rel=\"noopener\" target=\"_blank\">cpm\/cpmfs\/cpmfs-0.03.c<\/a>. I built the &#8220;.exe&#8221; with gcc in MinGW on Windows 8.1.<\/p>\n<p>This is part of the <a href=\"http:\/\/www.sydneysmith.com\/wordpress\/cpm-programs\/\">CP\/M topic<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>cpmfs is a tool for copying files in and out of CP\/M disk images. It allows you to copy any files you like from Windows onto a &#8220;disk&#8221; for an emulator or simulator. This also means you can copy files off old diskimage files and put them, in whatever combination you need, on new blank &hellip; <a href=\"https:\/\/www.sydneysmith.com\/wordpress\/1687\/cpmfs-version-0-03-released\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">cpmfs version 0.03 released<\/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,61],"tags":[75],"_links":{"self":[{"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/1687"}],"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=1687"}],"version-history":[{"count":5,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/1687\/revisions"}],"predecessor-version":[{"id":1696,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/posts\/1687\/revisions\/1696"}],"wp:attachment":[{"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1687"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1687"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sydneysmith.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}