GoConqr has a new look! Let us know what you think.

Quiz

osstudy1

Kevin T 200 questions

Take the quiz

Questions in this quiz (200)

  1. 1According to file-io.pdf from Week 5, which answer choice is called after all I/O has been completed, in order to release the file descriptor fd and its associated kernel resources?
    1. Astatus = close(fd)
    2. Bfd = open(pathname, flags, mode)
    3. Cnumread = read(fd, buffer, count)
    4. Dnumwritten = write(fd, buffer, count)
    5. EThere is no answer choice that has that behavior
  2. 2According to Dr. Grant's lecture on September 27, 2022 (processes-ia.pdf), which of the following statements about the process control block (PCB) are NOT true?
    1. ACan control the entire operating system's information
    2. BContains the process elements
    3. CPossible to interrupt a running process and later resume execution
    4. DCreated and managed by the operating system
    5. EKey tool that allows support for multiple processes
  3. 3According to Table 3.2 in processes-i.pdf from Week 6, which of these is NOT a reason for process termination?

    1. ANew batch job
    2. BI/O failure
    3. CParent request
    4. DInvalid Instruction
  4. 4According to Dr. Grant’s week 6 presentation and lecture “Processes”, which of the following is true?
    1. AVariables that are defined within contexts are stored on the stack and will be there until we free it
    2. BVariables stored on the heap are only alive within the context of the function
    3. CIf you create something dynamically within a function, it would still exist once we leave the context of that function
    4. DGlobal variables are stored in the same place as local variables (stack and heap)
  5. 5According to Dr. Grant's lecture 12, what will be the output of the following code?

    #include <stdio.h>
    #include <string.h>

    int main() {
    unsigned char str[] = {'s', 't', 'r', 'i', 'n', 'g', '\0'};
    printf("%s", str);
    printf("%lu",strlen(str));
    printf("%lu",sizeof(str));
    return 0;
    }
    1. Astring67.
    2. Bstring66.
    3. Cstring77.
    4. Dstring76.
    5. Egnirts67.
  6. 6According to Dr. Grant's lecture on processes-i on September 27th, what mode are Unix SVR4's system processes run?
    1. Akernel mode
    2. Buser mode
    3. Cexecution mode
    4. Dstate mode
    5. Eprogram mode
  7. 7During Dr. Grant's lecture on September 27th [Processes-i], which of the following variables is a string literal?
    1. Achar *name = "name";
    2. Bchar name[4] = {"n","a","m","e"};
    3. Cstring name = "name";
    4. Dchar name[4] = "name";
  8. 8In Dr. Grants lecture 10 & 12 (File io) & (Project 0 tips) from week 5 & 6, The GNU Debugger (GDB) was discussed and used to debug a segmentation fault. What command can be used in GDB to enter the Text User Interface to see your code while you debug it?
    1. ATUI enable
    2. BTUI disable
    3. Cbreak
    4. Dnext or n
    5. Erun or r
  9. 9According to the processes-i.pdf from Week 6, what should be inserted into the given field in the following code to successfully let both parent and child run their corresponding code and keep track of the child?

    pid_t childPid;

    switch({CODE TO INSERT}) {

    case -1:

    /* Handle errors */

    case 0:

    /*Perform child actions*/

    default:

    /* Perform parent actions */

    }
    1. AchildPid = fork()
    2. BparentPid = fork()
    3. Cfork()
    4. DchildPid
  10. 10According to syscall lecture from Week 5, which answer is not correct about syscall process?
    1. AEach sys call is referenced by same number
    2. BThere is one common entry point for all system calls: this is done through the sys call "trap" instruction
    3. CEach has its own set of argument to be transferred
    4. DThe trap instruction switches the processor state from user to kernel mode
    5. EThe trap handler function then translates the sys call number into an appropriate function call

Information

Description
GRE OS study 2 Quiz on osstudy1, created by Kevin T on 15/11/2022.
Author
Kevin T
Language
English
Views
15
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?