nl.kbna.dioscuri.module.bios
Class BIOS

java.lang.Object
  extended by nl.kbna.dioscuri.module.Module
      extended by nl.kbna.dioscuri.module.ModuleBIOS
          extended by nl.kbna.dioscuri.module.bios.BIOS

public class BIOS
extends ModuleBIOS

An implementation of a hardware BIOS module. Contains: - 64 KB of ROM - CMOS settings

See Also:
Metadata module ******************************************** general.type : bios general.name : BIOS ROM general.architecture : Von Neumann general.description : General implementation of BIOS ROM chip. general.creator : Tessella Support Services, Koninklijke Bibliotheek, Nationaal Archief of the Netherlands general.version : 1.0 general.keywords : bios, ROM, 64KB, 32KB, bootstrap, system bios, video bios, optional rom general.relations : cpu, memory general.yearOfIntroduction : general.yearOfEnding : general.ancestor : general.successor : bios.romsize : 64 + 32 KB bios.settings : CMOS Notes: none

Field Summary
private  boolean debugMode
           
private  Emulator emu
           
private  boolean isObserved
           
private static java.util.logging.Logger logger
           
static int MODULE_ID
           
static java.lang.String MODULE_NAME
           
static java.lang.String MODULE_TYPE
           
private  java.lang.String[] moduleConnections
           
private  byte[] optionalROM
           
private static int SYSTEMBIOS_ROM_SIZE
           
private  byte[] systemROM
           
private static int VIDEOBIOS_ROM_SIZE
           
private  byte[] videoROM
           
 
Constructor Summary
BIOS(Emulator owner)
          Class constructor
 
Method Summary
 java.lang.String[] getConnection()
          Returns a String[] with all names of modules it needs to be connected to
 byte[] getData(Module requester)
          Returns data from this module
 boolean getDebugMode()
          Returns the status of the debug mode toggle
 java.lang.String getDump()
          Returns a dump of this module
 int getID()
          Returns the ID of the module
 java.lang.String getName()
          Returns the name of the module
 byte[] getSystemBIOS()
          Returns the system BIOS code from ROM with size of SYSTEM_BIOS_ROM_SIZE
 java.lang.String getType()
          Returns the type of the module
 byte[] getVideoBIOS()
          Returns the Video BIOS code from ROM
 boolean isConnected()
          Checks if this module is connected to operate normally
 boolean isObserved()
          Returns the status of observed toggle
 boolean reset()
          Reset all parameters of module.
 boolean setConnection(Module module)
          Sets up a connection with another module
 boolean setData(byte[] data, Module sender)
          Set data for this module
 boolean setData(java.lang.String[] data, Module sender)
          Sets given String[] data for this module
 void setDebugMode(boolean status)
          Sets the debug mode toggle
 void setObserved(boolean status)
          Sets the observed toggle
 boolean setSystemBIOS(byte[] biosCode)
          Sets the system BIOS code in ROM Note: System BIOS must be exactly 64 KB
 boolean setVideoBIOS(byte[] biosCode)
          Sets the Video BIOS code in ROM
 void start()
          Starts the module
 void stop()
          Stops the module
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

emu

private Emulator emu

moduleConnections

private java.lang.String[] moduleConnections

isObserved

private boolean isObserved

debugMode

private boolean debugMode

systemROM

private byte[] systemROM

videoROM

private byte[] videoROM

optionalROM

private byte[] optionalROM

logger

private static java.util.logging.Logger logger

MODULE_ID

public static final int MODULE_ID
See Also:
Constant Field Values

MODULE_TYPE

public static final java.lang.String MODULE_TYPE
See Also:
Constant Field Values

MODULE_NAME

public static final java.lang.String MODULE_NAME
See Also:
Constant Field Values

SYSTEMBIOS_ROM_SIZE

private static final int SYSTEMBIOS_ROM_SIZE
See Also:
Constant Field Values

VIDEOBIOS_ROM_SIZE

private static final int VIDEOBIOS_ROM_SIZE
See Also:
Constant Field Values
Constructor Detail

BIOS

public BIOS(Emulator owner)
Class constructor

Method Detail

getID

public int getID()
Returns the ID of the module

Specified by:
getID in class Module
Returns:
string containing the ID of module
See Also:
Module

getType

public java.lang.String getType()
Returns the type of the module

Specified by:
getType in class Module
Returns:
string containing the type of module
See Also:
Module

getName

public java.lang.String getName()
Returns the name of the module

Specified by:
getName in class Module
Returns:
string containing the name of module
See Also:
Module

getConnection

public java.lang.String[] getConnection()
Returns a String[] with all names of modules it needs to be connected to

Specified by:
getConnection in class Module
Returns:
String[] containing the names of modules, or null if no connections

setConnection

public boolean setConnection(Module module)
Sets up a connection with another module

Specified by:
setConnection in class Module
Parameters:
mod - Module that is to be connected to this class
Returns:
true if connection has been established successfully, false otherwise
See Also:
Module

isConnected

public boolean isConnected()
Checks if this module is connected to operate normally

Specified by:
isConnected in class Module
Returns:
true if this module is connected successfully, false otherwise

reset

public boolean reset()
Reset all parameters of module. BIOS ROM is not reset. ROM will keep all BIOS ROM data.

Specified by:
reset in class Module
Returns:
boolean true if module has been reset successfully, false otherwise

start

public void start()
Starts the module

Specified by:
start in class Module
See Also:
Module

stop

public void stop()
Stops the module

Specified by:
stop in class Module
See Also:
Module

isObserved

public boolean isObserved()
Returns the status of observed toggle

Specified by:
isObserved in class Module
Returns:
state of observed toggle
See Also:
Module

setObserved

public void setObserved(boolean status)
Sets the observed toggle

Specified by:
setObserved in class Module
Parameters:
status -
See Also:
Module

getDebugMode

public boolean getDebugMode()
Returns the status of the debug mode toggle

Specified by:
getDebugMode in class Module
Returns:
state of debug mode toggle
See Also:
Module

setDebugMode

public void setDebugMode(boolean status)
Sets the debug mode toggle

Specified by:
setDebugMode in class Module
Parameters:
status -
See Also:
Module

getData

public byte[] getData(Module requester)
Returns data from this module

Specified by:
getData in class Module
Parameters:
Module - requester, the requester of the data
Returns:
byte[] with data
See Also:
Module

setData

public boolean setData(byte[] data,
                       Module sender)
Set data for this module

Specified by:
setData in class Module
Parameters:
byte[] - containing data
Module - sender, the sender of the data
Returns:
true if data is set successfully, false otherwise
See Also:
Module

setData

public boolean setData(java.lang.String[] data,
                       Module sender)
Sets given String[] data for this module

Specified by:
setData in class Module
Parameters:
String[] - data
Module - sender, the sender of the data
Returns:
true if data is set successfully, false otherwise
See Also:
Module

getDump

public java.lang.String getDump()
Returns a dump of this module

Specified by:
getDump in class Module
Returns:
string
See Also:
Module

getSystemBIOS

public byte[] getSystemBIOS()
Returns the system BIOS code from ROM with size of SYSTEM_BIOS_ROM_SIZE

Specified by:
getSystemBIOS in class ModuleBIOS
Returns:
byte[] biosCode containing the binary code of BIOS

setSystemBIOS

public boolean setSystemBIOS(byte[] biosCode)
                      throws ModuleException
Sets the system BIOS code in ROM Note: System BIOS must be exactly 64 KB

Specified by:
setSystemBIOS in class ModuleBIOS
Parameters:
byte[] - biosCode containing the binary code of BIOS
Returns:
true if BIOS code is of specified SYSTEMBIOS_ROM_SIZE and store is successful, false otherwise
Throws:
ModuleException

getVideoBIOS

public byte[] getVideoBIOS()
Returns the Video BIOS code from ROM

Specified by:
getVideoBIOS in class ModuleBIOS
Returns:
byte[] biosCode containing the binary code of Video BIOS

setVideoBIOS

public boolean setVideoBIOS(byte[] biosCode)
                     throws ModuleException
Sets the Video BIOS code in ROM

Specified by:
setVideoBIOS in class ModuleBIOS
Parameters:
byte[] - biosCode containing the binary code of Video BIOS
Returns:
true if BIOS code is of specified VIDEOBIOS_ROM_SIZE and store is successful, false otherwise
Throws:
ModuleException