Operating Systems 2014F: Assignment 4

From Soma-notes
Revision as of 14:45, 26 September 2014 by Soma (talk | contribs) (→‎Questions)

This assignment is not yet finalized (REALLY)

Please submit the answers to the following questions via CULearn by midnight on Wednesday, October 1, 2014. There 10 points in ?? questions.

Submit your answers as a single text file named "<username>-comp3000-assign4.txt" (where username is your MyCarletonOne username). The first four lines of this file should be "COMP 3000 Assignment 4", your name, student number, and the date of submission. You may wish to format your answers in Markdown to improve their appearance.

No other formats will be accepted. Submitting in another format will likely result in your assignment not being graded and you receiving no marks for this assignment. In particular do not submit an MS Word or OpenOffice file as your answers document!

Don't forget to include what outside resources you used to complete each of your answers, including other students, man pages, and web resources. You do not need to list help from the instructor, TA, or information found in the textbook.

Questions

  1. [1] What is the difference between function calls and library calls?
  2. [2] In assembly, how does a program make a function call (using C semantics)? Describe the process and state the specific instructions used in x86 assembly code.
  3. [3] Write a program "syscall-hello-pid.c" that is based on syscall-hello.c but outputs "Hello, I am process 417!" (assuming the PID of the process running it is 417). Note that you will have to get the current process ID, convert it to a string, and combine it with the "Hello" string. USE NO LIBRARY FUNCTIONS except syscall().