A sic based Virtual Machine




Download 165.92 Kb.
NameA sic based Virtual Machine
page1/4
A typeBibliography
manual-guide.com > manual > Bibliography
  1   2   3   4
SICvm:

A SIC based Virtual Machine

Prepared By

Anoop U.Thomas, Hari Sankar S, V. Hariharan and Santhosh N.Raju

Computer Science and Engineering,

College of Engineering,

Trivandrum,

Kerala,

India – 695004

Table Of Contents


  1. Synopsis

  2. An Introduction to Emulation, Simulation and Virtualization

    1. Emulation

    2. Virtual Machines & Virtualization

    3. Simulators

  3. A Background on SIC

  4. The SIC Machine Specifications

  5. Structure of SICvm

    1. The CPU

    2. The Memory Subsystem

    3. The I/O Subsystem

  6. Interrupt Handling in SICvm

  7. The SICvm Architecture

  8. The Working of SICvm

  9. The Assembler

  10. The Bootstrapping Process

  11. The SIC Loader

  12. The SIC Shell

  13. A Sample SIC Program

  14. Features Supported by SICvm

  15. Conclusion

  16. Bibliography

1


2










5

6

7










16

18

19

21

22

25

29

33

36

37

38

I. Synopsis
With the advent of faster processors and larger memory sizes for cheaper prices even at the reach of an average home user, the concept of virtualization has taken a new turn.
Virtualization is the process by which multiple computers are emulated within a single computer. This includes full scale emulation of a computer including the processor, memory, storage and the various peripherals that are present in an actual computer. Such emulation gives the user the ability to run multiple operating systems simultaneously in real time.
With virtualization one can add / remove hardware, run multiple operating systems like windows and linux side by side etc on the individual virtual machines without the need of switching off or restarting the actual computer hence reducing maintenance cost, development cost, hardware cost etc.
A Virtual Machine consists of the Virtual Machine Monitor and the Virtual Machine itself. The Virtual Machine Manages the guest Operating System and the Virtual Machine Monitor manages the Virtual Machines.
In our project we wish to model a Virtual Machine based on a Simplified Instructional Computer (SIC). The Machine will emulate all the hardware of a SIC and will be able to run any program that is written for the SIC. As for the Virtual Machine Monitor we currently intend to use the host operating system.
We wish to extend this idea to a SIC/XE machine architecture if possible so that it can run a minimal Operating System. We also intend to use this machine as a VM modeling tool for the development of actual existing machines.
Project Requirements:
Operating System: Linux / Windows

Programming Language: C

Tools Required: gcc, make, gdb, grep etc...

Editors: emacs, vi
II. An Introduction to Emulation, Simulation and Virtualization
a. Emulation

A software emulator allows computer programs to run on a platform (computer architecture and/or operating system) other than the one for which they were originally written. Unlike a simulation, which only attempts to reproduce a program's behavior, emulation generally attempts to model to various degrees the state of the device being emulated.
A hardware emulator is a hardware that can run programs for the original hardware without any modification or hardware that has exactly the same function as the original hardware. Example: Printer Emulator (inside the ROM of the printer), FPGA based emulator.
A popular use of emulators is to mimic the experience of running arcade games or console games on Linux, Mac OS X, and Microsoft Windows. Emulating these on modern desktop computers is usually less cumbersome than relying on the original machines. However, software licensing issues may require emulator authors to write original software that duplicates the functionality of the original computer's bootstrap ROM and BIOS, often through high-level emulation.
b. Virtual Machines and Virtualization

The term virtual machine is now also used to refer to the environment created by an emulator, where software is used to emulate an operating system for the end user. This is done to allow applications written for one OS to be executed on a machine which runs a different OS; or to provide execution "sandboxes" which provide a greater level of isolation between processes than is achieved when running multiple processes on the same instance of an OS.

Virtualization is the process by which one is able to run multiple operating systems on a single machine. This is similar to multitasking except that one does the multitasking with the operating systems. That is different Operating Systems on the same system at the same time. With Virtualization one can multitask between operating systems with ease.
In a theoretical sense, the Church-Turing thesis [TOC, Hopcroft & Ullmann] implies that any operating environment can be emulated within any other. In practice, it can be quite difficult, particularly when the exact behavior of the system to be emulated is not documented and has to be deduced through reverse engineering. It also says nothing about timing constraints; if the emulator does not perform as quickly as the original hardware, the emulated software may run much more slowly than it would have on the original hardware.

