





























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






























n-
Each type of event has a unique excep&on number k k = index into excep&on table (a.k.a. interrupt vector) Handler k is called each &me excep&on k occurs
excep.on open file returns int pop
excep.on: page fault Create page and returns^ load into memory movl
Excep5on Number Descrip5on Excep5on Class 0 Divide error Fault 13 General protec0on fault Fault 14 Page fault Fault 18 Machine check Abort 32-‐127 OS-‐defined Interrupt or trap 128 (0x80) System call Trap 129-‐255 OS-‐defined Interrupt or trap Check Table 6-‐1: h^p://download.intel.com/design/processor/manuals/253665.pdf
pid_t pid = fork(); if (pid == 0) { printf("hello from child\n"); } else { printf("hello from parent\n"); }
pid_t pid = fork(); if (pid == 0) { printf("hello from child\n"); } else { printf("hello from parent\n"); } Process n pid_t pid = fork(); if (pid == 0) { printf("hello from child\n"); } else { printf("hello from parent\n"); } Child Process m pid_t pid = fork(); if (pid == 0) { printf("hello from child\n"); } else { printf("hello from parent\n"); } pid = m pid_t pid = fork(); if (pid == 0) { printf("hello from child\n"); } else { printf("hello from parent\n"); } pid = 0 pid_t pid = fork(); if (pid == 0) { printf("hello from child\n"); } else { printf("hello from parent\n"); } pid_t pid = fork(); if (pid == 0) { printf("hello from child\n"); } else { printf("hello from parent\n"); } hello from parent (^) Which one is first? hello from child