Lab04 Fork (revision 131002-r03KI)

  1. Open your Core Plus in Virtual Box and open Terminal. If you forgot to bring your Tiny Core ova, do Oh No! I Forgot My Ova! Procedure.
  2. Update your work directory in KELAS/NPM/ with your revision. For example, KELAS is TESTING and your NPM is 1202000818. Please change with your class and NPM.
    $ cd TESTING/1202000818/
    $ svn update
    $ UPCEK
    
  3. Get your token today in apps os.
  4. Create Lab04 directory in your KELAS/NPM's directory. All your work today must be saved into Lab04's directory.
    $ mkdir Lab04
    $ svn add Lab04
    $ svn commit -m "Lab 04 is super easy!" 
    $ cd Lab04/
  5. Take the today task with command:
    $ wget --no-check-certificate https://projects.ui.ac.id/attachments/7276/Lab04-SRC.tar.bz2
    
  6. Look for the compressed file content with command:
    $ tar tjf Lab04-SRC.tar.bz2
    
  7. Extract the compressed file with command:
    $ tar xjf Lab04-SRC.tar.bz2
    
  8. Delete Lab04-SRC.tar.bz2 with command:
    $ rm Lab04-SRC.tar.bz2
    
  9. Please edit all documents with vi
    ZCZC [TOKEN] [NPM]

    Please change [TOKEN] with your token and NPM with your student ID. For example, ZCZC 0O9GAG 1202000818.
  10. Please study all .c documents.
  11. Please compile all documents and give the same name with the .c file (ex: fork01.c becomes fork01). Hint: compile the file by using the procedures in the previous lab.
  12. Make "catat-Lab04.txt" with content:
    ZCZC [CLASS] TGS LAB04 [DATE]
    ZCZC [TOKEN] LOG [REMARKS]
    

    Change [CLASS] with your class, [DATE] with today's date (dd-mm-yyyy), [TOKEN] with your token, [REMARKS] with your short explanation, for example "I am confused.".
  13. Please capture the output in the screen while do fork's tutorial with command:
    $ script -a catat-Lab04.txt
    
  14. Please execute all programs one by one.
  15. Please make a tree as follows by modified "fork04.c".

    The process sequence must be: P1,P2,P3,P4,P5,P6
    
  16. The example of modified "fork04.c" is:
    PID P1 (Induk Proses) = 5000
    PID P2 = 5001 Lahir - PID Induk = 5000
    PID P3 = 5002 Lahir - PID Induk = 5000
    PID P4 = 5003 Lahir - PID Induk = 5002
    PID P5 = 5004 Lahir - PID Induk = 5002
    PID P6 = 5005 Lahir - PID Induk = 5003
    

    HINT
    1. Download Fork_B210 and use as source for complete the task.
    2. Use sleep() to manage the output.
  17. Compile again "fork04.c"
  18. Execute "fork04" program and put the output into fork04.txt
    $ ./fork04 > fork04.txt
    
  19. After all programs are executed, please stop the "script" program with command:
    $ exit
    
  20. Do MD5SUM.
  21. Please check and submit your work.

Back to Wiki Page