COMP3000 Operating Systems W22: Tutorial 2: Difference between revisions
Lianyingzhao (talk | contribs) mNo edit summary |
Lianyingzhao (talk | contribs) mNo edit summary |
||
Line 9: | Line 9: | ||
You get 1.5 marks for submitting answers that shows your effort and 0.5 for checking in, making this tutorial worth 2 points total. | You get 1.5 marks for submitting answers that shows your effort and 0.5 for checking in, making this tutorial worth 2 points total. | ||
==Building Your Program== | |||
Assuming you use a compiled programming language like C, you will involve the following steps (implicitly) to build your program: | |||
* Compile source (C) code into assembly code (.s files). | |||
* Assemble assembly code into machine code placed in object code files (.o files). | |||
* Link object code files together to create a runnable binary image (ELF files, no extension name). | |||
==Tasks/Questions== | |||
# | |||
# Looking at the <tt>.s</tt> file produced from <tt>gcc -S -O2 hello.c</tt>, do you see anything familiar and discussed in last week's lecture? |
Revision as of 01:56, 14 January 2022
In this tutorial, you will revisit the lifecyle of a program, from source code, to an executable (binary image), and further to being loaded into the address space. Then from a different angle, you can see when in execution, how the program (now a process) makes different types of calls to function, and how its memory is laid out.
Tutorials are graded based on participation and effort (so no need to try to have the “correct” answers — what matters is the process), but you should still turn in your work. Submit your answers on Brightspace as a single text file named "<username>-comp3000-t2.txt" (where username is your MyCarletonOne username). The first four lines of this file should be "COMP 3000 Tutorial 2", your name, student number, and the date of submission.
The deadline is usually four days after the tutorial date (see the actual deadline on the submission entry). Note that the submission entry is enforced by the system, so you may fail to get the effort marks even if it is one minute past the deadline.
You should also check in with your assigned TA online (by responding to the poll in the Teams channel tutorials-public or the private channel). Your TA will be your first point of contact when you have questions or encounter any issues during the tutorial session.
You get 1.5 marks for submitting answers that shows your effort and 0.5 for checking in, making this tutorial worth 2 points total.
Building Your Program
Assuming you use a compiled programming language like C, you will involve the following steps (implicitly) to build your program:
- Compile source (C) code into assembly code (.s files).
- Assemble assembly code into machine code placed in object code files (.o files).
- Link object code files together to create a runnable binary image (ELF files, no extension name).
Tasks/Questions
- Looking at the .s file produced from gcc -S -O2 hello.c, do you see anything familiar and discussed in last week's lecture?