next up previous contents
Next: Adding 32-bit processing Up: The Implementation of Sim386 Previous: The Implementation of Sim386

   
Extending the design of Sim286

To incorporate ELF binary input, we refactored the Memory class and the ProcessorSimulator Class. Both of these classes were designed to accept input in COM file format and to simulate execution in an MS-DOS type environment. The Memory and ProcessorSimulator classes are redesigned so that they are easier to extend to alternate input file formats and operating environments. The Memory class is now a base class that embodies a common interface to different types of input files. Two new classes have been added to the framework; both classes are derived from the Memory class. The first class that was added is COMMemory, which manages COM input files exactly as done in Sim286. The other class that was added, ELFMemory, manages ELF input files. We refactored the ProcessorSimulator class in a similar manner. The ProcessorSimulator class is now a base class that performs simulator initializations that are common to varying platforms. Initializations that are particular to specific platforms are incorporated into classes that are derived from ProcessorSimulator. Two classes that inherit from ProcessorSimulator are DOSProcessorSimulator and LinuxProcessorSimulator and they perform platform dependent simulator initialization. Section 3.2.3 further discusses this topic of simulator initialization. The extensions to the Sim286 class framework are illustrated in Figure 3.1. There are a number of distinct advantages that this refactoring provides:

1.
Sim386 is now extensible to alternate input object file formats such as COFF or a.out.

2.
Sim386 is also now extensible to simulating other operating environments such as Vax, Linux, and Windows NT.

3.
The class framework that we have incorporated into Sim386, enabled a change to the command line interface of the simulator that obviated recompilations for different modes of operation.


next up previous contents
Next: Adding 32-bit processing Up: The Implementation of Sim386 Previous: The Implementation of Sim386
Michael L. Haungs
1998-09-21