You are reading a sector that is empty but formatted with the usual E5. Try reading other sectors that contain data.
You are reading a sector that is empty but formatted with the usual E5. Try reading other sectors that contain data.
Hi,
I'm trying to read a physical disk to get an image of the disk
I have changed the first couple of bytes of the image to identify the
disk, but I still get E5s.
As a test, I'm trying to read just the very first sector off the disk, I
do:
LD C,4 ; select drive E:
LD A,9 ; SELDSK
CALL BIOS
LD BC,0 ; Set Track 0
LD A,10 ; SETTRK
CALL BIOS
LD BC,1H ; Set Sector 1
LD A,11 ; SETSEC
CALL BIOS
LD BC,buffer
LD A,12 ; SETDMA
CALL BIOS
LD A.13 ; READ
CALL BIOS
Then I dump the first 16 bytes of the data but it is all E5s
What am I doing wrong here?
Neither the SELDSK nor the READ report an error.
I also tried Sector 11H as ZSystem uses this as the first sector number
of a track.
Thanks,
Josef
NB This is on an SB180FX which has a hard disk occupying drives A..D,
then a GoTek floppy emulator as floppy drive 0/drive E:, a 3½" drive as drive 1/F: and a 5¼" drive as drive 2/G:.
================2a15 1a LD A,(DE)
2a16 00 NOP
Hi,4 is not E: 0 is default, 1 is A: and 5: is E:
I'm trying to read a physical disk to get an image of the disk
I have changed the first couple of bytes of the image to identify the
disk, but I still get E5s.
As a test, I'm trying to read just the very first sector off the disk, I do: LD C,4 ; select drive E:
LD A,9 ; SELDSK
CALL BIOS
LD BC,0 ; Set Track 0
LD A,10 ; SETTRK
CALL BIOS
LD BC,1H ; Set Sector 1
LD A,11 ; SETSEC
CALL BIOS
LD BC,buffer
LD A,12 ; SETDMA
CALL BIOS
LD A.13 ; READ
CALL BIOS
Then I dump the first 16 bytes of the data but it is all E5s
What am I doing wrong here?
Neither the SELDSK nor the READ report an error.
I also tried Sector 11H as ZSystem uses this as the first sector number
of a track.
Thanks,
Josef
NB This is on an SB180FX which has a hard disk occupying drives A..D,
then a GoTek floppy emulator as floppy drive 0/drive E:, a 3½" drive as drive 1/F: and a 5¼" drive as drive 2/G:.
Hi,My bad... these are BIOS calls - 4 *is* E:
I'm trying to read a physical disk to get an image of the disk
I have changed the first couple of bytes of the image to identify the
disk, but I still get E5s.
As a test, I'm trying to read just the very first sector off the disk, I do: LD C,4 ; select drive E:
LD A,9 ; SELDSK
CALL BIOS
LD BC,0 ; Set Track 0
LD A,10 ; SETTRK
CALL BIOS
LD BC,1H ; Set Sector 1
LD A,11 ; SETSEC
CALL BIOS
LD BC,buffer
LD A,12 ; SETDMA
CALL BIOS
LD A.13 ; READ
CALL BIOS
Then I dump the first 16 bytes of the data but it is all E5s
What am I doing wrong here?
Neither the SELDSK nor the READ report an error.
I also tried Sector 11H as ZSystem uses this as the first sector number
of a track.
Thanks,
Josef
NB This is on an SB180FX which has a hard disk occupying drives A..D,
then a GoTek floppy emulator as floppy drive 0/drive E:, a 3½" drive as drive 1/F: and a 5¼" drive as drive 2/G:.
Am 03/18/2022 11:21 AM, Josef Moellers schrieb:
Hi,
I'm trying to read a physical disk to get an image of the disk
I have changed the first couple of bytes of the image to identify the
disk, but I still get E5s.
As a test, I'm trying to read just the very first sector off the disk, I
do:
LD C,4 ; select drive E:
LD A,9 ; SELDSK
CALL BIOS
LD BC,0 ; Set Track 0
LD A,10 ; SETTRK
CALL BIOS
LD BC,1H ; Set Sector 1
LD A,11 ; SETSEC
CALL BIOS
LD BC,buffer
LD A,12 ; SETDMA
CALL BIOS
LD A.13 ; READ
CALL BIOS
Then I dump the first 16 bytes of the data but it is all E5s
What am I doing wrong here?
Neither the SELDSK nor the READ report an error.
I also tried Sector 11H as ZSystem uses this as the first sector number
of a track.
Thanks,
Josef
NB This is on an SB180FX which has a hard disk occupying drives A..D,
then a GoTek floppy emulator as floppy drive 0/drive E:, a 3½" drive as
drive 1/F: and a 5¼" drive as drive 2/G:.
You don't call SECTRAN, so the sector number is "physical",
it can be any number the hardware needs to get.
You need to find out this physical sector number first and
pass that to SETSEC.
There is a very good sector editor called "the disk inspector",
which just didn't work on my 0-based system.
This program is *so* useful, I had to look inside and came up
with a quick and dirty patch to fix it.
Here is the relevant part of the code disasssembled.
I hope, you can read it and peruse the modification I made.
$ cat INFO_inspect_2.x_self_adapting_sector_number_base_fix.diffs ================
INFO: VERSION 2.1: ADDRESS 226a
INFO: VERSION 2.1: ADDRESS 281f
INFO: VERSION 2.2: ADDRESS 2a15
================
================
INFO: SELECT DISK AND FILL SECTOR DESCRIPTOR RECORD
INFO: IY: ADDRESS OF SECTOR DESCRIPTOR FOR
INFO: UPPER SECTOR (015eh)/LOWER SECTOR (0177h)
INFO: +00h: DRIVE
INFO: +01h/02h: TRACK
INFO: +03H/04H: SECTOR
INFO: +05H/06H: BLOCK
INFO: +07H/08H: ALV
INFO: +09H: SELECTED DRIVE
INFO: +0ah/0bH: CKS
INFO: +0ch/0dH: LAST TRACK + 1
INFO: +0eh/0fh: SPT
----
29e6 fd 4e 00 LD C,(IY+00) ;DISK DRIVE
29e9 00 NOP ;UNKNOWN PATCHED OUT
29ea 00 NOP
29eb 00 NOP
29ec 1e 01 LD E,001 ;NOT FIRST SELECT
29ee 21 1b 00 LD HL,001b ;SELECT DISK DRIVE
29f1 cd 54 0d CALL 0d54 ;CALL BIOS
29f4 16 00 LD D,000
29f6 1e 00 LD E,000
29f8 b7 OR A
29f9 ed 5a ADC HL,DE
29fb ca a0 2a JP Z,2aa0 ;SELECT ERROR
29fe e5 PUSH HL
29ff dd e1 POP IX ;DPH PTR IN IX
2a01 dd 5e 00 LD E,(IX+00) ;XLT (OR 0000h)
2a04 dd 56 01 LD D,(IX+01)
2a07 fd 73 12 LD (IY+12),E
2a0a fd 72 13 LD (IY+13),D
2a0d af XOR A ;LOWEST SECTOR NUMBER
2a0e fd 77 17 LD (IY+17),A
2a11 7a LD A,D
2a12 b3 OR E
2a13 28 05 JR Z,2a1a ;NO TRANSLATION
================
INFO: OLD: HARD CODED SECTOR NUMBER BASE 01H
<<< 2a15 3e 01 LD A,001
================
INFO: NEW: ASSUME XLT STARTS WITH THE LOWEST SECTOR NUMBER
INFO: NEW: USE IT AS SELF-ADAPTING SECTOR NUMBER BASE
================2a15 1a LD A,(DE)
2a16 00 NOP
2a17 fd 77 17 LD (IY+17),A
2a1a dd 5e 0e LD E,(IX+0e) ;ALV
2a1d dd 56 0f LD D,(IX+0f)
2a20 fd 73 07 LD (IY+07),E
2a23 fd 72 08 LD (IY+08),D
2a26 dd 5e 0a LD E,(IX+0a) ;DPB
2a29 dd 56 0b LD D,(IX+0b)
2a2c d5 PUSH DE
2a2d dd e1 POP IX ;DPB PTR IN IX
2a2f dd 7e 00 LD A,(IX+00) ;SPT
2a32 fd 77 0e LD (IY+0e),A
2a35 dd 7e 01 LD A,(IX+01)
2a38 fd 77 0f LD (IY+0f),A
2a3b dd 7e 0d LD A,(IX+0d) ;OFF
2a3e fd 77 14 LD (IY+14),A
2a41 dd 7e 0e LD A,(IX+0e)
2a44 fd 77 15 LD (IY+15),A
2a47 dd 7e 02 LD A,(IX+02) ;BSH
2a4a fd 77 16 LD (IY+16),A
2a4d dd 7e 05 LD A,(IX+05) ;DSM
2a50 fd 77 10 LD (IY+10),A
2a53 dd 7e 06 LD A,(IX+06)
2a56 fd 77 11 LD (IY+11),A
2a59 fd 46 16 LD B,(IY+16) ;BSH
2a5c fd 66 11 LD H,(IY+11) ;DSM
2a5f fd 6e 10 LD L,(IY+10)
2a62 23 INC HL ;#BLOCKS
2a63 29 ADD HL,HL
2a64 10 fd DJNZ 2a63
2a66 7c LD A,H
2a67 b5 OR L
2a68 20 03 JR NZ,2a6d
2a6a 21 ff ff LD HL,ffff ;FFFF, IF (1)0000H
2a6d fd 56 0f LD D,(IY+0f) ;SPT
2a70 fd 5e 0e LD E,(IY+0e)
2a73 01 00 00 LD BC,0000
2a76 03 INC BC ;CALC #TRACKS
2a77 ed 52 SBC HL,DE
2a79 28 02 JR Z,2a7d
2a7b 30 f9 JR NC,2a76
2a7d c5 PUSH BC
2a7e e1 POP HL ;#TRACKS
2a7f fd 56 15 LD D,(IY+15) ;OFF
2a82 fd 5e 14 LD E,(IY+14)
2a85 af XOR A
2a86 ba CP D
2a87 20 06 JR NZ,2a8f
2a89 3e 04 LD A,004
2a8b bb CP E
2a8c 38 01 JR C,2a8f
2a8e 19 ADD HL,DE ;IF OFF<=0004H ADD OFF
2a8f fd 75 0c LD (IY+0c),L
2a92 fd 74 0d LD (IY+0d),H
2a95 fd 7e 00 LD A,(IY+00) ;DISK DRIVE
2a98 32 a9 2a LD (2aa9),A
2a9b fd 77 09 LD (IY+09),A ;DRIVE
2a9e af XOR A ;NO ERROR
2a9f c9 RET
2aa0 3e ff LD A,0ff ;INVALID
2aa2 32 a9 2a LD (2aa9),A
2aa5 3e 02 LD A,002 ;ERROR #2
2aa7 b7 OR A
2aa8 c9 RET
================
On 18.03.22 19:47, Martin wrote:
Am 03/18/2022 11:21 AM, Josef Moellers schrieb:
Hi,
I'm trying to read a physical disk to get an image of the disk
I have changed the first couple of bytes of the image to identify the
disk, but I still get E5s.
As a test, I'm trying to read just the very first sector off the disk, I >>> do:
LD C,4 ; select drive E:
LD A,9 ; SELDSK
CALL BIOS
LD BC,0 ; Set Track 0
LD A,10 ; SETTRK
CALL BIOS
LD BC,1H ; Set Sector 1
LD A,11 ; SETSEC
CALL BIOS
LD BC,buffer
LD A,12 ; SETDMA
CALL BIOS
LD A.13 ; READ
CALL BIOS
Then I dump the first 16 bytes of the data but it is all E5s
What am I doing wrong here?
Neither the SELDSK nor the READ report an error.
I also tried Sector 11H as ZSystem uses this as the first sector number
of a track.
Thanks,
Josef
NB This is on an SB180FX which has a hard disk occupying drives A..D,
then a GoTek floppy emulator as floppy drive 0/drive E:, a 3½" drive as >>> drive 1/F: and a 5¼" drive as drive 2/G:.
You don't call SECTRAN, so the sector number is "physical",
it can be any number the hardware needs to get.
Hm, here's something I don't understand:
The native floppy format of the SB180FX is 5spt, 1024bps, the first
physical sector on each track being 11H.
If I issue a READ, I get "only" 128 bytes. I have to issue 40 READs with increasing sector numbers (0..39) until I get an error reported back
from READ, register A being non-0 on return from "CALL BIOS", a function
in syslib.
So the sector number that I pass to SETSEC cannot be a "number the
hardware needs to get". These would be 11H..15H.
Also, I do not specify the head, so I assume that the least significant
bit in the track number is the head number.
You need to find out this physical sector number first and
pass that to SETSEC.
As the GoTec adapter has no disk rotating, my disk images are just
logical linear dumps of the disks (*). Therefore, I have not specified
any skew factor.
I think I will need to adapt my code when I read from a physical floppy
disk. My intention of this whole game is to store all physical floppy
disks as images on the USB stick and not need the old drives ever again.
There is a very good sector editor called "the disk inspector",
which just didn't work on my 0-based system.
The SB180FX came with DU3, a "Disk Utility".
I have the CP/M CDROM from Walnut Creek which has SRW150.LBR,
"Memory/Disk inspector/modifier", is this what you refer to?
This program is *so* useful, I had to look inside and came up
with a quick and dirty patch to fix it.
Here is the relevant part of the code disasssembled.
I hope, you can read it and peruse the modification I made.
I'll have a look, thanks.
Josef
(*) Those I produced using the SB180FX monitor driven by an PERL/EXPECT script: in a PERL loop: starting with sector 1, read the next sector to 8000H, then dump 8000,83FF.
You don't call SECTRAN, so the sector number is "physical",
it can be any number the hardware needs to get.
Hm, here's something I don't understand:
The native floppy format of the SB180FX is 5spt, 1024bps, the first
physical sector on each track being 11H.
If I issue a READ, I get "only" 128 bytes. I have to issue 40 READs with
increasing sector numbers (0..39) until I get an error reported back
from READ, register A being non-0 on return from "CALL BIOS", a function
in syslib.
So the sector number that I pass to SETSEC cannot be a "number the
hardware needs to get". These would be 11H..15H.
Also, I do not specify the head, so I assume that the least significant
bit in the track number is the head number.
The value passed to SETSEC then is a value which makes it easier
for the BIOS to translate to the final physical value
in the deblocking routine.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (0 / 16) |
Uptime: | 120:03:24 |
Calls: | 6,704 |
Calls today: | 4 |
Files: | 12,235 |
Messages: | 5,349,614 |