This can be done using three major ways:

  • Full Virtualization — the virtual machine simulates the complete hardware, allowing an unmodified OS for a completely different CPU to be run.



  • Paravirtualization — the virtual machine does not simulate hardware but instead offers a special API that requires OS modifications.



  • Native Virtualization — the virtual machine only partially simulates enough hardware to allow an unmodified OS to be run in isolation, but the guest OS must be designed for the same type of CPU.

In order to achieve Virtualization we need to have two things.


  • A Virtual Machine (VM)

  • A Virtual Machine Monitor (VMM)


Virtual Machine (VM): Is the heart and soul of Virtualization. It emulates the required necessary machine features so that we can have a virtual computer within a computer. The virtual machine emulates everything that a normal computer would do. This is the part that hosts the guest operating systems on the target machine.
Virtual Machine Monitor (VMM): This is the more complicated part of the Virtualization process. Current generation VMs are supported by the host computer’s Operating System and these operating systems act as the VMM. The VMM’s main job is to realize the requests generated by each of the VM and process them accordingly so that one VM does not interfere with another. In near future we can see VMMs that are exclusive to handle VM at hardware level. Such a VMM will be nothing more than a highly specialized operating system that exclusively supports running of VM and manages them.
Technologies like Intel Vanderpool Technology and AMD Pacifia Technology aim at bringing virtualization to hardware level and hence avoid hassles of current generation of Software Virtualization Solutions provided by companies like VMware.
Advantages of Virtualization

  • Running of Multiple OS (like Windows and Linux) without conflicting behaviour

  • Test and Validation of OS under development hence avoiding any permanent damage to hardware

  • Saving time and money in development costs

  • Emulation of Hardware as of yet unavailable or rare or expensive

  • Efficient and fast recovery from System Crashes, Virus attacks etc


Issues Facing Virtualization

  • As of now Software Virtualization is a very resource consuming affair

  • Open Source Virtualization Projects are not very friendly at supporting non open source Operating systems

  • Hardware Level Virtualization is still under development

  • Wide level hardware emulation (e.g. emulating PowerPC (Mac Architecture) on a x86 (Intel and AMD) platforms) is still difficult and not all features are supported.



c. Simulation
Simulation is an attempt to imitate functions of a device. Rather than imitating the real hardware it just simulates the functions of the device. In computer programming, a simulator is often used to execute a program that has to run on some inconvenient type of computer.
For example, a program imitating the Pacman arcade hardware and running real Pacman ROM on it is an emulator. A Pacman game written for your computer but using graphics similar to the real arcade is a simulator.
One of the main differences between a VM and a Simulator is that a VM emulates a given computer system with a specific hardware such that it is like running that very computer but in a simulator we only get a sense of the hardware and actual computer system is not emulated. E.g.: An 8085 based Virtual Machine will have a BIOS, Bootloader, an OS Loader etc which in turn can emulate a full computer with 8085 processor, along with various attached peripherals like HDD, FDD etc with individual emulation for each. But in case of a 8085 Simulator one just has a 8085 based system being simulated on a GUI but does not have advanced features like memory management, peripheral handling etc

III. A Background on SIC
SIC stands for Simplified Instructional Computer (SIC) that is used to present fundamental software concepts. The Machine is a theoretical Machine described in the book “System Software” by “Leland L.Beck”. Many advanced details of machines are omitted in order to explain the working of various features of a machine in simpler detail.
One of the major advantages of such an approach is that it is easy to explain the details of system level softwares like Assemblers, Loaders, Linkers etc based on a simplified Architecture. And the idea can be extended to any other actual existing machine by extending the features of the SIC machine. There by adding or removing the features from the SIC assembler we can get the required target machine assembler.
Why choose SIC to make a VM?
This is one major question that arises when we consider this project. One of the things we found during the preliminary analysis of the project was that we couldn’t find a proper simplified basis for representing a VM for development purposes. The open source counterparts where a bit too complex and not well documented eg: bochs, Xen etc.
Another problem that we faced was during the course of our course history. We had to study about SIC and develop programs like assemblers, loaders etc but had no place to test or execute the programs developed. Most of the time the ordeal ended with obtaining an object code or showing the possible memory locations where the object programs where loaded.
Hence we decided to develop a SIC based Virtual Machine so that we can achieve the above two goals. As a part of this achieving this goal we wish to submit this project to College of Engineering, Trivandrum. So that students in the following semester will have a better chance of seeing their code work and improve the features of the SIC we implement.

