Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The purpose of this assignment is to give you some experience with working at the lower level of the operating system. In this assignment you
The purpose of this assignment is to give you some experience with working at the lower level of
the operating system. In this assignment you will run, observe, and study a simple XOS that
controls a X CPU simulator,
You should download a package xsimoszipfromthecoursewebsite.Thispackagecontains
the source code and utilities needed to complete this assignment.
Background
Suppose we have a simplified RISCbased bit XCPU, which has general purpose registers
and a couple of special registers, such as the program counter PC the status state
interrupt table ITR registers. Also, this X Architecture comprises KB bytes memory
space with addresses ranging from to According to the von Neuman architecture, CPU X
takes one cycle to execute any instruction, executing a standard Fetch, Decode, Execute.
The XOS Kernel
The current OS is nave operating system almost doing nothing p As discussed in class,
operating systems need support from the hardware to facilitate interaction between processes, users,
and devices. The general mechanism that facilitates these interactions is the interrupt. The
interrupt could come from an IO device, a system call, a trap, or a fault, depending on its origin.
An interrupt table vector allows the CPU to invoke an appropriate interrupt handler when an
interrupt occurs.
Once the XOS system is initialized, CPU starts its cycles. Meanwhile, it is ready for serving
incoming interrupts.
The XSimulator xsim
The XSimulator, xsim, emulates a basic computer featuring a soft CPU. It is designed to allocate
a memory space of load a "binary" file into this space, and initiate execution from the address
x The content of this "binary" file within the memory has a kernel and various user processes.
To execute a program, the XSimulator employs a XCPU simulation function soft CPU which
iteratively performs cycles involving fetching, decoding, and executing instructions indicated by
the Program Counter PC The execution continues for a specified number of ticks cycles or until
the program either halts the XCPU intentionally or if the XCPU encounters an illegal operation.
For example, the following is the way to let simulator to execute the binary file in cycles,
rsim xos
where sim is the simulator program, which requires two parameters: a cycle number and a binary
filename. In the example above, they are and respectively.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started