jmce - 1_02

jmce.sim.disk
Class DirDiskCPM

java.lang.Object
  extended by jmce.sim.AbstractHardware
      extended by jmce.sim.AbstractPeripheral
          extended by jmce.sim.disk.AbstractDisk
              extended by jmce.sim.disk.MemoryDisk
                  extended by jmce.sim.disk.DirDiskCPM
All Implemented Interfaces:
Disk, DiskCPM, Hardware, Peripheral

public class DirDiskCPM
extends MemoryDisk
implements DiskCPM

Directory disk in CP/M format.

This class implements a special disk mapped to one directory and created in memory on the fly.

Files on the root directory are mapped to user 0 other users 1 ... 15 are mapped in sub directories name with the user name. For example if the root directory is disks the file WS.COM for the user 0 will be read/write from disks/WS.COM and for the user 1 disks/1/WS.COM

When the simulator is stopped if the property @see #setRO is set to false the file are written back in the directory.

If a special file name BOOTLOADER.BIN is present in the directory it will be written in the reserved track.

File attribute.

File attribute (ReadOnly,Global and Archive) are stored in the local file system in a file name .NAME and contain the letter R for read only, G for global and A for archive. So if the file WS.COM must be read only in the local file system must exist a file named .WS.COM with the LETTER R in the first line.

Properties

Version:
1.01
Author:
Mario Viara

Field Summary
 
Fields inherited from class jmce.sim.disk.AbstractDisk
buffer, head, mounted, numHead, numSector, numTrack, readOnly, sector, sectorSize, track
 
Fields inherited from class jmce.sim.AbstractPeripheral
cpu
 
Fields inherited from interface jmce.sim.Disk
ERROR, ERROR_SEEK, ERROR_WRITE_PROTECT
 
Constructor Summary
DirDiskCPM()
           
 
Method Summary
 void destroy()
          Destroy the device.
 java.lang.String getDirectory()
           
 DPB getDPB()
          Return the current DPB.
 boolean getVolatile()
           
 void init(Hardware parent)
          During the init process the disk must be mounted because the mount use disk access and the automatic mount occours when the emulated operating system acces the disk and this can cause race condition.
 boolean mount()
          Mount the disk.
 void mountDir(java.lang.String s, int u)
          Mount one single directory
 void setDirectory(java.lang.String s)
           
 void setDPB(DPB dpb)
          Set the DPB
 void setVolatile(boolean mode)
           
 java.lang.String toString()
           
 
Methods inherited from class jmce.sim.disk.MemoryDisk
read, write
 
Methods inherited from class jmce.sim.disk.AbstractDisk
dismount, format, getBuffer, getDiskSize, getDiskSizeString, getHead, getNumHead, getNumSector, getNumTrack, getReadOnly, getSector, getSectorSize, getTrack, isMounted, read, read, setHead, setMounted, setNumHead, setNumSector, setNumTrack, setReadOnly, setSector, setSectorSize, setTrack, write, write
 
Methods inherited from class jmce.sim.AbstractPeripheral
idle, registerCPU, setIdle, setLive
 
Methods inherited from class jmce.sim.AbstractHardware
addHardware, createFrame, getHardware, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareForName, getHardwareInstances, getHardwareTree, getName, getParent, initSwing, removeHardware, removeHardware, reset, setHardware, setHardware, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jmce.sim.Disk
dismount, format, getBuffer, getHead, getNumHead, getNumSector, getNumTrack, getReadOnly, getSector, getSectorSize, getTrack, isMounted, read, setHead, setNumHead, setNumSector, setNumTrack, setReadOnly, setSector, setSectorSize, setTrack, write
 
Methods inherited from interface jmce.sim.Peripheral
idle, registerCPU
 
Methods inherited from interface jmce.sim.Hardware
addHardware, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareInstances, getHardwareTree, getName, getParent, initSwing, removeHardware, removeHardware, reset, setHardware, setHardware, setName
 

Constructor Detail

DirDiskCPM

public DirDiskCPM()
Method Detail

setDPB

public void setDPB(DPB dpb)
Description copied from interface: DiskCPM
Set the DPB

Specified by:
setDPB in interface DiskCPM
Parameters:
dpb - - New dpb for this disk.
See Also:
DPB

setDirectory

public void setDirectory(java.lang.String s)

getDPB

public DPB getDPB()
Description copied from interface: DiskCPM
Return the current DPB.

Specified by:
getDPB in interface DiskCPM
See Also:
DPB

getDirectory

public java.lang.String getDirectory()

getVolatile

public boolean getVolatile()

setVolatile

public void setVolatile(boolean mode)

init

public void init(Hardware parent)
          throws SIMException
During the init process the disk must be mounted because the mount use disk access and the automatic mount occours when the emulated operating system acces the disk and this can cause race condition.

Specified by:
init in interface Hardware
Overrides:
init in class AbstractHardware
Parameters:
parent - Parent of this hardware.
Throws:
SIMException

destroy

public void destroy()
             throws SIMException
Description copied from interface: Hardware
Destroy the device. This method can be called only one time

Specified by:
destroy in interface Hardware
Overrides:
destroy in class AbstractHardware
Throws:
SIMException

mountDir

public void mountDir(java.lang.String s,
                     int u)
              throws java.lang.Exception
Mount one single directory

Throws:
java.lang.Exception

mount

public boolean mount()
              throws SIMException
Description copied from interface: Disk
Mount the disk.

Specified by:
mount in interface Disk
Overrides:
mount in class MemoryDisk
Returns:
true if the disk is correctly mounted.
Throws:
SIMException

toString

public java.lang.String toString()
Overrides:
toString in class MemoryDisk

jmce - 1_02