-
Notifications
You must be signed in to change notification settings - Fork 16
/
globals.js
62 lines (45 loc) · 1.73 KB
/
globals.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/* ------------
Globals.js
Global CONSTANTS and _Variables.
(Global over both the OS and Hardware Simulation / Host.)
This code references page numbers in the text book:
Operating System Concepts 8th edition by Silberschatz, Galvin, and Gagne. ISBN 978-0-470-12872-5
------------ */
//
// Global CONSTANTS
//
var APP_NAME = "AlanBBOS"; // 'cause I was at a loss for a better name.
var APP_VERSION = "0.07"; // What did you expect?
var CPU_CLOCK_INTERVAL = 100; // This is in ms, or milliseconds, so 1000 = 1 second.
var TIMER_IRQ = 0; // Pages 23 (timer), 9 (interrupts), and 561 (interrupt priority).
// NOTE: The timer is different from hardware/host clock pulses. Don't confuse these.
var KEYBOARD_IRQ = 1;
//
// Global Variables
//
var _CPU = null;
var _OSclock = 0; // Page 23.
var _Mode = 0; // 0 = Kernel Mode, 1 = User Mode. See page 21.
var _Canvas = null; // Initialized in hostInit().
var _DrawingContext = null; // Initialized in hostInit().
var _DefaultFontFamily = "sans"; // Ignored, I think. The was just a place-holder in 2008, but the HTML canvas may have use for it.
var _DefaultFontSize = 13;
var _FontHeightMargin = 4; // Additional space added to font size when advancing a line.
// Default the OS trace to be on.
var _Trace = true;
// OS queues
var _KernelInterruptQueue = null;
var _KernelBuffers = null;
var _KernelInputQueue = null;
// Standard input and output
var _StdIn = null;
var _StdOut = null;
// UI
var _Console = null;
var _OsShell = null;
// At least this OS is not trying to kill you. (Yet.)
var _SarcasticMode = false;
// Global Device Driver Objects - page 12
var krnKeyboardDriver = null;
// For testing...
var _GLaDOS = null;