CS 354 Operating Systems Assignment

Assignment Help Other Subject
Reference no: EM132650493

CS 354 Operating Systems - Purdue University

Lab: Interrupt Handling in XINU and Trapped System Call Implementation

Objectives

The objectives of this lab are to understand XINU's basic interrupt handling on x86 Galileo backends for synchronous interrupts: source of interrupt is an exception, also called fault, and software interrupt int. We will then utilize the int instruction to code XINU system calls as trapped calls following the classical method for implementing systems calls in Linux and Windows on x86 computers.

For the written components of the problems below, please write your answers in a file, lab2answers.pdf, and put it under lab2/. You may use any number of word processing software as long as they are able to export content as pdf files using standard fonts. Written answers in any other format will not be accepted.

Please use a fresh copy of XINU, xinu-fall2020.tar.gz, but for preserving the myhello() function from lab1 and removing all code related to xsh from main() (i.e., you are starting with an empty main()). Hence NPROC and the priority of the null process remain at their original values 100 and 0. Note that main() serves as an app for your own testing purposes. The TAs when evaluating your code will use their own main() to test your XINU kernel modifications.

3. Custom handling of divide-by-zero exception
The consequence of a process performing a divide-by-zero ALU operation is for the CPU to generate an interrupt to inform the operating system. By default, the operating system will terminate the process with the understanding that dividing by zero is a bug and continuing the process's computation is not meaningful. In this problem, we will customize the handling of the divide-by-zero exception by XINU on our x86 backends.

4. New XINU system call: uptimesec()
Implement a new XINU system call, uint32 uptimesec(void), in uptimesec.c under system/ that returns the number of seconds that have elapsed since XINU was bootstrapped on a backend. XINU keeps track of this quantity in global variable, uint32 clktime, declared in include/clock.h. clktime is maintained by XINU's clock interrupt handling code clkdisp in clkdisp.S which is installed as the 33rd entry of IDT by clkinit() during system initialization. clkinit() is called after the other entries of IDT (XINU uses 48 out of the 256 total) are initialized by initevec(). clkdisp calls C function clkhandler() in clkhandler.c which is the lower half kernel function that actually maintains clktime.

5. Trapped XINU system calls
As discussed in the lectures and evident by inspection of any XINU system call code, all XINU system calls are regular C function calls. That is, there is no special trap instruction that switches a process from user mode to kernel mode and jumps to a kernel function in the upper half of the kernel to carry out the requested service. A system call in XINU is not a wrapper function that acts as a gateway to a kernel function that actually performs the system call task. It is the actual kernel function. Isolation/protection is a core feature of general-purposes operating systems such as Linux and Windows which is necessary for reliability. It is essential for security. Not supporting isolation/protection, in computing environments where it makes sense, is the exception to the rule. In this problem, we will re-implement two XINU system calls -- legacy system call chprio() and new system call uptimesec() -- into trapped versions using a traditional technique followed by Linux and Windows for x86 machines.

Bonus problem

Extend the trapped XINU system calls to include getpid(). Place the wrapper function xgetpid() in xgetpid.c and use extended inline assembly to trap to the system call dispatcher. Assign xgetpid() system call number 9. To prevent potential issues when extending XINU to include xgetpid(), save a copy that does not include xgetpid() and maintain the extended kernel including xgetpid() separately. You can use Git, RCS, or any number of version control tools to keep track of your code. Saving earlier versions in separate folders will work as well. Test that your implementation works correctly.

Attachment:- lab.rar

Reference no: EM132650493

Questions Cloud

How is accounts receivable reported on the balance sheet : In a merchandising business, when merchandise is sold on account, a journal entry is booked to Debit to Accounts Receivable and Credit to Sales. In addition
Dot product and cross product of two vectors : What is the dot product AND cross product of these two vectors?
Explain the concept of break-even point : Explain the concept of 'break-even' point and justify your answers in requirements (a) and (c) above, with the calculation using contribution margin format
Initial angular momentum and angular speed of plate : After the ring collides with the plate, will the final angular momentum and final angular speed be more than, less than, or the same as the initial angular mome
CS 354 Operating Systems Assignment : CS 354 Operating Systems Assignment Help and Solution, Purdue University - Assessment Writing Service - Interrupt Handling in XINU and Trapped System Call
What menthod use to prepare consolidated financial statement : Non-controlling interest's share of the subsidiary's goodwill cannot be reliably determined, the method used to prepare consolidated financial statements is
How long was the package in the air : If the horizontal distance between the point of release and the point at which the package hit the ground is 685.0 m, how long was the package in the air?
Determine the total company cost in both purchase : Which bid should the Logistics Services division accept for a company as a whole? Internal bid from Forwarders Division. External bid from United Systems
Magnitude of the force by the spring on the block : When a block of mass 1 = 1 kg is attached to the end of the spring and the system is allowed to reach equilibrium, the length of the spring is 1 = 0.5 m.

Reviews

Write a Review

Other Subject Questions & Answers

  How do define the concepts of heart

What do you think they mean by that? What two concepts do the authors say these chapters emphasize? How do you define these concepts? Why do you think the autho

  Is freuds theory biased against women

Developmental psychologists study how our personality develops from birth through old age. Do you think that personality changes

  What rights would you grant to an inmate

As an administrator of a penal institution, what rights would you grant to an inmate with regard to his or her religious preference?

  How must public health agencies balance the cost of serving

How must federal, state, and local public health agencies balance the cost of serving the people with the cost of ensuring there are appropriate and effective e

  Discuss how the computer models use surface

The computer models use surface and upper-air observations to characterize current conditions

  How would that impact the need for unions

If the federal government enacted a law mandating a living wage how would that impact the need for unions

  Define what workloads you would move and why

Imagine either the company your work for or a company you are familiar with is assessing a move to the cloud. Write a memo to the CIO telling why you would.

  Legal system and classifications of criminal behavior

Discuss the legal system and classifications of criminal behavior. How would you explain the causes of child abuse and rape as a form of interpersonal violence?

  One of four coins is countefeit-is either too heavy or light

One of four coins is countefeit and is either too heavy or too light. The problem is to identify the counterfeit coin but not to determine whether it is heavy or light. What is the lower bound on the number of comparisons required to solve this probl..

  Describe factors that help promote an individuals dignity

Support individuals to eat and drink-M/601/8054-Level 2 Diploma in Health and Social Care Adults for England-Describe factors that help promote an individuals.

  Solve the problem of kim and mauborgne

Discuss why Kim and Mauborgne believe it is important to get the strategic sequence right. What order do they suggest?

  What would be the most appropriate finding for the court

Based on the facts of the case and the procedures of the juvenile justice system, what would be the most appropriate finding for the court

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd