Image Map Image Map
Results 1 to 9 of 9

Thread: Inserting files into FreHD CP/M images

  1. #1

    Default Inserting files into FreHD CP/M images

    I am a proud owner of a FreHD that works beautifully with my TRS-80 Model4.

    It boots into MM CP/M beautifully, and to be honest, I am surprised as to how easy it is to use.

    So much so that I want to move a *heap* of data from my Pulsar 6000 STD system into it - The Pulsar disks are 77 track, 5.25" (mitsibishi M4854) so there is no way on earth they are going to be read in my TRS-80 Single sided 35 track drive. But - Wait - I have already moved all of the files into the Windoze world.

    All I need is how I can slap that SDcard into my laptop, and copy files, using technology that is unknown to me - into an image.

    Should be simple.

    he he.

    I am open to any ideas.

  2. #2

    Default

    Another option would be to attach the floppy drive from the Pulsar to the Model 4 and then create a disk definition for it in MM and configure MM to use it for the Pulsar drive. That way you can just copy the files over from the floppies.

  3. #3
    Join Date
    Mar 2013
    Location
    Chaffee, MO
    Posts
    1,455

    Default

    drj113,
    I don't know what a Pulsar 6000 is, but I assume it runs CP/M ver x and is Z80 based. What type of Image
    files do you have available on your SDcard. What software created, or copied the 5.25" Floppy's
    to your Windows Computer.

    Does you Pulsar 6000 boot up to CP/M so we can get information from it for the Disk Parameter Block?
    Do you have any of the BIOS files available describing the Floppy(s) DPB?

    There are some CP/M programs you can run that will get a lot of the necessary data that needs to be
    used for a cpmtools or 22DISK Definition. Probe.com, DPB.com, DPB.BAS, SKEW.com, and Anadisk,

    The CP/M system commands can also get more information on the actual system.
    Code:
    STAT DEV: - Displays current DEVICE information.
    STAT VAL: - Displays current STATUS information.
    STAT USR: - Displays current USR information.
    STAT A*.* $S - Displays detailed file information.
    STAT DSK: - Gives some detailed disk information for logged drive.
    STAT A: DSK: - Gives some detailed disk information for A:.
    STAT B: DSK: - Gives some detailed disk information for B:.
    I assume that M4854 Floppy is a 96 TPI (80 Track) DS/DD floppy. Can you make images of those
    floppy's with Teledisk, Imagedisk, or GreaseWeazle? You could also use Fluxengine, Kryoflux,
    Catweazle, or Supercard Pro?

    I'd like for you to copy one of your Boot Images with Imagedisk so I can have a look at it. Would that be
    possible?


    Larry

  4. #4

    Default

    Quote Originally Posted by drj113 View Post
    All I need is how I can slap that SDcard into my laptop, and copy files, using technology that is unknown to me - into an image.

    Should be simple..
    FreHD utilities - IMPORT2. This is the only reliable method AFAIK.

    I also tried copying files using TRS32 onto the FreHD hard disk images, but the result was always the same - the files were corrupted.

    I had some email thread with a couple of developers a few years ago (including Quinn, Reed, Mav and Vecoven), but the issue was never resolved.

    So, import2 is the only thing that worked for me (copied Turbo Pascal and Word Star and things like that in this way - it is tedious though, because a lot of files need to be imported)

    Let me know if you find a better way!

    So, it would be great if there was an emulator other than TRS32 whose HD image file format would be fully compatible with FreHD. It could be so simple - populate the FreHD CP/M image on the PC in your emulator with everything you need, put it back in the FreHD, and there you have it. For unknown reasons, it doesn't work like this with TRS32 unfortunately. The files are corrupted. It *almost* works. You can see and execute the files, but then execution fails with weird error messages that somehow indicate that the files were corrupted. Maybe another emulator has "full FreHD image compatability"?
    Last edited by LambdaMikel; May 18th, 2020 at 10:14 AM.

  5. #5
    Join Date
    Mar 2013
    Location
    Chaffee, MO
    Posts
    1,455

    Default

    drj113,
    I've conjured up some definitions that should allow you to access the files. If you have Dave Dunfield's
    Imagedisk Ver 1.18 you can create the .IMD files from your floppy's. Then also create the .RAW (Sector
    Dump) image. Then cpmtools or cpmtools built with libdsk can insert or remove files from the .RAW image.

    Code:
    #My 22DISK Definition:
    #
    # LBB 5.25" DS DD 40T (5.25" DS DD 40x9 s/t)
    # Disk uses formatted physical skewing: 1,6,2,7,3,8,4,9,5
    #
    BEGIN lbb_40dsdd Little Big Board 370K - DSDD 96 tpi 5.25" - 512 x 9
    DENSITY MFM LOW
    CYLINDERS 40 SIDES 2 SECTORS 9 512
    SIDE1 0 1,2,3,4,5,6,7,8,9
    SIDE2 0 1,2,3,4,5,6,7,8,9
    ORDER SIDES
    BSH 4 BLM 15 EXM 1 DSM 174 DRM 63 AL0 080H AL1 0 OFS 2
    END
    
    # lbb_40dsd  Little Big Board 370K - DSDD 96 tpi 5.25" - 512 x 9
    diskdef lbb5
      seclen 512
      tracks 80
      sectrk 9
      blocksize 2048
      maxdir 63
      skew 1
      boottrk 2
      os 2.2
    end
    
    # libdsk data below
    lbb_40dsd]
    description = lbb_40dsd  Little Big Board 370K - DSDD 96 tpi 5.25" - 512 x 9
    sides = alt
    cylinders = 80
    heads = 2
    secsize = 512
    sectors = 9
    secbase = 1
    datarate = DD
    
    [lbb_40dsd]
    cyls = 80
    heads = 2
    secs = 9
    interleave = 1
    bps = 512
    id = 1
    #rpm = 360
    rpm = 300
    rate = 250
    mode = mfm
    iam = no
    
    
    $ cpmls -f lbb_40dsdd -D cpm_source_lbb_40dsdd.raw
         Name    Bytes   Recs  Attr     update             create
    ------------ ------ ------ ---- -----------------  -----------------
    BIOS85  .HEX     6K     44    
    BIOS85  .MAC    12K     95    
    BIOS85  .REL     2K     10    
    BOOTSEC .HEX     2K      3    
    BOOTSEC .MAC     2K      9    
    BOOTSEC .REL     2K      1    
    CPM58   .COM    10K     76    
    DDT     .COM     6K     38    
    DOCTOR  .COM     8K     51    
    DSKSERV .MAC     2K      5    
    DSKSERV .REL     2K      1    
    DUMP    .COM     2K      4    
    DUPLICAT.COM    12K     83    
    DUPLICAT.MAC     4K     28    
    DUPLICAT.REL     2K      6    
    EDIT    .COM     6K     40    
    EDIT    .DOC     2K      6    
    FORMAT  .COM     2K      3    
    FORMAT  .MAC     6K     34    
    FORMAT  .REL     2K      4    
    GENSYS  .COM    10K     76    
    L80     .COM    12K     84    
    LBBEQU  .MAC     4K     20    
    M80     .COM    20K    157    
    MAKECPM .DOC     2K      5    
    MOVCPM  .COM    10K     76    
    NEWDISC .DOC     2K     13    
    ONTRAK  .MAC     4K     21    
    ONTRAK  .REL     2K      2    
    PIP     .COM     8K     58    
    PUTSYS  .COM     2K      3    
    PUTSYS  .MAC     2K      7    
    PUTSYS  .REL     2K      2    
    RDTRAK  .COM    12K     90    
    RDTRAK  .MAC     2K      5    
    RDTRAK  .REL     2K      1    
    READSEC .MAC     2K     10    
    READSEC .REL     2K      1    
    SB8500  .MAC     6K     48    
    SB8500  .REL     2K      6    
    SCANTK  .COM     8K     55    
    SCANTK  .MAC     2K     11    
    SECFIX  .COM     2K      7    
    SECFIX  .MAC     2K      3    
    SECFIX  .PRN     2K     10    
    SECFIX  .REL     2K      1    
    SPECFOR .COM     2K      4    
    SPECFOR .MAC     6K     35    
    SPECFOR .REL     2K      4    
    SQUARES .MAC     2K     13    
    SQUARES .REL     2K      3    
    STAT    .COM     6K     41    
    SYSGEN  .COM     2K      8    
    WRITESEC.MAC     2K     11    
    WRITESEC.REL     2K      1    
       55 Files occupying    244K,     104K Free.
    
    
    $ cpmls -f lbb_40dsdd -T raw,lbb_40dsdd -D cpm_source_lbb_40dsdd.raw
         Name    Bytes   Recs  Attr     update             create
    ------------ ------ ------ ---- -----------------  -----------------
    BIOS85  .HEX     6K     44    
    BIOS85  .MAC    12K     95    
    BIOS85  .REL     2K     10    
    BOOTSEC .HEX     2K      3    
    BOOTSEC .MAC     2K      9    
    BOOTSEC .REL     2K      1    
    CPM58   .COM    10K     76    
    DDT     .COM     6K     38    
    DOCTOR  .COM     8K     51    
    DSKSERV .MAC     2K      5    
    DSKSERV .REL     2K      1    
    DUMP    .COM     2K      4    
    DUPLICAT.COM    12K     83    
    DUPLICAT.MAC     4K     28    
    DUPLICAT.REL     2K      6    
    EDIT    .COM     6K     40    
    EDIT    .DOC     2K      6    
    FORMAT  .COM     2K      3    
    FORMAT  .MAC     6K     34    
    FORMAT  .REL     2K      4    
    GENSYS  .COM    10K     76    
    L80     .COM    12K     84    
    LBBEQU  .MAC     4K     20    
    M80     .COM    20K    157    
    MAKECPM .DOC     2K      5    
    MOVCPM  .COM    10K     76    
    NEWDISC .DOC     2K     13    
    ONTRAK  .MAC     4K     21    
    ONTRAK  .REL     2K      2    
    PIP     .COM     8K     58    
    PUTSYS  .COM     2K      3    
    PUTSYS  .MAC     2K      7    
    PUTSYS  .REL     2K      2    
    RDTRAK  .COM    12K     90    
    RDTRAK  .MAC     2K      5    
    RDTRAK  .REL     2K      1    
    READSEC .MAC     2K     10    
    READSEC .REL     2K      1    
    SB8500  .MAC     6K     48    
    SB8500  .REL     2K      6    
    SCANTK  .COM     8K     55    
    SCANTK  .MAC     2K     11    
    SECFIX  .COM     2K      7    
    SECFIX  .MAC     2K      3    
    SECFIX  .PRN     2K     10    
    SECFIX  .REL     2K      1    
    SPECFOR .COM     2K      4    
    SPECFOR .MAC     6K     35    
    SPECFOR .REL     2K      4    
    SQUARES .MAC     2K     13    
    SQUARES .REL     2K      3    
    STAT    .COM     6K     41    
    SYSGEN  .COM     2K      8    
    WRITESEC.MAC     2K     11    
    WRITESEC.REL     2K      1    
       55 Files occupying    244K,     104K Free.

    I extracted all files and all the ones I opened look SANE.

    Code:
    $ cpmcp -f lbb_40dsdd cpm_source_lbb_40dsdd.raw 0:*.* SOURCE
    
    
    	title	BIOS85
    	subttl	08-July-1984	C.I.E.
    .comment $
    BIOS for 5" and 8" drives, with Little Big Board & SB8500 controllẹ.
    The SB8500 is only required if 8" drives are to be used.
    Drive assignments: A, B, C, 5":  D 8".
     
    Includes deblocking for 5" double density drives (IBM PC compatible).
     
    $
    .z80
    .xlist
    	include	LBBEQU.MAC
    .list
    	extrn	select,	readsc,	secwrt,	speci,	func,	read8,	wrt8
    	extrn	drive,	track,	sector,	sel8
    	global	dmaadr,	cyltab,	dirbf
    ;
    bios	equ	$
    ccp	equ	bios-1600h
    bdos	equ	ccp+806h
    ;
    boot?	equ	0		;"jp boot"
    iobyte	equ	3		;Intel i/o byte
    cdisk	equ	4		;currently logged disk
    bdos?	equ	5		;"jp bdos"
    ;
    	cseg
    ;
    ;BIOS standard entry points
    	jp	boot
    wboote:	jp	wboot
    	jp	const
    	jp	conin
    	jp	conout
    	jp	list
    	jp	punch
    	jp	reader
    	jp	home
    	jp	seldsk
    	jp	settrk
    	jp	setsec
    	jp	setdma
    	jp	read
    	jp	write
    	jp	listst
    	jp	sectran
    	$eject
    ;CP/M to host (5") disk constants
    blksiz	equ	2048		;CP/M allocation size
    hstsiz	equ	512		;host sector size
    hstspt	equ	18		;host sectors per track (2 sided)
    hstblk	equ	hstsiz/128	;CP/M sectors per host sector
    cpmspt	equ	hstblk * hstspt	;CP/M sectors per track
    secmsk	equ	hstblk-1	;sector mask
    secshf	equ	2		;log(2) hstblk
    ;
    ;BDOS write-command codes:
    wrall	equ	0		;write to allocated
    wrdir	equ	1		;write to directory
    wrual	equ	2		;write to unallocated
    dpbase:				;drive param. headers - FFs if no drive
    	dw	0,0,0,0		;5" drive headers
    	dw	dirbf,dpblk5
    	dw	chk00,all00
    ;
    	dw	0,0,0,0
    	dw	dirbf,dpblk5
    	dw	chk01,all01
    ;
    	dw	0,0,0,0
    	dw	dirbf,dpblk5
    	dw	chk02,all02
    ;
    dpblk5:	dw	9*2*hstblk	;5" drive parameters
    	db	4,15,1
    	dw	174,63
    	db	128,0
    	dw	16,1
    ;
    bsects	equ	(bios-ccp)/200h	;no. of warm-boot sectors to load
    	$eject
    boot:	xor	a		;cold start
    	ld	(iobyte),a
    	ld	(cdisk),a
    	call	speci		;do 8" drive setups
    ;
    gocpm:	xor	a
    	ld	(hstact),a	;host buffer inactive
    	ld	(unacnt),a	;unalloc. ctr. = 0
    	ld	a,0c3h		;"jp ..."
    	ld	(boot?),a
    	ld	hl,wboote	;make up jumps
    	ld	(boot?+1),hl
    	ld	(bdos?),a
    	ld	hl,bdos
    	ld	(bdos?+1),hl
    	ld	bc,80h
    	call	setdma		;default buffer locn.
    	ld	a,(cdisk)
    	ld	c,a		;currently logged disk
    	jp	ccp		;then to cp/m
    ;
    ;------------------------------------------------------------
    ;
    wboot:	ld	sp,80h		;warm boot: reload cp/m
    				;NB boot from 5" double-density drive,
    				; so we save time by reading physical,
    				; 512-byte sectors. CP/M starts at
    				; physical sector 1.
    ;
    	ld	a,(hstact)	;see if block needs writing out, first
    	or	a
    	jr	z,goc1
    	ld	a,(hstwrt)	;if active & written, write it back
    	or	a
    	call	nz,writehst
    	jr	nz,booter0	;write errors
    ;
    goc1:	xor	a
    	ld	d,a
    	call	select		;select drive 0, track 0
    	jr	nz,booter0	;not ready!
    	ld	b,10		;retry limit
    wboot0:	push	bc		;re-enter here after errors
    	ld	hl,ccp		;base of cp/m
    	ld	c,1		;start at sector 1
    	ld	b,bsects	;no. of sectors to load
    wboot1:	push	bc		;saved
    	ld	a,c
    	call	readsc		;read 1 physical sector
    	pop	bc
    	jr	nz,booter	;error?
    	inc	c		;no, next sector
    	djnz	wboot1		;until done
    	jr	gocpm
    ;
    booter:	pop	bc		;count errors
    	djnz	wboot0		;try for more
    ;
    booter0:
    	in	a,(syspb)	;fatal errors
    	set	7,a
    	out	(syspb),a	;re-activate EPROM
    	call	promout		;message via EPROM sender
    	db	0dh,0ah,'Boot Error!',0dh,0ah,04h
    	jp	monitor		;then trigger back to EPROM
    ;
    promout	equ	0fcb8h		;LBB monitor's message sender
    monitor	equ	0f800h		;LBB monitor prime entry
    ;
    ;------------------------------------------------------------
    ;
    const:	in	a,(scnta)	;Console status
    	rra
    	sbc	a,a		;a = ff, if CY = 1
    	ret
    ;
    ;
    conin:	push	hl		;console input
    	push	bc		;delays for drive turn-off
    	ld	hl,0
    	ld	b,16		;initialise: 20 secs. approx
    lp:	call	const
    	and	a		;console ready?
    	jr	nz,ex		;yes...
    	dec	hl
    	ld	a,h
    	or	l		;inner-loop count
    	jr	nz,lp
    	djnz	lp		;outer-loop count
    ;
    	in	a,(syspa)	;20 secs expired: turn off 5" drives
    	and	1 shl nmemex
    	out	(syspa),a
    w2:	call	const		;then wait on...
    	jr	z,w2
    ex:	pop	bc		;input ready
    	pop	hl
    	in	a,(sdata)
    	and	7fh		;so get it
    	ret
    ;
    conout:	in	a,(scnta)	;console output
    	bit	2,a		;tx ready?
    	jr	z,conout
    	ld	a,c
    	out	(sdata),a	;send it
    	ret
    ;
    ;-------------------------------------------------------------
    ;
    lisbuf:	db	0		;reader buffer (0 if none)
    liston:	db	5		;5= tx allowed : 1= tx prohibited
    ;
    listes:	in	a,(scntb)	;see if any input from reader/list
    	bit	2,a
    	ret	z		;no
    	in	a,(sdatb)	;yes, get it
    	and	7fh
    	ret	z		;ignore NUL
    	cp	7fh
    	ret	z		;  and DEL
    	cp	13h
    	jr	z,xoff		;filter XOFF, XON
    	cp	11h
    	jr	z,xon
    	ld	(lisbuf),a	;others => buffer
    	ret
    ;
    xoff:	ld	a,1
    	jr	xx
    xon:	ld	a,5
    xx:	ld	(liston),a	;set o/p control
    	ret
    ;
    ;
    listst:				;listing device status. Returns in a:-
    				; 00 if not ready for o/p, FF if rdy.
    			;******   Additionally, returns cy=1 if INPUT rdy.
    	call	listes
    	ld	a,(liston)	;tx permission
    	ld	b,a
    	in	a,(scntb)	;tx status
    	and	b
    	rra			;rx status in cy
    	bit	1,a		;tx status in z
    	ld	a,0		;don't change flags
    	ret	z
    	ld	a,-1
    	ret
    ;
    ;
    reader:	call	listes		;get char. from reader
    	ld	hl,lisbuf
    	ld	a,(hl)
    	and	a		;wait for something
    	jr	z,reader
    	ld	(hl),0		;clear buffer
    	ret
    ;
    ;
    list:				;list/punch output
    punch:	call	listes
    	ld	a,(liston)
    	ld	b,a
    	in	a,(scntb)
    	and	b		;tx allowed?
    	bit	2,a
    	jr	z,punch		;wait
    	ld	a,c
    	out	(sdatb),a	;then out
    	ret
    ;
    ;----------------------------------------------------------------
    ;
    home:	ld	c,0		;use track 0
    settrk:	ld	a,c		;use track (c) - 8 bits only
    	ld	(track),a
    	ld	(sektrk),a	;for 8" and 5" drivers
    	ret
    ;
    ;
    setsec:	ld	a,c		;use sector (c)
    ssc2:	ld	(seksec),a
    	ld	(sector),a
    	ret
    ;
    ;
    sectran:			;translate sector (bc), using table at (hl)
    	ld	b,0
    	ex	de,hl		;table addr. in hl
    	ld	a,h
    	or	l		;N.B. no translation if table ptr. =0
    	jr	nz,sc1
    	ld	l,c		;null function
    	jr	sc2
    ;
    sc1:	add	hl,bc		;access table
    	ld	a,(hl)		;sector
    	ld	l,a
    sc2:	ld	h,0		;return in hl
    	jr	ssc2
    ;
    ;
    setdma:	ld	(dmaadr),bc	;buffer addr. in bc
    	ret
    ;
    ;
    seldsk:	ld	hl,0		;select drive (c): DPH ptr. in HL
    	ld	a,c		;also return CYLTAB ptr. in DE
    	ld	(sekdsk),a
    	cp	3
    	jp	z,sel8		;do 8" select
    	ret	nc		;if > 3, abort
    ;
    	ld	b,h		;i.e. load zero
    	ld	hl,cyltab	;good drive, get CYLTAB ptr.
    	add	hl,bc
    	ex	de,hl		; in DE
    	add	a,a
    	add	a,a
    	add	a,a
    	add	a,a		;scale by 16 (length of DPH)
    	ld	c,a
    	ld	hl,dpbase
    	add	hl,bc		;DPH ptr. in HL
    	ret
    ;
    ;-----------------------------------------------------------------
    ;
    read:	ld	a,(sekdsk)	;read 1, 128-byte sector
    	cp	3		;8" drive?
    	jp	z,read8
    ;
    	ld	a,1
    	ld	(readop),a	;read operation
    	ld	a,wrual
    	ld	(wrtype),a	;treat as unalloc.
    	jr	alloc		;to common code
    ;
    ;
    write:	ld	a,(sekdsk)	;write 1, 128-byte sector
    	cp	3		;8" drive?
    	jp	z,wrt8
    ;
    	xor	a
    	ld	(readop),a	;not a read
    	ld	a,c		;write type in c (ex BDOS)
    	ld	(wrtype),a
    	cp	wrual		;write unallocated?
    	jr	nz,chkuna	;check for unalloc.
    ;
    ; write to unallocated: set parameters
    	ld	a,blksiz/128	;next unalloc. recs.
    	ld	(unacnt),a
    	ld	a,(sekdsk)	;drive to seek
    	ld	(unadsk),a	;unadsk := sekdsk
    	ld	a,(sektrk)
    	ld	(unatrk),a	;unatrk := sektrk
    	ld	a,(seksec)
    	ld	(unasec),a	;unasec := seksec
    ;
    chkuna:				;checks for write to unallocated sectors
    	ld	a,(unacnt)
    	or	a		;any unallocated sectors remaining?
    	jr	z,alloc		;skip if not
    ;
    ; more unallocated records remain
    	dec	a		;unacnt := unacnt - 1
    	ld	(unacnt),a
    	ld	hl,(sekdsk)	;sekdsk, sektrk
    	ld	de,(unadsk)	;unadsk, unatrk
    	sbc	hl,de		;equal? (cy=0 from "or" above)
    	jr	nz,alloc
    	ld	hl,unasec
    	ld	a,(seksec)
    	cp	(hl)		;same sector?
    	jr	nz,alloc	;skip if not same
    	inc	(hl)		;unasec := unasec + 1
    	ld	a,(hl)		;end of track?
    	cp	cpmspt		;count cp/m sectors
    	jr	c,noovf		;skip if no oflo
    ;
    ; overflow to next track
    	ld	(hl),0		;unasec := 0
    	ld	hl,unatrk
    	inc	(hl)		;unatrk := unatrk + 1
    ;
    ; match found: mark as unnecessary read
    noovf:	xor	a
    	ld	(rsflag),a
    	jr	rwoper		;to do the write
    ;
    ; not an unallocated record: requires a pre-read
    alloc:	xor	a
    	ld	(unacnt),a	;unacnt := 0
    	inc	a
    	ld	(rsflag),a	;rsflag := 1
    ;
    ;
    ; common code for read & write
    ;
    rwoper:	xor	a
    	ld	(erflag),a	;no errors (yet!)
    	ld	a,(seksec)	;compute host sector
    	rept	secshf
    	srl	a		;a shr 1: bring in zero
    	endm
    	ld	(sekhst),a	;host sector to seek
    ;
    ; active host sector?
    	ld	hl,hstact	;host-active flag
    	ld	a,(hl)
    	ld	(hl),1		;active now!
    	or	a		;was it already?
    	jr	z,filhst	;fill host if not
    ;
    ; host buffer active: same as seek buffer?
    	ld	hl,(sekdsk)	;sekdsk, sektrk
    	ld	de,(hstdsk)	;hstdsk, hsttrk
    	sbc	hl,de		;equal? (cy=0 from "or" above)
    	jr	nz,wngsec
    	ld	hl,sekhst	;use converted sector no.
    	ld	a,(hstsec)
    	cp	(hl)		;same sector too?
    	jr	z,match
    ;
    ; proper disk, but not correct sector
    wngsec:	ld	a,(hstwrt)	;host written?
    	or	a
    	call	nz,writehst	;clear host buffer
    ;
    ; may have to fill the host buffer
    filhst:	ld	hl,(sekdsk)	;sekdsk & sektrk =>
    	ld	(hstdsk),hl	; hstdsk & hsttrk
    	ld	a,(sekhst)
    	ld	(hstsec),a	;sekhst => hstsec
    	ld	a,(rsflag)	;need to read?
    	or	a
    	call	nz,readhst	;yes, if 1
    	xor	a
    	ld	(hstwrt),a	;no pending write
    ;
    match:				;copy data to/from buffer
    	ld	a,(seksec)	;mask buffer no.
    	and	secmsk		;l.s. bits
    	ld	l,0		;bits shl 7 => hl
    	srl	a
    	ld	h,a
    	rr	l		;shift right 1, ie left 7 in next byte
    	ld	de,hstbuf
    	add	hl,de		;hl := host addr.
    	ld	de,(dmaadr)	;get/put to cp/m buffer
    	ld	bc,128
    	ld	a,(readop)	;which way?
    	or	a
    	jr	nz,rwmove	;skip if read
    ;
    ; write operation: mark & switch direction
    	ld	a,1
    	ld	(hstwrt),a	;hstwrt := 1
    	ex	de,hl		;source/dest. swap
    rwmove:	ldir			;shift across
    ;
    ; data has been moved to/from host buffer
    	ld	a,(wrtype)
    	cp	wrdir		;write to directory?
    	ld	a,(erflag)	;in case errors
    	ret	nz		;no further processing
    ;
    ; clear host buffer for directory write
    	or	a		;errors?
    	ret	nz		;skip if so
    	xor	a
    	ld	(hstwrt),a	;buffer written
    	call	writehst
    	ld	a,(erflag)
    	ret
    ;
    ;--------------------------------------------------------------
    ;
    writehst:			;write 1 physical sector to host
    	push	ix
    	ld	ix,secwrt	;despatch vector
    	jr	iocom
    ;
    ;
    readhst:			;read 1 physical sector from host
    	push	ix
    	ld	ix,readsc	;despatch
    ;
    iocom:	ld	a,6		;common code for host i/o
    	ld	(erflag),a	;retry counter
    dsel:	ld	a,(hsttrk)
    	ld	d,a		;reqd. track
    	ld	a,(hstdsk)	;reqd. drive
    	call	select		;get drive: to track
    	jr	z,ic1		;go if ok
    ;
    exit:	ld	(erflag),a	;else quit
    	pop	ix
    	in	a,(syspa)
    	and	0f8h		;turn off drive LED
    	out	(syspa),a
    	ret
    ;
    ic1:	ld	a,(hstsec)	;reqd. sector
    	ld	hl,hstbuf
    	call	jpix		;to actual read or write
    	jr	z,exit		;success!
    	ld	hl,erflag
    	ld	a,3		;half retries done?
    	cp	(hl)
    	jr	nz,ic3
    	dec	(hl)		;yes, so...
    	ld	hl,cyltab
    	ld	a,(hstdsk)
    	add	a,l
    	ld	l,a
    	jr	nc,ic2
    	inc	h
    ic2:	ld	(hl),-1		;force a recalibrate
    	jr	dsel
    ;
    ic3:	dec	(hl)		;count attempts
    	jp	m,exit		;abandon
    	ld	a,stpin
    	call	func		;else, jiggle head
    	ld	a,stpout
    	call	func
    	jr	ic1		;then retry
    ;
    ;
    jpix:	jp	(ix)		;despatch to read or write
    ;
    ;
    cyltab:	db	-1,-1,-1,-1	;cylinder table / recalibrate indicators
    	$eject
    	dseg
    ;
    ;
    dirbf:	ds	128		;directory buffer
    all00:	ds	22		;allocation vectors: 5"
    all01:	ds	22
    all02:	ds	22
    chk00:	ds	16		;directory check areas
    chk01:	ds	16
    chk02:	ds	16
    ;
    hstbuf:	ds	512		;5" physical sector buffer
    dmaadr:	ds	2		;user "dma" addr.
    readop:	ds	1		;1 if read operation
    wrtype:	ds	1		;write operation type
    erflag:	ds	1		;error reporting / retry counter
    rsflag:	ds	1		;read sector flag
    unacnt:	ds	1		;unalloc. record count
    ;
    sekhst:	ds	1		;seek shr secshf
    hstact:	ds	1		;host active flag
    hstwrt:	ds	1		;host written flag
    ;
    ; following "triads" are order-sensitive
    sekdsk:	ds	1		;seek disk no.
    sektrk:	ds	1		;seek track no.
    seksec:	ds	1		;seek sector no.
    ;
    hstdsk:	ds	1		;host disk no.
    hsttrk:	ds	1		;host track no.
    hstsec:	ds	1		;host sector no.
    ;
    unadsk:	ds	1		;last unalloc. disk
    unatrk:	ds	1		;last unalloc. track
    unasec:	ds	1		;last unalloc. sector
    	end
    ;
    ;

    If you have 22DISK, and can access a copied floppy you can test the definition for me. It should
    work fine. Now 22DISK, cpmtools (cpmtools built with libdsk), libdsk, and GreaseWeazle should
    be able to work with the image files to reproduce them.

    Next, on my list is getting a good Boot Image that will Boot properly when copied with GreaseWeazle.

    Thanks.

    Larry


    cpm_source_lbb_40dsdd.zip
    Last edited by ldkraemer; May 21st, 2020 at 12:47 PM. Reason: added details & typo

  6. #6
    Join Date
    Mar 2013
    Location
    Chaffee, MO
    Posts
    1,455

    Default

    In going back over my posting I found three typo's in these definitions:
    Code:
    cpmtools definition
    maxdir 64
    
    libdsk definition
    cylinders = 40
    
    flashfloppy definition
    cyls = 40
    Larry

  7. Default

    Quote Originally Posted by LambdaMikel View Post
    Maybe another emulator has "full FreHD image compatability"?
    This should work with SDL2TRS (files "model4p_rom.bin", "hard4-0" & "hard4-1" are from Ian's site, "disk4-0" is the source disk image):
    Code:
    sdl2trs -m4p -rom model4p_rom.bin -hard0 hard4-0 -hard1 hard4-1 -disk0 disk4-0
    ... boots Montezuma CP/M from the "hard disk" and you can copy files from drive "E:" ("disk4-0") to the hard disk image (witch should work in FreHD) ...

  8. #8

    Default

    Quote Originally Posted by Jenz View Post
    This should work with SDL2TRS (files "model4p_rom.bin", "hard4-0" & "hard4-1" are from Ian's site, "disk4-0" is the source disk image):
    Code:
    sdl2trs -m4p -rom model4p_rom.bin -hard0 hard4-0 -hard1 hard4-1 -disk0 disk4-0
    ... boots Montezuma CP/M from the "hard disk" and you can copy files from drive "E:" ("disk4-0") to the hard disk image (witch should work in FreHD) ...
    Thanks! I'll give that a shot.

  9. #9

    Default

    I use a gotek and frehd in combinaison, why ? just for your question, I convert DSK files into HFE slap them on Gotek USV stick and copy the files over to the Frehd, and yes that works for LDOS. NewDos and CPM. Model 3 and 4
    Gaming: i7-8700K, 16GB, 1TB SSD, RTX 2060, Dual 27" LG IPS Monitors.
    Vintage: TRS-80 MODEL 4, 128K RAM, 360K FDD, Gotek USB FDD, FreHD HDD, RS232-WIFI MODEM, DWP-510.
    Programmer: Dell Inspiron 660S i3-3220 with 16GB Ram, running a BK-844USB & EP-2A-88.
    Web Site: https://texastandyrestoration.com/
    Facebook Page: https://www.facebook.com/TexasTandyRestorations/

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
  •