Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You will create some C files that simulate the computer hardware needed to run a basic operating system. You will also define some additional C
You will create some C files that simulate the computer hardware needed to run a basic operating system. You will also define some additional C files that direct the hardware to load instruction set programs and run them. The necessary files are as follows: memory.c You will write a file called memory.c which simulates the memory of a computer. This file will contain an integer array MEM, along with the following functions: - Memory read/write is performed using data stored in the CPU registers (MAR, MBR, etc), so there are no arguments passed to the read/write functions. cpu.c You will write a file called cpu.c which simulates the CPU of a computer. This file will contain a struct called REGS, along with the following functions: The REGS struct stores the registers of the CPU. The required registers are: load.c You will write a file load.c which loads instruction set programs into memory. The file will contain the following functions: shell.c You will write a file called shell.c which provides a user interface for the simulated hardware. The file will contain the following functions: We expect the memory and the registers to be printed to the command line in a very specific way. The outputs are expected to be printed as follows: ===========================MemoryDump:K=8===========================Address:Contents0:81:642:123:74:635:226:07:08:0 computer.c You will write a file called computer.c which uses all the previous files to create a functioning system. The file will contain a struct called PCB, along with the following functions: The PCB struct stores the registers of the CPU as well as a PID (process ID) number. Requirements Your C files will need to work together to simulate an operating system that can run an instruction set program. When the program is compiled and run, the following sequence of tasks should occur: 1. Memory and CPU are initialized. Memory size should be read from "config.sys". 2. The user is prompted to enter the filename of an instruction set program, followed by a space, followed by an integer which gives the starting memory address the program will be copied to. For example: Enter filename and start address: prog1 16 3. The instruction set program file is loaded into memory. 4. A PCB is created for the loaded program which contains information about the program. 5. Some data in the PCB is copied to the CPU registers. 6. The CPU should begin execution of the loaded instruction set. 7. Once the CPU is complete exit the operating system
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