IV. THE SIC Machine Specifications


  1. Memory:

    1. Word size: 3 bytes (24 bits)

    2. Total size: 32,768 bytes (215). Thus any memory address will need at most 15 bits to be referenced ('almost' four hex characters).




  1. Registers:

    1. Total Registers: Five

      1. Accumulator (A): Used for most of the operations (number 0)

      2. Index (X): Used for indexed addressing (number 1)

      3. Linkage (L): Stores return addresses for JSUB (number 2)

      4. Program Counter (PC): Address for next instruction (number 8)

      5. Status Word (SW): Information and condition codes (number 9).




  1. Instruction Formats:

    1. Only one instruction format of 24 bits (3 bytes / 1 word)

    2. Opcode: First 8 bits, direct translation from the Operation Code Table

    3. Flag (x): next bit indicates address mode (0 direct - 1 indexed)

    4. Address: next 15 bits indicate address of operand according to address mode.




  1. Addressing Modes:

    1. Only two possible addressing modes

      1. Direct (x = 0): operand address goes as it is

      2. Indexed (x = 1): value to be added to the value stored at the register x to obtain real address of the operand.




  1. Assembler Considerations:

    1. Operation code gets translated directly from table (no need to check other bits)

    2. x bit dependant on the addressing mode of the operand. If indexed the code will have to indicate it with \,X" after the operand name (i.e. BUFFER,X)

    3. The last 3 hex digits of the address will remain the same, the first hex digit (leftmost) will change if the address is indexed (first bit becomes one, thus the hex digit increases by 8). i.e., if the address of the operand is 124A and the addressing is indexed, the object code will indicate 924A.


V. The Structure of SICvm
Typically, an emulator is divided into modules that correspond roughly to the emulated computer's subsystems. Most often, an emulator will be composed of the following modules:

  • a CPU emulator or CPU simulator (the two terms are mostly interchangeable)

  • a memory subsystem module

  • various I/O devices emulators

Almost all of the Machine Instruction etc are implemented in the file “sic.c”
a. The CPU
Registers
Each Register in SIC is emulated by declaring it as a Variable.
//Registers in SIC

int A; //Accumulator

int X; //Index Register

int L; //Linkage Register

int PC; //Program Counter

int SW; //Status Word
Fetch and Store
The CPU accomplishes the basic fetch and store routine through two C functions called fetch() and store() respectively. The working of the two will be explained in detail in the memory subsystem.
The Basic CPU functioning is implemented using the following algorithms
The Fetch Cycle
All instruction execution starts off with a fetch. Fetches are of 3 different types and is dependent upon from where the fetch is called. After fetching the opcode, it’s type is identified and then an operand fetch is performed. After which it is executed.
  1   2   3   4

Share in:

Related:

A sic based Virtual Machine iconAbstract This guide demonstrates how to use Windows PowerShell to...

A sic based Virtual Machine iconAbstract This guide helps you become familiar with Hyper-V™ by providing...

A sic based Virtual Machine iconStandard industrial classification (sic) codes

A sic based Virtual Machine iconAn abstract from Dr. Berkley's [sic] Treatise on tar-water

A sic based Virtual Machine icon26th June 2009 – for immediate release Enquiries: Chris Pockett (01453...

A sic based Virtual Machine iconAlert!alert!alert! You are not automatically enrolled in any of the...

A sic based Virtual Machine iconJacks Hitler (Everyones Nigtmare, sic). balack woodaka000@hotmail...

A sic based Virtual Machine iconBiometric finger print based electronic voting system for rigging...

A sic based Virtual Machine iconWinftp a winSock-based ftp client for Windows 1 and Windows/NT. Written...

A sic based Virtual Machine iconWhat are virtual manipulatives and their usefulness?

A sic based Virtual Machine iconInstalling Virtual Genesys 6

A sic based Virtual Machine iconVirtual dj for android apk

A sic based Virtual Machine icon1The Virtual Observatory

A sic based Virtual Machine iconQuick Sheet for Virtual hp-12C

A sic based Virtual Machine iconThe Virtual Hypertension Clinic -vhc

A sic based Virtual Machine icon2. 6 Virtual Keyboard & Front Panel 34

A sic based Virtual Machine iconEdibon data acquisition system/virtual

A sic based Virtual Machine iconVirtual Reality: Past, Present and Future

A sic based Virtual Machine iconPollen: Virtual Networks That Use People as Carriers

A sic based Virtual Machine iconResearch highlights benefits of virtual worlds 14




manual




When copying material provide a link © 2017
contacts
manual-guide.com
search