Шукаєте відповіді та рішення тестів для Operating Systems Even Sem 24-25? Перегляньте нашу велику колекцію перевірених відповідей для Operating Systems Even Sem 24-25 в moodle.coep.org.in.
Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!
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);}
Is the terminal a part of the kernel on GNU/Linux systems?
How does the distinction between kernel mode and user mode function as a rudimentary form of protection (security) ?
Order the following events in boot process (from 1 onwards)
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 exec1cc 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.
Select all the correct statements about two modes of CPU operation
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