Coder Social home page Coder Social logo

ez80_cpm's People

Contributors

hharte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ez80_cpm's Issues

16MB disk images

I've copied three consecutive CP/M disk images, 16MB each, onto an SD card. As it turned out, several changes were required:

  1. There are three images:
diff --git a/CPM3.0/src/DRVTBL.ASM b/CPM3.0/src/DRVTBL.ASM
index 21c9721..a29a99c 100644
--- a/CPM3.0/src/DRVTBL.ASM
+++ b/CPM3.0/src/DRVTBL.ASM
@@ -42,7 +42,7 @@ ELSE                    ; All others supprt SD Cards
         DW  _sdmmc0     ; C:
         DW  _sdmmc1     ; D:
         DW  _sdmmc2     ; E:
-        DW  _sdmmc3     ; F:
+        DW  0 ;_sdmmc3     ; F:
 ENDIF
         DW  0           ; G:
         DW  0           ; H:
  1. They are 16MB, no special meaning for the first sector:
diff --git a/CPM3.0/src/sdmmcdrv.asm b/CPM3.0/src/sdmmcdrv.asm
index f73a984..3ec7eb7 100644
--- a/CPM3.0/src/sdmmcdrv.asm
+++ b/CPM3.0/src/sdmmcdrv.asm
@@ -62,18 +62,18 @@ EXTERN   _const                         ; get console status
 
 PUBLIC  _dpbsd0
 
-;Disk Parameter Block for an 8MB Non-removable drive
+;Disk Parameter Block for an 16MB Non-removable drive
 _dpbsd0:    
-    dw  192                             ; # of 128 byte records/track (SPT)
-    db  5                               ; BSH (4K byte blocks)
-    db  31                              ; BLM
-    db  1                               ; EXM
-    dw  2047-6                          ; DSM 2042 4K Blocks
-    dw  1023                            ; DRM 1024 Directory Entries
-    db  0FFh                            ; AL0   
+    dw  0200h                           ; # of 128 byte records/track (SPT)
+    db  6                               ; BSH (4K byte blocks)
+    db  03Fh                            ; BLM
+    db  3                               ; EXM
+    dw  07F7h                           ; DSM 2042 4K Blocks
+    dw  01FFh                           ; DRM 1024 Directory Entries
+    db  0C0h                            ; AL0   
     db  000h                            ; AL1   
     dw  08000h                          ; CKS (Set to 08000h for hard drives)
