All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class uk.co.demon.seasip.libdsk.Geometry

java.lang.Object
   |
   +----uk.co.demon.seasip.libdsk.Geometry

public class Geometry
extends Object
The Geometry class holds information used to convert physical to/from logical sectors and to access the disc.


Variable Index

 o cylinders
Number of cylinders in this disc.
 o datarate
Data rate.
 o fm
True if this disc Uses FM recording mode.
 o fmtgap
Format gap length
 o heads
Number of heads (sides) on this disc.
 o nomulti
True to disable multitrack operation.
 o RATE_DD
Data rate for 360k 5.25" in 1.2Mb drive
 o RATE_ED
Data rate for 2.8Mb 3.5" in 3.5" drive
 o RATE_HD
Data rate for 1.4Mb 3.5" in 3.5" drive
 o RATE_SD
Data rate for 720k 3.5" in 3.5" drive
 o rwgap
Read/write gap length
 o secbase
First physical sector number.
 o secsize
Sector size in bytes.
 o sectors
Sectors per track.
 o sidedness
How to handle discs with 2 or more heads.
 o SIDES_ALT
Track n is cylinder (n/heads) head (n%heads)
 o SIDES_OUTBACK
Tracks go out and back.
 o SIDES_OUTOUT
Tracks cover all side 0, then all side 1.

Constructor Index

 o Geometry()

Method Index

 o cpm86Geometry(byte[])
Initialise this class from a CP/M-86 boot sector.
 o dg_lt2pt(int, int[])
Convert logical track to physical cylinder/head.
 o dosGeometry(byte[])
Initialise this class from a DOS boot sector.
 o ls2ps(int, int[])
Convert logical sector to physical cylinder / head /sector.
 o pcwGeometry(byte[])
Initialise this class from a PCW boot sector.
 o ps2ls(int, int, int)
Convert physical cylinder/head/sector to logical sector.
 o pt2lt(int, int)
Convert physical cylinder/head to logical track.

Variables

 o SIDES_ALT
 public static final int SIDES_ALT
Track n is cylinder (n/heads) head (n%heads)

 o SIDES_OUTBACK
 public static final int SIDES_OUTBACK
Tracks go out and back. Like this:
(head 0) 0,1,2,3,...37,38,39, then
(head 1) 39,38,37,...,2,1,0

 o SIDES_OUTOUT
 public static final int SIDES_OUTOUT
Tracks cover all side 0, then all side 1. Like this:
(head 0) 0,1,2,3,...37,38,39, then
(head 1) 0,1,2,3....37,38,39

 o RATE_HD
 public static final int RATE_HD
Data rate for 1.4Mb 3.5" in 3.5" drive

 o RATE_DD
 public static final int RATE_DD
Data rate for 360k 5.25" in 1.2Mb drive

 o RATE_SD
 public static final int RATE_SD
Data rate for 720k 3.5" in 3.5" drive

 o RATE_ED
 public static final int RATE_ED
Data rate for 2.8Mb 3.5" in 3.5" drive

 o sidedness
 public int sidedness
How to handle discs with 2 or more heads.

See Also:
SIDES_ALT, SIDES_OUTBACK, SIDES_OUTOUT
 o cylinders
 public int cylinders
Number of cylinders in this disc.

 o heads
 public int heads
Number of heads (sides) on this disc.

 o sectors
 public int sectors
Sectors per track.

 o secbase
 public int secbase
First physical sector number.

 o secsize
 public int secsize
Sector size in bytes.

 o datarate
 public int datarate
Data rate.

See Also:
RATE_DD, RATE_HD, RATE_SD, RATE_ED
 o rwgap
 public byte rwgap
Read/write gap length

 o fmtgap
 public byte fmtgap
Format gap length

 o fm
 public boolean fm
True if this disc Uses FM recording mode. The only disc I know of that are recorded in FM mode are BBC Micro DFS floppies.

 o nomulti
 public boolean nomulti
True to disable multitrack operation.

Constructors

 o Geometry
 public Geometry()

Methods

 o ps2ls
 public native int ps2ls(int cyl,
                         int head,
                         int sect) throws DskException
Convert physical cylinder/head/sector to logical sector.

Parameters:
cyl - Physical cylinder.
head - Physical head.
sect - Physical sector.
Returns:
The corresponding logical sector number.
Throws: DskException
Thrown if the cylinder, head or sector are out of range.
 o ls2ps
 public native void ls2ps(int logical,
                          int chs[]) throws DskException
Convert logical sector to physical cylinder / head /sector.

Parameters:
logical - The logical sector number to convert.
chs - An array of three integers which will receive cylinder, head and sector.
Throws: DskException
Thrown if the logical sector is out of range.
 o pt2lt
 public native int pt2lt(int cyl,
                         int head) throws DskException
Convert physical cylinder/head to logical track.

Parameters:
cyl - Physical cylinder.
head - Physical head.
Returns:
The corresponding logical track number.
Throws: DskException
Thrown if the cylinder or head are out of range.
 o dg_lt2pt
 public native void dg_lt2pt(int logical,
                             int ch[]) throws DskException
Convert logical track to physical cylinder/head.

Parameters:
logical - The logical track number to convert.
ch - An array of two integers which will receive cylinder and head.
Throws: DskException
Thrown if the track is out of range.
 o dosGeometry
 public native void dosGeometry(byte bootsect[]) throws DskException
Initialise this class from a DOS boot sector.

Parameters:
bootsect - The boot sector to read the disc geometry from
Throws: DskException
Thrown if the boot sector is not a valid DOS boot sector.
 o pcwGeometry
 public native void pcwGeometry(byte bootsect[]) throws DskException
Initialise this class from a PCW boot sector.

Parameters:
bootsect - The boot sector to read the disc geometry from
Throws: DskException
Thrown if the boot sector is not a valid PCW boot sector.
 o cpm86Geometry
 public native void cpm86Geometry(byte bootsect[]) throws DskException
Initialise this class from a CP/M-86 boot sector.

Parameters:
bootsect - The boot sector to read the disc geometry from
Throws: DskException
Thrown if the boot sector is not a valid CP/M-86 boot sector.

All Packages  Class Hierarchy  This Package  Previous  Next  Index