Jawaharlal Nehru Technological University Hyderabad

Jawaharlal Nehru Technological University Hyderabad B.Tech IV Year REAL TIME SYSTEMS Previous Question Paper (February/March - 2022 - R18)

B.Tech | IV Year | I Semester | R18 | February/March - 2022

Answer PaperPaper Code: 157DJMaximum Marks: 75Time: 3 Hours

Answer Any Five Questions. All Questions carry equal marks.

Main

115 marks
a

Give the correct syntax of read() and write() system calls and explain.

7 marks

Answer

The read() and write() system calls are fundamental primitives in Unix-like operating systems for performing I/O operations on file descriptors.

  • read() System Call: Used to read data from a file descriptor into a buffer.
  • ssize_t read(int fd, void *buf, size_t count);
  • Parameters:
    • fd: The file descriptor associated with the file to read from.
    • buf: A pointer to the memory buffer where the read data will be stored.
    • count: The maximum number of bytes to read.
  • Return Value: Returns the number of bytes read on success, 0 on end-of-file, or -1 on error.
  • write() System Call: Used to write data from a buffer to a file descriptor.
  • ssize_t write(int fd, const void *buf, size_t count);
  • Parameters:
    • fd: The file descriptor associated with the file to write to.
    • buf: A pointer to the buffer containing the data to be written.
    • count: The number of bytes to write from the buffer.
  • Return Value: Returns the number of bytes written on success, or -1 on error.
b

Write a C program to copy the content of one file to another file using relevant system calls.

8 marks

Answer

The following C program demonstrates file copying using the open(), read(), write(), and close() system calls.

#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>

int main() {
    int fd_src, fd_dest;
    char buffer[1024];
    ssize_t n;

    fd_src = open("source.txt", O_RDONLY);
    if (fd_src < 0) { perror("Error opening source"); return 1; }

    fd_dest = open("dest.txt", O_WRONLY | O_CREAT | O_TRUNC, 0644);
    if (fd_dest < 0) { perror("Error opening destination"); return 1; }

    while ((n = read(fd_src, buffer, sizeof(buffer))) > 0) {
        write(fd_dest, buffer, n);
    }

    close(fd_src);
    close(fd_dest);
    return 0;
}

Note: The O_CREAT flag creates the destination file if it does not exist, and O_TRUNC clears existing content.

215 marks
a

Discuss the various status flags and file modes associated with an open( ) and creat( ) system calls.

7 marks

Answer

Sign in to view the complete answer paper.

b

Write the syntax of exec() family of system calls and explain any two of them.

8 marks

Answer

Sign in to view the complete answer paper.

315 marks
a

How the priority based preemptive based scheduling is different from the round-robin scheduling? Explain briefly.

7 marks

Answer

Sign in to view the complete answer paper.

b

Give a detail note on various parameters, states and data structures associated with a task in ROTS.

8 marks

Answer

Sign in to view the complete answer paper.

415 marks
a

Describe the key characteristics of an Real Time Operating System.

7 marks

Answer

Sign in to view the complete answer paper.

b

What is a Message Queue? Explain various message queue operations.

8 marks

Answer

Sign in to view the complete answer paper.

515 marks
a

Explain various operations that can be performed on a pipe.

7 marks

Answer

Sign in to view the complete answer paper.

b

What is an event register? List and give the description of various entries in event control block.

8 marks

Answer

Sign in to view the complete answer paper.

615 marks
a

Give a detail note on file-system component and remote procedure call component.

7 marks

Answer

Sign in to view the complete answer paper.

b

Explain briefly about Port-Mapped I/O, Memory-Mapped I/O and DMA.

8 marks

Answer

Sign in to view the complete answer paper.

715 marks
a

State the need of Programmable Interval Timer. Explain the steps in servicing the timer interrupt.

7 marks

Answer

Sign in to view the complete answer paper.

b

Describe the model for implementing a soft timer handling facility.

8 marks

Answer

Sign in to view the complete answer paper.

8

How to schedule tasks in MicroC/OS-II? Explain in detail with an 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 REAL TIME SYSTEMS from Jawaharlal Nehru Technological University Hyderabad for B.Tech CSE IV Year I Semester, February/March - 2022, R18.

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

Other papers in REAL TIME SYSTEMS

Loading Question Papers

Fetching data from database...