>>>> "Allison" == Allison
<ajp166 at bellatlantic.net> writes:
> The other confusing point is the addressing:
logical block 0 is at
> the start of track 1, the sectors are 2:1 interleaved, and
> physical track 0 holds the LAST 10 logical sectors...
Allison> ???? CP/M disks nominally start logical block 0 after
Allison> system tracks. Dos disk are different and I never paid much
Allison> attention to them. POS for the PRO was same media but file
Allison> allocation was different again from CP/M or DOS [or RT11 and
Allison> VMS as well] on RX50.
I'm not talking about the file system, I'm talking about block
numbering -- the linear block numbers (0 to 799) which sit underneath
the file systems. All the DEC PDP11 and VAX OSs use linear block
addressing; the sector/track/cylinder structure of the drives exists
below the file system only, and is mapped to LBA by the disk device
driver.
For example, on all disks, LBA 0 is the boot block.
Ok, so where physically is LBA 0? On most disks it is cyl 0 track 0
sec 0. But not on the RX50; there it is cyl 1 track 0 sec 0.
So what LBA lives on cyl 0 track 0 sec 0? Answer: I'm getting too
confused in the arithmetic, but it's an LBA in the range 790 to 799.
With the MSCP controllers used on most PDP11s and VAXen, this cruft is
in the controller microcode. In the PRO, it lives in the OS (in the
RX50 driver). Quuoting from the driver I wrote for RSTS:
;+
; Read/Write requests
; Compute the physical disk address and issue the I/O
;-
70$: MOV R0,R5 ;;Save Queue root pointer ;002
CLR R0 ;;High order LBN is zero ;002
MOV DSQPDA(R4),R1 ;;Get LSB of starting LBN
DIV #10.,R0 ;; Divide for: R0=track, R1=sector (0-9.)
CMP #4,R1 ;; Set C=1 (BLO=BCS) for 5 <= sector <= 9.
ROL R1 ;; Sector * 2 (+1 if C set) = [2:1] interleave
ADD R0,R1 ;; Adjust for a 3 sector skew between
ADD R0,R1 ;; tracks by adding track *2. (R1/10. below)
INC R0 ;; Bump track number ;002
CMP #80.,R0 ;; Valid track? ;002
BHI 80$ ;; Yes, and not last (C = 0) ;002
BEQ 75$ ;; Yes, last one ;004
MOV #DQS$DZ,R0 ;; Get queue root pointer ;004
SETERR PRVIOL,DSQERR(R4) ;; Error = illegal disk address ;004
JMP DZDONE ;; and exit with error ;004
75$: ADD #-80.,R0 ;; Last, so adjust to track 0 (C for side 2)
80$:
So there you have the mapping in all its horrific glory...
paul