JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech II OPERATING SYSTEMS Previous Question Paper (November/December - 2020 - R16)

B.Tech | II | II | R16 | November/December - 2020

Answer PaperPaper Code: 134BUMaximum Marks: 75Time: 2 hours

Answer any Five Questions. All Questions Carry Equal Marks.

Main

1

What are system calls? Explain about the various types of systems calls used in OS.

15 marks

Answer

JNTU

B.Tech - CSE, R16

II-II Semester - OPERATING SYSTEMS

Exam Month-Year: May-2024, Max Marks: 15, Time: 3 Hours

Instructions: Answer all questions.

What are system calls? Explain about the various types of systems calls used in OS.

Marks: 15

System calls are the fundamental interface between a user program and the operating system kernel. They are special functions that a program can invoke to request services from the operating system. These services can range from simple operations like reading a file or creating a new process, to more complex tasks such as managing memory or communicating with other processes.

When a program needs to perform an operation that requires privileged access to hardware or system resources, it cannot do so directly. Instead, it makes a system call. The operating system kernel then executes the requested service on behalf of the program, ensuring that system resources are managed securely and efficiently. This mechanism provides a crucial layer of abstraction and protection, preventing user programs from interfering with each other or corrupting the operating system itself.

System calls are typically implemented as a set of library functions (e.g., in C's standard library) that wrap the actual kernel trap instructions. When a library function is called, it sets up the necessary parameters, executes a special instruction (like `INT` on x86 or `SYSCALL` on ARM) to transfer control to the kernel, and then returns the result to the calling program.

Types of System Calls:

Operating systems categorize system calls into several functional groups. The most common types are:

  • Process Control: These system calls manage the creation, termination, and execution of processes.
    • Create Process: Creates a new process.
      fork()
      exec()
      spawn()
      
    • Terminate Process: Ends the execution of a process.
      exit()
      abort()
      
    • Load/Execute Program: Loads a program into memory and executes it.
      exec()
      
    • Get Process Attributes: Retrieves information about a process (e.g., PID).
      getpid()
      getppid()
      
    • Wait for Process: Suspends the calling process until a child process terminates.
      wait()
      waitpid()
      
    • Change Process Attributes: Modifies attributes of a process.
      nice()
      
  • File Management: These calls allow processes to interact with the file system.
    • Create File: Creates a new file.
      open()
      creat()
      
    • Delete File: Deletes an existing file.
      unlink()
      remove()
      
    • Open File: Opens an existing file for reading, writing, or both.
      open()
      
    • Close File: Closes an open file.
      close()
      
    • Read File: Reads data from an open file.
      read()
      
    • Write File: Writes data to an open file.
      write()
      
    • Seek: Changes the current file position.
      lseek()
      
    • Get File Attributes: Retrieves information about a file (e.g., size, permissions).
      stat()
      fstat()
      
    • Set File Attributes: Modifies file attributes.
      chmod()
      chown()
      
  • Device Management: These calls handle interactions with hardware devices.
    • Request Device: Requests access to a device.
      open()
      
    • Release Device: Releases access to a device.
      close()
      
    • Read Device: Reads data from a device.
      read()
      
    • Write Device: Writes data to a device.
      write()
      
    • Get Device Attributes: Retrieves device status and capabilities.
      ioctl()
      
    • Attach/Detach Device: Manages device connections.
      mount()
      umount()
      
  • Information Maintenance: These calls provide system information or allow time/date manipulation.
    • Get Time or Date: Retrieves the current system time and date.
      time()
      gettimeofday()
      
    • Set Time or Date: Sets the system time and date.
      settimeofday()
      
    • Get System Information: Retrieves various system parameters (e.g., memory usage, number of processes).
      uname()
      getrusage()
      
    • Get Process File Usage: Information about resource usage by a process.
      getrusage()
      
  • Communication: These calls facilitate inter-process communication (IPC) and network communication.
    • Create/Delete Communication Connection: Establishes or removes communication channels.
      pipe()
      socket()
      
    • Send/Receive Message: Transmits or receives data between processes.
      send()
      recv()
      write()
      read()
      
    • Transfer Status Information: Shares status information.
      ioctl()
      
    • Attach/Detach Remote Device: Manages remote connections.
      mount()
      
  • Protection: These calls control access to system resources.
    • Change Protection: Modifies access permissions for files or resources.
      chmod()
      
    • Get Protection Information: Retrieves access control information.
      stat()
      
    • Grant/Revoke Privileges: Manages user or process privileges.
      setuid()
      seteuid()
      

Each type of system call serves a distinct purpose, contributing to the overall functionality and security of the operating system. Understanding these categories helps in comprehending how user programs interact with the kernel to perform essential tasks.

215 marks
a

Explain about the services of operating system.

8 marks

Answer

JNTU

OPERATING SYSTEMS

B.Tech, CSE, R16, II-II Semester

Exam Month-Year: May-2023, Max Marks: 15, Time: 3 Hours

Instructions: Answer all questions.

Explain about the services of operating system.

Marks: 8

  • The Operating System (OS) acts as an intermediary between the user and the computer hardware. It provides an environment in which a user can execute programs in a convenient and efficient manner. To achieve this, the OS performs a variety of services for users and for the system itself.
  • User Services: These services are directly provided to the user to make their interaction with the computer easier and more efficient.
    • Program Execution: The OS is responsible for loading programs into memory and executing them. It provides mechanisms for users to easily run applications.
    • I/O Operations: Every program needs I/O. The OS manages the communication between the program and the hardware devices, abstracting the complexities of direct hardware control. This includes reading from files, writing to files, and interacting with peripherals.
    • File System Manipulation: The OS provides a structured way to organize, store, retrieve, and manage files and directories. Users can create, delete, read, write, and rename files, and the OS handles the underlying disk management.
    • Communication: In a networked environment or on a multi-user system, the OS facilitates communication between different processes or users. This can involve sending and receiving messages, sharing data, or synchronizing activities.
    • Error Detection and Handling: The OS continuously monitors the system for errors, both in hardware and software. It attempts to detect errors, report them to the user or system administrator, and take appropriate recovery actions to maintain system stability.
    • Resource Allocation: The OS manages and allocates system resources such as CPU time, memory, disk space, and I/O devices among various competing processes. It ensures fair and efficient utilization of these resources.
    • Protection and Security: The OS protects the system's resources from accidental or intentional misuse. It enforces access controls, prevents unauthorized access to data and programs, and safeguards the system from malicious attacks.
  • System Services: These services are provided to the OS itself to ensure the efficient and reliable operation of the system.
    • Resource Management: This is a core function where the OS manages all hardware and software resources. It keeps track of which resources are currently being used, by whom, and for how long. It also decides which process gets which resource when, and for how long.
    • Accounting: The OS may keep track of the various attributes of active users and the processes running on the system. This information can be used for billing purposes (in commercial systems) or for performance analysis and resource optimization.
    • Efficiency: The OS aims to maximize the efficiency of the system by ensuring that resources are utilized optimally and that processes run without unnecessary delays.
    • System Calls: These are the interfaces through which user programs request services from the OS. They provide a controlled way for applications to interact with the kernel and access hardware resources.
    • Interrupt Handling: The OS handles interrupts generated by hardware devices or software events, allowing the system to respond to asynchronous events and manage concurrent operations.
b

Explain the O.S Structure.

7 marks

Answer

Sign in to view the complete answer paper.

3

Consider Five processes P1 to P5 arrived at same time. They have estimated running time 10, 2, 6, 8 and 4 seconds respectively. Their priorities are 3, 2, 5, 4 and 1 respectively with 5 being highest priority. Find the average turn around time and average waiting time for Round Robin(q=3) and priority scheduling algorithm.

15 marks

Answer

Sign in to view the complete answer paper.

4

What is Semaphore? Give the implementation of producer-consumer problem using Semaphore.

15 marks

Answer

Sign in to view the complete answer paper.

515 marks
a

Explain the concept of segmentation for memory management.

8 marks

Answer

Sign in to view the complete answer paper.

b

Explain the steps involved for handling the page fault.

7 marks

Answer

Sign in to view the complete answer paper.

615 marks
a

What is fragmentation? Explain the difference between internal and external fragmentation.

8 marks

Answer

Sign in to view the complete answer paper.

b

Explain about the structure of Page Table.

7 marks

Answer

Sign in to view the complete answer paper.

7

Consider the following disk queue with requests for I/O to blocks on cylinders 98, 183, 37, 122, 14, 124, 65, 67 in that order, using FCFS, SCAN algorithms of the disk head is initially at cylinder 53, find the total head movement in cylinders. Also provide the necessary diagram to show the head movement for the above queue.

15 marks

Answer

Sign in to view the complete answer paper.

8

What do you mean by deadlock avoidance? Explain the use of Banker’s algorithm for deadlock avoidance with illustration.

15 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the solved question paper with answers of OPERATING SYSTEMS from JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD for B.Tech CSE II II, November/December - 2020, R16.

For the question paper without answers, switch to the Question Paper tab.

Other papers in OPERATING SYSTEMS

Loading Question Papers

Fetching data from database...