Operating System Project: Disassembler and Interpreter using C

Verified

Added on  2023/06/10

|2
|626
|252
Project
AI Summary
This project details the implementation of a disassembler and an interpreter using the C programming language, specifically targeting the MAC operating system. The disassembler engine is built upon the x86 instruction set architecture, employing techniques like recursive traversal and straight range dismantling, enhanced with compiler-free heuristics to identify code bytes, dispatch tables, strings, and compiler arrangement bytes. The goal is to embed protection code into each method of the data paired, while prioritizing the preservation of original program semantics. The C interpreter is developed using a recursive-descent parser, which processes expressions through a set of mutually recursive functions. The project also addresses the crucial aspect of loading text and data into memory, explaining the sequence of events from CPU load/store instructions to memory controller operations, including virtual-to-physical address translation and cache memory access.
Document Page
Operating System
This project aims to implementing the disassembler and implementing the interpreter by
using the c programming language. The implementation of disassembler is must be run the 1.c to
7.c file and implementation of interpreter is needs to run the 1.s to 4.s file on MAC operating
system.
The disassembler engine is based on the x86 guideline set parsing and dismantling
abilities of a current disassembler. We utilize a mix of understood dismantling strategies like
recursive traversal and straight range and supplement them with compiler-free example
coordinating heuristics. We accept that the information expected in a code segment are normally
dispatch tables (address bytes), strings and compiler arrangement bytes. Since the objective of
this undertaking is to embed assurance code into each method of the information paired, we
ought to recognize whatever number code bytes as would be prudent; generally, the changed
double may have security gaps. Nonetheless, we put upkeep of unique program semantics at a
higher need than security, so at whatever point in question we check bytes as information rather
than code, along these lines staying away from perilous double instrumentation [1].
To make the C interpreter, we first develop the articulation evaluator and the bit of code
that peruses and examines articulations, the articulation parser. There are a few diverse
approaches to outline an articulation parser for C. Numerous business compilers utilize a table-
driven parser that is by and large made by a parser-generator program. While table-driven
parsers are typically speedier than different strategies, they are difficult to make by hand. For this
C translator I will utilize a recursive-plummet parser, which is basically a gathering of
commonly recursive capacities that procedure an articulation. On the off chance that the parser is
utilized as a part of a compiler, at that point its capacity is to create the best possible question
code that compares to the source code.
How do we have to load text and data to memory?
A program running on a CPU would have Load/Store directions to peruse/compose
from/to the memory. Parcel of things happens in light of the CPU write and basic equipment
microarchitecture. Following is a succession of occasions that I can list for a general
comprehension:
CPU typically has a heap store execution unit (LSU) which executes a heap/store
direction.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
For most CPU designs, there should some memory administration unit that deciphers a
program address (virtual address) to physical address) [2].
The heap/store first keeps an eye on chip reserve recollections (L1/L2/L3) if the address
is set apart as cacheable. In the event that it is a hit get to finishes there. (counting
uncommon cases with multi center CPUs where you should resolve store coherency
issues).
If not, the demand goes to a memory controller (on chip or off chip - likewise a few times
if in excess of one memory controller exists, there should be some address deciphering)
The memory controller changes over the physical deliver to a measure address in view of
what sort of measure chips are associated, takes after the measure convention (DDR2/3/4
and so forth) and does the read/compose from/to memory.
References
[1]Singh., Operating system. [Place of publication not identified]: Global Vision
Publishing, 2011.
[2]I. Kaur, Operating system. [Place of publication not identified]: I K International
Publish, 2015.
chevron_up_icon
1 out of 2
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]