On Thursday, March 31, 2022 at 6:58:00 AM UTC-5, Douglas Miller wrote:
Also be aware that "BIOS" has a subtly different meaning in the IBM-PC/DOS world than in CP/M. DOS formally placed the BIOS in the ROM, while in the CP/M world the BIOS was the portion of CP/M that implemented the interfaced to the specific platform. I
don't believe that the IBM-PC "BIOS ROM" could be directly used as the CP/M-86 BIOS, so there had to be a "shim" (at least) to interface the CP/M-86 BIOS calls to the platform ROM "BIOS". I'm not sure what DOS defined as far as "format data" in the boot
sector, but CP/M-86 was not restricted to running on DOS (IBM-PC compatible) platforms. As I recall, DOS does not use the exact same DPB format as CP/M so there needs to be some translation done there, but it is possible that the diskette format is being
detected by the ROM BIOS and then the CP/M-86 BIOS is translating that into what the CP/M-86 BDOS needs.
The original post does say "PC", which I would assume means it is an IBM-PC - but that may be an incorrect assumption.
The IBM ROM BIOS is better referred as 'rom-bios'. It is mostly the INT services.
The cp/m Bios is the software buss interface to the hardware, sometimes known as the CBIOS, customized bios.
For CP/M-86 the cbios begins at offset 2500h, which has the jump table to all the services the cbios offers, including the low level hardware interfaces.
As an aside, a working cp/m-86 binary can be split there at the cbios jump table and a new cbios binary org'd for 2500h can 'paper-over' there as one
method of modifing cp/m-86 [1]. Also, the IBM versions load at segment 0051h whereas the non-IBM versions often use 0040h.
The CP/M-86 v. 1.0 for the IBM-PC was the first version offered, followed by CP/M-86 v. 1.1 for the IBM PC/XT which added hard disk support.
There is the EAGLE version of CP/M-86 on Gaby's site - the unofficial cpm site. It is IBM compatible as Eagle computers were an IBM clone. ( I
once had it running on a dell pentium laptop by using a 720k 3 1/2 floppy formatted as 360k media and installed the EAGLE version on it. So I know
the cbios was ibm compatible. After this time the OEMs began using 3 1/2 floppy drives whose controllers dropped support for 720k format, then floppy drives began to disappear. ) The Eagle software includes the source for the CBIOS in CPMBIOS.A86 so
have a look there for the CBIOS to
RomBios usage. It uses INT 10h, 12h, 13h, 14h, 16h, 17h, of the IBM RomBios.
[1] AIR Freek didn't want to modify CP/M-86 until after load time where his driver does a 'hot' patch of cp/m-86.
The CP/M-86 media does not have a BPB structure on disk like pcDos does. It's method is use of a DPH & DPB structures held in the CBIOS.
The DPB.OFFSET field holds the offset in TRACKs to use to be at the beginning of the Disk Directory.
The only snippet of code I have on this system from those times (over 20 years ago) is this, from 2014 in nasm syntax..
Note: There is no sector skew on modern floppy drives.
fwiiw:
;;===================
;; -=== D A T A ===-
;;===================
;;------------------------------------------------------
;; Disk Structures DPH, DPB. Work Areas CSV, ALV. ;;------------------------------------------------------
;; CSV size is based on CKS size, CSVsz = CKS = (DRM+1)/4
;; ALV size is based on maxium blks, = (DSM/8)+1
;
; DISK PARAMETER HEADER
;
FEAT_DPH DW 0 ;NO TRANSLATE TABLE (for sector skew)
DW 0 ;; cdrmaxa, DPH[2]
DW 0 ;; curtrka, DPH[4]
DW 0 ;; curreca, DPH[6]
DW DIRBUF ;DIRECTORY SCRATCH PAD
FEAT_DPB DW FEAT144 ;DPBK1
DW FEAT_CSV ;CHECK VECTOR 0
DW FEAT_ALV ;ALLOCATION VECTOR 0
;-----------------------------------------------------------
; PC DOUBLE SIDED - 1440k drive - Feat144.
;
; 512 BYTES PER SECTOR
; 18 SECTORS PER TRACK
; 160 TRACKS PER DRIVE, 80 per side
; DOUBLE DENSITY ;-----------------------------------------------------------
;; bls144 equ 4096 ;block size is 32 sectors of 128 bytes
FEAT144:
ISTRUC DPB_
at DPB_.CSPT, DW 72 ;LOGICAL 128byte SECTORS PER TRACK
at DPB_.CBSH, DB 5 ;BLOCK SHIFT FACTOR
at DPB_.CBLM, DB 31 ;BLOCK MASK VALUE
at DPB_.CEXM, DB 1 ;EXTENT MASK
at DPB_.CDSM, DW 354 ;DISK STORAGE ( IN BLOCKS - 1)
at DPB_.CDRM, DW 255 ;DIRECTORY ENTRIES ( -1 )
at DPB_.CAL0, DB 0C0h ;DIRECTORY ALLOCATION VECTOR 0
at DPB_.CAL1, DB 00h ;DIRECTORY ALLOCATION VECTOR 1
at DPB_.CCKS, DW 64 ;SIZE OF CHECK VECTOR
at DPB_.COFF, DW 2 ;SYSTEM OFFSET ** in Tracks **
featcsv equ 64 ;; (DRM+1)/4 =256/4 =64
featalv equ 45 ;; (DSM/8)+1 =(354/8)+1 = 44+1 = 45
; EAGLE EXTENSION
;; at DPB_.RMSK, DB 1 ;PHYSICAL TO LOGICAL SECTOR MASK VALUE
;; at DPB_.RLSHF, DB 1 ;PHYSICAL TO LOGICAL SECTOR SHIFT VALUE
;; at DPB_.RSDF, DB 1 ;LOGICAL TRACK TO HEAD/TRACK METHOD
;; at DPB_.RDSZ, DB 1 ;READ SIZE
;; at DPB_.RHWP, DW 1 ;POINTER TO HAREWARE PARAMETER TABLE
;; at DPB_.RXLT, DW 1 ;POINTER TO PHYSICAL SECTOR TRANSLATION
;; at DPB_.SID, DW 0090h ; = 144 Feat Boot Sector ID.
IEND
;; feat144..
FEAT_CSV TIMES featcsv DB 0 ;;CHECK VECTOR 1
FEAT_ALV TIMES featalv DB 0 ;;ALLOCATION VECTOR 1 ;---------------------------------------------------------------------
; CONTROLLER PARAMETERS FOR PC DISKETTES ;---------------------------------------------------------------------
;; Diskette Parameter Table (DPT) for PC-ROM-BIOS Int 1Eh Vectors. ;;--------------------------------------------------------------------
;For 720 KB and 1.44 MB, 3.5 inch diskettes we will use a different DPT ;(source: MS-DOS 6.2):
;DF 02 25 02 12 1B FF 6C F6 0F 08.
PC_F144:
ISTRUC DPTbl_
at DPTbl_.Spec1, DB 0DFh ;"DISK_BASE" HARDWARD INFORMATION
at DPTbl_.Spec2, DB 2 ;SPEC BYTE 2, 02h, HeadLoad & nonDMA_Flg
at DPTbl_.MotD, DB 25 ;MOTOR OFF TIME
at DPTbl_.RSSHF, DB 2 ;SECTOR SIZE SHIFT FACTOR, 2 = 512 byte sectors
at DPTbl_.RSPT, DB 12 ;EOT - SPECTORS PER TRACK
at DPTbl_.GapL, DB 01Bh ;GPL - READ GAP LENGTH
at DPTbl_.DataL, DB 0FFh ;DTL - DATA LENGTH
at DPTbl_.GapF, DB 06Ch ;FORMAT GAP LENGTH
at DPTbl_.Fillr, DB 0F6h ;FILL BYTE FOR FORMAT
at DPTbl_.Settl, DB 0Fh ;SKIP FLAG / HEAD SETTLE TIME
at DPTbl_.MotS, DB 8 ;MOTOR START TIME ( IN 1/8THS'S)
; local info extention..
at DPTbl_.RTPS, DB 80 ;TRACKS PER "SIDE"
at DPTbl_.RHPD, DB 2 ;NUMBER OF HEADS
IEND
;---------------------------------------------------------------------
; E N D O F F E A T D R I V E R ;---------------------------------------------------------------------
AIR the DPTbl was slightly different from other IBM RomBios references I had, so double check these.
Note that early media used a format filler byte of E5h versus the later format filler byte of F6h. This
brings up a point~ early CP/M-80 saw the default E5h in the directory entry as 'this fcb spot is free' was
a change made when the default filler went F6h?
hth,
Steve
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)