jsos

college code for operating system fundamentals in js

git clone https://9o.is/git/jsos.git

deviceDriver.js

(811B)


      1 /* ------------------------------
      2    DeviceDriver.js
      3    
      4    The "base class" (or 'prototype') for all Device Drivers.
      5    ------------------------------ */
      6 
      7 function DeviceDriver() {
      8   // Base Attributes
      9   this.version = "0.07";
     10   this.status = "unloaded";
     11   this.preemptable = false;
     12 
     13   // TODO: We will eventually want a queue for, well, 
     14   // queueing requests for this device to be handled by 
     15   // deferred proceedure calls (DPCs).
     16   // this.queue = new Queue();     
     17 
     18   // Base Method pointers.
     19 
     20   /* 
     21    * Initialization routine.  
     22    * Should be called when the driver is loaded. 
     23    */
     24   this.driverEntry = null; 
     25 
     26   /* Interrupt Service Routine */
     27   this.isr = null;            
     28 
     29   // TODO: Deferred Procedure Call routine - Start next 
     30   // queued operation on this device.
     31   // this.dpc = null;   
     32 }