-    dw  1                               ; OFF (# tracks to skip for system)     
+    dw  0                               ; OFF (# tracks to skip for system)     
     db  2                               ; PSH (Physical Record Shift Factor) (512 -
     db  3                               ; PHM (Physical Record Shift Mask)    byte sectors)
     dw  sd_off_tbl                      ; Pointer to the track offset table
@@ -171,9 +171,9 @@ sd3alv: blkb    256,0
 
 sd_off_tbl:
 ;       track   sect
-    dw  0000AH, 00020H                  ; Track/sector offset for drive 0
-    dw  0FFFFH, 00000H                  ; Track/sector offset for drive 1
-    dw  0FFFFH, 00000H                  ; Track/sector offset for drive 2
+    dw  00000H, 00000H                  ; Track/sector offset for drive 0
+    dw  00100H, 00000H                  ; Track/sector offset for drive 1
+    dw  00200H, 00000H                  ; Track/sector offset for drive 2
     dw  0FFFFH, 00000H                  ; Track/sector offset for drive 3
     dw  0FFFFH, 00000H                  ; Track/sector offset for drive 4
     dw  0FFFFH, 00000H                  ; Track/sector offset for drive 5
  1. Since upper half of DPB's SPT field is ingored, there's no way to work with 16MB images. It can be easily handled, the approach below isn't the most beautiful, but at least it works:
@@ -271,8 +271,18 @@ b_rwsetup:                              ; This first part is a hack.  Physical d
     add     hl,de
     ld      hl,(hl)
     ld      a,(hl)                      ; Get number of 128-byte records/track
+    inc     hl
     srl     a
     srl     a                           ; convert to sectors/track
+    ld      e,a
+    ld      a,(hl)
+    sla     a
+    sla     a
+    sla     a
+    sla     a
+    sla     a
+    sla     a
+    or      e
     ld      (_spt), a
     ld      de,(_sect)                  ; Sector # into E, Track into D
     dec     de                          ; physical sector is one more than actual hardware sector

Additionally, hi-speed mode did not work with my cheapest SPI MMC card slot and the timeout in TryOpCondAgain was too small. Hence I needed also the following changes:

diff --git a/shared/ez80sdmem.asm b/shared/ez80sdmem.asm
index f9107b1..d011a4a 100644
--- a/shared/ez80sdmem.asm
+++ b/shared/ez80sdmem.asm
@@ -127,7 +127,7 @@ try_again:
 
 SD_GoHiSpeed:
        ld      a,03h                   ; @ 50MHz clock, 04h = ~6.25Mbit/s.
-       out0    (SPI_BRG_L),a
+;      out0    (SPI_BRG_L),a
 
 IF SD_DEBUG
        ld      de, b_strHiSpeed
@@ -139,7 +139,8 @@ ENDIF
        ret
 
 TryOpCondAgain:
-       djnz    SD_OpCond
+;      djnz    SD_OpCond
+       jr      SD_OpCond
 
        ld      de, b_strNoReady
        call    b_TXstringDE

Now all of my old CP/M software is there!

Only xon/xoff serial consoles are working

This is somewhat annoying bug, eventually I've managed to get to the point where it kicks in.

If a serial device is not xon/xoff, a jump to _cost function is being done, but since it is not call, just a jump, linker somehow did not resolve it correctly and it jumps somewhere, but not where it supposed to. A small patch like this one helps to sort it out:

diff --git a/CPM3.0/src/BIOSKRNL.ASM b/CPM3.0/src/BIOSKRNL.ASM
index 81fab54..a61f22f 100644
--- a/CPM3.0/src/BIOSKRNL.ASM
+++ b/CPM3.0/src/BIOSKRNL.ASM
@@ -282,7 +282,7 @@ coster: ; check for output device ready, including optional
     LD      A,(HL) 
     AND     010H        ; mb_xonxoff
     POP     HL      ; recover console number in <HL>
-    JR      Z,_cost     ; not a xon device, go get output status direct
+    JR      Z,cost_direct   ; not a xon device, go get output status direct
     LD      DE,xofflist 
     ADD     HL,DE       ; make pointer to proper xon/xoff flag
     CALL    cist1       ; see if this keyboard has character
@@ -300,6 +300,9 @@ not_s:
     CALL    cost1       ; get the actual output status,
     AND     (HL)        ; and mask with ctl-Q/ctl-S flag
     RET         ; return this as the status
+cost_direct:
+    CALL    _cost
+    RET
 cist1:  ; get input status with <BC> and <HL> saved
     PUSH    BC 
     PUSH    HL

I wonder how often this idiom is used, may be a source of a few mysterious problems.

Too much of TPA gets eaten away by BDOS+BIOS+buffers

Somehow I got used to CP/M3 systems offering 61K TPA. Sadly this port offers much less than that. In effect, bigger programs cannot be load or they cannot work with bigger data files (e.g. BASIC interpreter cannot even load RPED.BAS program). It feels like a shame since this machine is fast and resourceful, with potential to provide a good retro-CP/M3 experience.

In the CPM30.zdsproj file (and also some other files, BTW, which one would be the one to make an impact?) I can read the following:

LOCATE BDOS AT (LOWADDR OF RAM) + $0CD00
LOCATE BIOS AT TOP OF BDOS + 1

The 0xCD00 address seems drastically low for BDOS...

Further on I can read:

MAXLENGTH CCP_SEG $0C00
MAXLENGTH BDOS $2100
MAXLENGTH BIOS $0E00

I assume 0xCD00 was chosen to accommodate BDOS (0x2100 in assumed max size), BIOS (0xE00 in assumed max size) and 1kB for OS buffer. All of them seems like overkill. Can I trim any of those values safely? How can I determine how much of the BDOS/BIOS max size can be reduced? And what about 1kB buffer above BIOS, how much of it is actually being used?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.