![]() |
One of the most important contributions of this work is the extension to permit Sim386 to accept ELF object files as input to the simulator. The ability of Sim386 to accept ELF files enables additional functionality to be incorporated into Sim386, for example paging and multiprogramming. The addresses used in a COM file undergo a logical to linear transformation and these linear addresses are then assumed to be the physical addresses. However, to simulate paging, linear addresses must be translated into physical addresses by utilizing page table lookup. Thus, they cannot adequately test paging or multiprogramming capabilities in, for instance, a Solaris 2.XX or Linux operating environment. Further, compilers and assemblers that can generate object files in the COM format are not readily available so that it becomes difficult to generate test programs for the simulator. Since most executables today are in ELF format, existing test suites can be used as input to the simulator.
In the next section we show, through an example, the technique for parsing an ELF object file to extract the text segment. In Section 3.3.2 we describe how to obtain the virtual address of the first instruction in the main procedure of an ELF object file and how to simulate calls to the printf function in a shared library.