Next: Introduction
Up: Extending Sim286 to the
Previous: Contents
- Overview. This figure illustrates an overview of
the Intel family of architectures.The solid underlined features are
implemented in Sim286, the dash underlined feature is implemented
in Sim386.
Sim8088 and Sim286 accept COM input files as input;
Sim386 accepts both COM and ELF input files.
- Simx86. The original model for the x86 architecture.
- Sim8088. This figure illustrates the class diagram
for Sim8088, the simulator for the Intel 8088 processor.
- Architecture framework for Sim286.
This figure illustrates the class diagram
that describes the architecture
of Sim286, the simulator for the Intel 80286 processor.
We refer to this framework of classes as the architecture framework.
- Linking and Execution Views: This figure illustrates the format of an ELF
object file.
- The ELF Header
- The Program Header
- The Section Header
- Special Sections. A brief description of sections that can appear in an ELF object file.
- Data representation. This figure illustrates the representation
of ELF data. These data descriptions are machine independent so
that a data type that is designated as an Elf32_Half will be
the same size on all machines. An Elf32_Half might be used to represent
an unsigned short or an unsigned char on some machines.
The association between language data types and ELF data types is made in
the file
<sys/elftypes.h>.
- The Extensions to the Sim286 framework. The classes shown in bold are new classes added in Sim386. The classes that are dashed show possible future extensions.
- General Instruction Format. This format consists of one or two opcode bytes, a MOD byte, a SIB byte, an address displacement (optional), and immediate data (optional). Prefix bytes can also precede the instruction in order to override the default segment, operand, and address size used. The prefix bytes are optional.
- SIB byte. The SIB byte consists of a 2 bit scale field, a 3 bit index field, and 3 bit base field. It specifies the based indexed and scaled indexed forms of 32-bit addressing.
- Decoding SIB byte: This pseudo-code demonstrates a general method for calculating the correct address according to the field values of the SIB byte.
- The XOR Instruction: Each instruction in the Intel386 instruction set has multiple forms derived from different combinations of operands and addressing modes.
- ELF Parsing Code. This is C code that finds the text segment in an ELF executable. The portion of the file containing the text segment can be loaded using the information contained in the program header table entry and conventional file reading methods.
- Parsing the Symbol Table section of an ELF executable: This is an excerpt from code in Sim386 that finds the main and printf labels in an ELF executable.
- Symbol Table Structure
- Memory image of ELF object file: Sim386 inserts a CALL and HLT instruction in front of the text segment of the ELF executable to properly start and stop execution of the main procedure.
- Performance Results: Timings for the Sim286 and Sim386 simulators on a Test Suite of 9 programs.
- Design and Implementation History.
This figure captures the design and implementation progress from
the framework of classes for the simulators, Simx86, to
the current simulator, Sim386.
- Redesign Example: A redesign of the MemOp class
Michael L. Haungs
1998-09-21