Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

Assignment No. 01 Semester: Fall 2014 CS604 –Operating System Due Date: 14/11/2014

Question 2: (5 Marks)

 

Some computer systems do not provide a privileged mode (either user mode or kernel mode) of operation in hardware. Is it possible to construct a secure operating system for these computer systems? Write the name of the most secure operating system and justify your answer with solid reasons also tell either it is possible or not.

 

NOTE: Do not put any query on MDB about this assignment, if you have any query then email at cs604@vu.edu.pk.

Views: 9128

Attachments:

Replies to This Discussion

  1. Which of the following instructions should be privileged?

    a) Set value of timer
    b) Read the clock
    c) Clear memory
    d) Turn off interrupts
    e) Switch from user to monitor mode

    Set value of timer: Yes, otherwise the user program can manipulate it such that the OS never gains control

    Read the Clock: No, as a user can't really do anything harmful by simply reading the clock.

    Clear Memory: Yes, since a user program shouldn't be able to clear arbitrary memory. (Exception: No, if interpreted as simply clearing memory belonging to the process.)

    Turn off interrupts: Yes, same reasoning as for setting the value of the timer.

    Switch from user to monitor mode: Yes, since otherwise a user program could simply switch to kernel mode to execute instructions it wouldn't otherwise be able to, and defeat security.

yup now the idea is clear for the question # 1 but how should we answer this question means format to answer this question...
these privileged instruction are allowed by?? 
kya hamien mode name batana ho ga ?

I think we have to tell whether the instruction for given choice is 

Privileged

or

non privileged/ user

yeah ryt

kia kal ki extended date ho gi is assignment klea????

yeah

Q 2

We can do this by following methods:

 

  1. a.      Software interpretation: software interpretation of all user programs like some:
  • BASIC
  • APL
  • LISP

 

 

  1. b.      Program requirement:

All the programs must be written in high level languages, in this way all object code is compiler-produced. 

Instructions Name

Privileges allowed by:

Set values of time

privileged

Read the Clock

Unprivileged

Clear memory

privileged

Memory address

Unprivileged

System Call

Unprivileged

Issue trap instructions

Unprivileged

Turn off interrupts

privileged

Modify entries in device-status table

privileged

Switch from user to kernel mode

Unprivileged

Access I/O device

privileged

 Q.2 

The main mechanism in which the operating system is able to assert and limit control to hardware resources while servicing user-level programs comes from the ability to classify certain instructions as being privileged and others as being non-privileged. The privileged instructions (often kernel code / system calls) are unbounded by what they can do and thus they can only be executed in privileged mode. Non-privileged instructions on the other hand are necessarily constrained by what they can do and it is this distinction in mode of execution at the hardware level that enables the operating system at the software level to very strictly control and limit what the user-level code is able to do and thus by doing so it is able to secure / restrict access to the resources that it is managing.


So ,does this mean then in a system where there is no distinction in the priviledge level of an instruction, that it is not possible to have a secure operating system ? Not necessarily. The same mechanism described above which exists at the hardware level can be emulated in software. The way this would work is that on startup the operating system startups and loads itself. Then say, that it gave the user a prompt to execute any program. The operating system since it is the first software to be running still has complete control and as such it can decide to execute the user-program in any manner it sees fit. To securely execute the user-program (and prevent it from taking over the entire system if the program were malicious for example) it can first scan the entire program (or portions of it) and check to see if the program performs any unauthorized action or perhaps a privileged action other than what is allowed through the system-call interface. If this is the case, i.e. the program is malicious, the operating system can refuse to run it. In essence, we can think of the operating system as attempting to run the program in an entirely separate emulated machine so that it will still always be able to maintain actual control of the real hardware. Obviously, such a system will be inefficient and slow as there is a lot of overhead involved. Furthermore, the complexity of implementing such a system almost certainly means that the operating system is very likely to be less secure in terms of vulnerability likely present in the system everything else being equal. One example of a such a system is the Java Virtual Machine (JVM). Despite decades of development time, every other month or so, there are often security vulnerability found in Java that would allow malicious Java program to break free of the JVM sandbox.

Q2.Some computer systems do not provide a privileged mode of operation in hardware. Is it possible to construct a secure operating system for these computers? Give arguments both that it is and that it is not possible.
=================================== Ans

1.One method is to write a simulator for a dual-mode processor.

2.Another is to rely upon safe languages. Only executing user programs written in a safe language such as Java will work, since the language properties guarantee that arbitrary writes to memory aren't allowed and the instruction set is limited.

Instructions Name

Privileges allowed by:

Set values of time

privileged

Read the Clock

Unprivileged

Clear memory

privileged

Memory address

Unprivileged

System Call

Unprivileged

Issue trap instructions

Unprivileged

Turn off interrupts

privileged

Modify entries in device-status table

privileged

Switch from user to kernel mode

Privileged

Access I/O device

privileged

Is it right?

RSS

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service