• My CP/M V2

    agp.cooper4 days ago 0 comments

    My CP/M V2

    Should not really be working on this now, but anyway I updated cbios.asm for the W29C040-90B 256 byte page size. It was not that hard really, you just read to a buffer the"other" segment (that is within the 256b page boundary) and then write back the buffer before (immediately) writing the target segment.

    I also had the rework the disk/track/segment address from: 

      DDTTTTTT 1TTTTSSS SAAAAAAA

    to:

      DDTTTTTT 111TTSSS SAAAAAAA

    where:

    D = Disk

    T = Track

    S = Segment

    A = Address of a byte withing a segment.

    The first address format (V1) could access 32kb RAM, 4 disks of 2 Mb capacity while the second (V2) can address 56kb RAM, 4 disks of 512kb capacity.

    In theory, CP/M can access 16 disks of 8 Mb capacity.

    Alan

  • PCB has Arrived

    agp.cooper5 days ago 0 comments

    PCB

    Today the PCB has arrived. So tomorrow I will round up he chips and start the assembly. Flash the chips and with some luck it will fire up.

    The most important thing to check here is if rst7.5 is trouble free from other programs hijacking the interrupt.

    Next Version

    Yes, I am thinking of that. But I have to check that the current design works first. The idea is baby steps, make debugging much easier.

    The current version has 32kb RAM and 32kb of exposed ROM (i.e. Flash). It uses A15 to control the boot-up logic.

    I can increase the RAM by reducing the exposed ROM, by using (say) A15, A14 and A13. This will give me 56kb RAM and 8kb exposed ROM (i.e. the full boot, ccp, bdos and cdos  code). Now, I could increase the RAM further but this configuration work well with the 29AT040-90B Flash chip. The configuration give me 4x Flash disks of 512kb and 56k RAM. Here is the new schematic:

    Instead of using a fourth Flash disk, the slot could be used for an UART and other hardware.

    Assembled CP/M V1A this morning:

    Next is to format the Flash Chips and load the system files.

    Z80 Interrupts

    I looked at the Z80 interrupts and found the "Mode 1" must be what most other CP/M systems must be using. It functionally equivalent to RST7.5 on the 8085 but the address is 0028h rather than 002Ch.

    AlanX

  • Editing the CBIOS

    agp.cooper7 days ago 0 comments

    Editing the CBIOS

    The cbios is used to tell the CP/M operating system about your hardware. It contains routines (i.e. drivers) for your hardware. In my case I have software serial I/O and FRAM (i.e. flash) disks.

    The only thing I have to change for the serial I/O is the interrupt vector (from RST6.5 to RST7.5).

    The flash disk configurations and the read/write drivers.

    The Disk Parameters

    Using the CPM_2_0_System_Alteration_Guide,pdf as a guide I have recalculated the "standard floppy" for CP/M machines:

    CP/M Disk Parameter Calcs

    Standard
    Bytes/Sector 128 Record size
    Sectors/Track 26
    Tracks 77 Tracks



    Disk Capacity 250.25 Disk Capacity kb
    SYS 2 System Tracks
    TRK 75 User Tracks
    CAP 243.75 Storage Capacity kb
    n 10 n = 10 to 14
    BLS 1,024 BLS = 2**n



    SPT 26 Sectors
    BSH 3 BSH = n-7
    BLM 7 BLM = 2**BSH - 1
    EXM 0 EXM = 2**(BSH-3) - 1 if DSM<256


    EXM = 2**(BSH-4) - 1 if DSM>=256
    DSM 242 DSM = maximum data block number
    DRM 63 Directory Mask: DRM=BLS/16
    BLOCKS 32
    AL0 192
    AL1 0




    Standard
    Floppy
    DISK PARAMETER BLOCK:
    SPT 26 SECTORS PER TRACK
    BSH 3 BLOCK SHIFT FACTOR
    BLM 7 BLOCK MASK
    EXM 0 EXTENDED BLOCK MASK
    DSM 242 DISK SIZE-1
    DRM 63 DIRECTORY SIZE-1
    AL0 192 ALLOC 0
    AL1 0 ALLOC 1
    CKS 16 CHECK SIZE
    OFS 2 SYSTEM TRACK OFFSET

    For the 8*256kb Flash I want 128 directory entries. Therefore I need a BLOCK size of 2048 bytes. Here are the parameters for the system disk A:

    CP/M Disk Parameter Calcs

    256k System
    Bytes/Sector 128 Record size
    Sectors/Track 16
    Tracks 128 Tracks



    Disk Capacity 256 Capacity kb
    SYS 4 System Tracks
    TRK 124 User Tracks
    CAP 248.00 Capacity kb
    n 11 n = 10 to 14
    BLS 2,048 BLS = 2**n



    SPT 16 Sectors
    BSH 4 BSH = n-7
    BLM 15 BLM = 2**BSH - 1
    EXM 1 EXM = 2**(BSH-3) - 1 if DSM<256


    EXM = 2**(BSH-4) - 1 if DSM>=256
    DSM 247 DSM = maximum data block number
    DRM 127 Directory Mask: DRM=BLS/16
    BLOCKS 32
    AL0 240
    AL1 0




    256k System DISK PARAMETER BLOCK:
    SPT 16 SECTORS PER TRACK
    BSH 4 BLOCK SHIFT FACTOR
    BLM 15 BLOCK MASK
    EXM 1 EXTENDED BLOCK MASK
    DSM 247 DISK SIZE-1
    DRM 127 DIRECTORY SIZE-1
    AL0 240 ALLOC 0
    AL1 0 ALLOC 1
    CKS 0 NOT REMOVEABLE
    OFS 4 SYSTEM TRACK OFFSET

      And the same for the data disk (B):


    256k Data DISK PARAMETER BLOCK:
    SPT 16 SECTORS PER TRACK
    BSH 4 BLOCK SHIFT FACTOR
    BLM 15 BLOCK MASK
    EXM 1 EXTENDED BLOCK MASK
    DSM 255 DISK SIZE-1
    DRM 127 DIRECTORY SIZE-1
    AL0 240 ALLOC 0
    AL1 0 ALLOC 1
    CKS 0 NOT REMOVEABLE
    OFS 0 SYSTEM TRACK OFFSET

    Note: CP/M does not need to check the disks are the media (Flash) cannot be removed while the power is on.

    Edits done, files compile, so next is make a disk image and to load the image onto the Flash chips.

    AlanX

  • Update Schematic and PCB

    agp.cooper07/07/2020 at 05:58 0 comments

    Updated the Schematic and PCB

    Well I did update the schematic and PCB but found I had done that some time ago.

    So I sent the PCB off for manufacture.

    Here is the schematic:


    CP/M Firmware

    I will have to collect the work I did on the first version and update the "cbios.asm" for the new FRAM size etc.

    I will also have to collect the programs I want to put on the "Flash Disks". Previously  I wrote a C program to do this. However, writing the hex code to flash has to be in 16kb passes as the Nano can only hold about this much. Not really problem as hex code can be added incrementally.

    The Flash Programmer

    Here is the Flash Programmer:

    It is set up for either an AT29C256 or a W29C020.

    Note: When flashing these chips I use software protections to avoid the chips losing their contents due to accidental writes (during debugging).

    Here is the assembled Flash Programmer (with the old My CP/M computer):

    AlanX