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

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

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