caoss.simulator.os

## Class OperatingSystem

- java.lang.Object
- - caoss.simulator.os.OperatingSystem

- Direct Known Subclasses:
    FSOOS

      public abstract class OperatingSystem
      extends java.lang.Object

  Base class for the operating system implementation. The class implements the singleton pattern.
  Author:
    Herve Paulino

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static OperatingSystem` | `OS` The single instance of the operating system

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `OperatingSystem()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `decreaseNumberProcesses()`
    `abstract DeviceDriver` | `getDriver(DeviceId deviceId)` Returns the driver of the device with the given identifier
    `static OperatingSystem` | `getInstance()` Obtain the instance of the operating system
    `abstract InterruptHandler[]` | `getInterruptVector()` Retrieve the interrupt vector
    `int` | `getNumberRunningProcess()`
    `java.lang.Object` | `getRunningProcess()` Returns the Control Block of the process running in core 0
    `ProcessControlBlock` | `getRunningProcess(CPUCore cpuCore)` Returns the Control Block of the process running in the given cpu core
    `abstract Scheduler` | `getScheduler()` Returns the Operating System's scheduler
    `void` | `increaseNumberProcesses()`
    `abstract void` | `load()` Load the operating system
    `<S> void` | `setRunningProcess(CPUCore cpuCore, ProcessControlBlock<S> pcb)` Set the info that process with the given control block is running on CPU core \"cpuCore\"

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### OS

          public static final OperatingSystem OS

      The single instance of the operating system

  - ### Constructor Detail

    - #### OperatingSystem

          public OperatingSystem()

  - ### Method Detail

    - #### getInstance

          public static final OperatingSystem getInstance()

      Obtain the instance of the operating system
      Returns:
        The operating system

    - #### load

          public abstract void load()

      Load the operating system

    - #### getInterruptVector

          public abstract InterruptHandler[] getInterruptVector()

      Retrieve the interrupt vector
      Returns:
        The interrupt vector

    - #### getScheduler

          public abstract Scheduler getScheduler()

      Returns the Operating System's scheduler
      Returns:
        The scheduler

    - #### getDriver

          public abstract DeviceDriver getDriver(DeviceId deviceId)

      Returns the driver of the device with the given identifier
      Parameters:
        `deviceId` -
      Returns:

    - #### getRunningProcess

          public ProcessControlBlock getRunningProcess(CPUCore cpuCore)

      Returns the Control Block of the process running in the given cpu core
      Parameters:
        `cpuCore` - The cpu core
      Returns:
        the Process Control Block

    - #### getRunningProcess

          public java.lang.Object getRunningProcess()

      Returns the Control Block of the process running in core 0
      Returns:
        the Process Control Block

    - #### setRunningProcess

          public <S> void setRunningProcess(CPUCore cpuCore,
                                            ProcessControlBlock<S> pcb)

      Set the info that process with the given control block is running on CPU core \"cpuCore\"
      Parameters:
        `cpuCore` - The CPU core
        `pcb` - The Control Block of the process running in cpuCore

    - #### getNumberRunningProcess

          public int getNumberRunningProcess()

    - #### increaseNumberProcesses

          public void increaseNumberProcesses()

    - #### decreaseNumberProcesses

          public void decreaseNumberProcesses()