A Basic Operating System
The Basic Operating System is a C++ project that was developed while attending CSUSB. In this project, a Virtual Machine and assembler were created to preform simple tasks such as addition, subtraction, and factorial. Code was given in an assembly language type format to the assembler which then gave an object file to the Virtual Machine for execution. The Virtual Machine then wrote the output to a file.
This project was done is two phases. In the first, the basic components of the Operating System, Virtual Machine and Assembler were created. These were tested using simple incrementation problems and a basic factorial problem. In phase two, an elaboration of the OS and VM were performed to be able to compute more elaborate functions such as addition and subtraction.
Operating System
The operating system class created an instance of a Virtual Machine and an Assembler which were used to formulate and execute the code. This class was responsible for formulating a list of programs to execute in addition to managing which program was being executed at any given time.
Virtual Machine
The Virtual Machine class is responsible for the execution of code. This “machine” is required to take an object file and run the instructions until it encounter a Halt instruction or interupt. Most commonly, this was due to a time slice. However, halt interrupts could also come form errors.
Assembler
The Assembler received a program in an assembly-like structure and wrote to an object file the instruction in terms of a five digit code that was read by the Virtual Machine. The goal of this Assembler (as is any assembler) was to translate human code to machine code.