logo

Crowdly

Browser

Add to Chrome

Operating Systems Even Sem 24-25

Looking for Operating Systems Even Sem 24-25 test answers and solutions? Browse our comprehensive collection of verified answers for Operating Systems Even Sem 24-25 at moodle.coep.org.in.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

Predict the output of the program given here.

Assume that all the path names for the programs are correct. For example "/usr/bin/echo" will actually run echo command.

Assume that there is no mixing of printf output on screen if two of them run concurrently.

In the answer replace a new line by a single space.

For example::

good

output

should be written as good output

--

main() {

    int i;

    i = fork();

    if(i == 0)

        execl("/usr/bin/echo", "/usr/bin/echo", "hi", 0);

    else

        wait(0);

    fork();

    execl("/usr/bin/echo", "/usr/bin/echo", "one", 0);

}

View this question
Compare multiprogramming with multitasking
0%
0%
View this question
View this question

Is the terminal a part of the kernel on GNU/Linux systems?

0%
0%
View this question

How does the distinction between kernel mode and user mode function as a rudimentary form of protection (security) ?

0%
0%
0%
0%
View this question

Order the following events in boot process (from 1 onwards)

View this question

Consider the following programs

exec1.c

#include <unistd.h>

#include <stdio.h>

int main() {

    execl("./exec2", "./exec2", NULL);   

}

exec2.c

#include <unistd.h>

#include <stdio.h>

int main() {

    execl("/bin/ls", "/bin/ls", NULL);   

   printf("hello\n");

}

Compiled as

cc     exec1.c   -o exec1

cc     exec2.c   -o exec2

And run as

$ ./exec1

Explain the output of the above command (./exec1)

Assume that /bin/ls , i.e. the 'ls' program exists.

0%
0%
0%
0%
0%
View this question

Select all the correct statements about two modes of CPU operation

0%
0%
0%
0%
0%
View this question

Consider the two programs given below to implement the command (ignore the fact that error checks are not done on return values of functions)

$ ls . /tmp/asdfksdf >/tmp/ddd 2>&1

Program 1

int main(int argc, char *argv[]) {

    int fd, n, i;

    char buf[128];

    fd = open("/tmp/ddd", O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);

    close(1);

    dup(fd);

    close(2);

    dup(fd);

    execl("/bin/ls", "/bin/ls", ".", "/tmp/asldjfaldfs", NULL);

}

Program 2

int main(int argc, char *argv[]) {

    int fd, n, i;

    char buf[128];

    close(1);

    fd = open("/tmp/ddd", O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);

    close(2);

    fd = open("/tmp/ddd", O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);

    execl("/bin/ls", "/bin/ls", ".", "/tmp/asldjfaldfs", NULL);

}

Select all the correct statements about the programs

0%
0%
0%
0%
0%
0%
0%
0%
0%
View this question
A process blocks itself means
0%
0%
0%
0%
View this question

Want instant access to all verified answers on moodle.coep.org.in?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome