Image Map Image Map
Page 5 of 5 FirstFirst 12345
Results 41 to 45 of 45

Thread: Drive parameters for Gotek USB disk

  1. #41

    Default

    The MCE2VGA adaptor arrived from Belgium which enabled me to get video back without having to jump through hoops and flying blind, to try to get the console redirected to the serial port.

    I had been manually patching the CP/M BIOS but that was getting more complicated. Fortunately, I had the original source and was able modify it and re-compile on the PC with ZMAC. That through me a few curve balls. For example, it didn’t complain about DM directives and created the strings, what it didn’t do was set the high bit on the last character which caused the code to spin off into hyper-space. The DC directive works, but only for strings. If you want a CR,LF at the end of a string you need to do something like DEFB CR,LF+0x80H. It took me a day or so to sort that one.

    I’m using cpmtools to create the disk images and the free hex editor FrHed to merge the boot image (CCP,BDOS,BIOS). Cpmtools can load the various parts but the command line is a bit fussy so creating a single image helps. FrHed can also be used t check the image file is what was expected. I did find that cpmtools doesn’t initialise the entire disk space with 0xEA and then flash floppy creates the directory entry it doesn’t write the file contents when writing to the USB. FrHed can be used to fix that padding out the entire disk with EA’s

    Anyway, the short version of the long story is I have it working, some of the problems I had to overcome were somewhat self-induced at times as I went on the occasional wild goose chase, only to find the final result was remarkably similar to what I started with. Most of the problems were a result of the number of new parts in the chain and not being entirely clear what the cause a problem was. The ROM BIOS, CPM BIOS, Assembler, Flashfloppy config files, cpmtools output etc. I had to prove each was doing what was expected by the next part of the chain. For example for an 80 track double sided, 9 sectors/track Flash Floppy needs to be told the disk has 160 tracks.

    One thing I have re-learned a lot, particulary about, physical/logical sectors, CP/M sectors vs disk sectors and extents sector translation, blocking and de-blocking that I wouldn’t have learned if it had all gone smoothly.

    Pete

  2. #42

    Default

    I suppose that seeing as the title of this thread is “Drive Parameters for a Gotek USB disk” I’d should post what I’ve arrived at.

    CP/M 2.2 on Z80 based homebrew with WD1793 disk controller (not that the hardware matters)

    GoteK SFR1M44-U100K USB with the FlashFloppy 2.14 firmware upgrade.

    Image creation using cpmtools

    Image editing with Frhed hex editor. This is useful for checking images have the expected files, merging boot, CCP, BDOS and CPM BIOS into one file and padding out the images with E5’s otherwise FlashFloppy won’t write to the image.


    BIOS Parameters


    Code:
    (DPBASE 0-3 are the 4 segments of the hard drive)
    DPBAS4: DEFW    TRANSA,0000H    ;PARAM HEADER,DISK F:
            DEFW    0000H,0000H	;1.44Mb DOUBLE Side
            DEFW    DIRBF,DPBLKF
            DEFW    CHK01,ALL05
    ;
    DPBAS5: DEFW    TRANSA,0000H    ;PARAM HEADER,DISK E:
            DEFW    0000H,0000H	;360Kb Double Side
            DEFW    DIRBF,DPBLKE
            DEFW    CHK00,ALL04
    
    ;SECTOR TRANSLATE DATA TABLES FOR all drives, up to 9 physical and 36 CPM logical
    ;
    TRANSA: DEFB    0,01,02,03,04,05,06     ;SECTORS 0,1,2,3,4,5,6
            DEFB    07,08,09,10,11,12     ;SECTORS 7,8,9,10,11,12
            DEFB    13,14,15,16,17,18     ;SECTORS 13,14,15,16,17
           DEFB    19,20,21,22,23,24     ;SECTORS 18,19,20,21,22,23
           DEFB    25,26,27,28,29,30     ;SECTORS 24,25,26,27,28,29
           DEFB    31,32,33,34,35     ;SECTORS 30,31,32,33,34,35
    ; DISK PARAMETER BLOCK, FOR 360Kb DISKS F:
    ;
    DPBLKE: DEFW    36              ;SECTORS PER TRACK
            DEFB    4               ;BLOCK SHIFT FACTOR
            DEFB    15               ;BLOCK MASK
            DEFB    1               ;EXTENT MASK
            DEFW    170             ;DISK SIZE-1
            DEFW    63              ;DIRECTORY MAX
            DEFB    128             ;ALLOC 0
            DEFB    0               ;ALLOC 1
            DEFW    16              ;CHECK SIZE
            DEFW    2               ;TRACK OFFSET
    ;
    ;
    ; DISK PARAMETER BLOCK, FOR 1.44MB DISKS E:
    ;
    DPBLKF: DEFW    36              ;SECTORS PER TRACK
            DEFB    4               ;BLOCK SHIFT FACTOR
            DEFB    15              ;BLOCK MASK
            DEFB    0               ;EXTENT MASK
            DEFW    710             ;DISK SIZE-1
            DEFW    127             ;DIRECTORY MAX
            DEFB    192             ;ALLOC 0
            DEFB    0               ;ALLOC 1
            DEFW    32              ;CHECK SIZE
            DEFW    2               ;TRACK OFFSET
    
    ;USB Disks
    ALL04:  DS      23              ;ALLOCATION VECTOR,360Kb DISK :
    ALL05:  DS      90              ;ALLOCATION VECTOR,1.44Mb DISK :
    CHK00:  DS      16              ;CHECK VECTOR, 360Kb DISK
    CHK01:  DS      32              ;CHECK VECTOR, 1.44Mb DISK
    Flash Floppy IMG.CFG (the remainder of the IMG.CFG and the entire FF.CFG are just the default settings)

    Code:
    #For 360Kb
    # Mandatory: Number of cylinders (1-254).
    cyls = 40
    
    # Mandatory: Number of heads (1-2).
    heads = 2
    
    # Mandatory: Number of sectors per track (1-256).
    secs = 9
    
    # Mandatory: Bytes per sector (128, 256, 512, 1024, 2048, 4096, 8192).
    bps = 512
    
    #For 1.44Mb
    # Mandatory: Number of cylinders (1-254).
    cyls = 160
    
    # Mandatory: Number of heads (1-2).
    heads = 2
    
    # Mandatory: Number of sectors per track (1-256).
    secs = 9
    
    # Mandatory: Bytes per sector (128, 256, 512, 1024, 2048, 4096, 8192).
    bps = 512



    cpmtools diskdefs file

    Code:
    #360Kb 40tracks, 9 sectors/track
    diskdef SyS360
      seclen 512
      tracks 40
      sectrk 9
      blocksize 2048
      maxdir 64
      skew 1
      boottrk 2
      os 2.2
    end
    
    #1.44Mb 80tracks, 9 sectors/track double sided
    
    diskdef SyS144
      seclen 512
      tracks 160
      sectrk 9
      blocksize 2048
      maxdir 128
      skew 1
      boottrk 2
      os 2.2
    end
    Something I have realised with all this is the image files are not that complicated. For some reason I'd been expecting sector ID's and CRC's there's none of that just a flat file representing the sectors laid end to end. Thats why Frhed is so usefull as its is easy to see what is on each sector.

    At some point I'm going to have a go and defining a non standard disk size, as big as possible. The limits of FlashFloppy are 254 tracks, 256 sectors double sided and sector sizes up to 8192 bytes which is 1Gybte. CPM 2.2 can't do disks that big and there is possibly a limitation on space available by the system for the size of the CPM BIOS , so a bit of a trade off is required on how big the disk should be.

    Pete
    Last edited by Doubletop; February 16th, 2020 at 01:21 AM.

  3. #43

    Default

    I'm just about sorted.

    The hard drive is still running and I've got the Gotek disk running and copied everything off.

    The MCE2VGA adaptor is doing a good job at converting the video signal so I can use a modern monitor.

    I can compile software on the PC and transfer it to the Gotek so I've been able to re-jig my CBIOS.

    I had a problem with my home made EPROM programmer by found the defective chip today so that is working and I can now re-make the ROM BIOS.

    There are a few quirky things to look at, like STAT telling me that the Gotek disks have 1.3Mbytes free when I know they are full. (just typing that it could have something to do with user numbers and STAT summing the number of files of the current user and using the DBP value to establish the size of the drive)

    The other thing is when writing to the Gotek, when it is full, the LCD display saying it is writing to track 85 even though it has been told it only has 80 tracks .

    So what then? I don't know really, it's all working and now its playing and tweaks.

    Pete

  4. #44

    Default

    ......and Kermit 4.11 is working as well

    Pete

  5. #45

    Default

    Quote Originally Posted by Doubletop View Post
    No I'm a FlashFloppy convert, along with cpmtools to make the images is working well for me.


    Pete
    Do you have a CP/M boot disk that you can share? I need to find out if my FlashFloppy drive in an Osborne Exec is going to work at all. Both original drives are fubar.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •