Operating Systems

Department of Informatícs Engíneeríng
FCTUC
Uníversíty of Coímbra

Assignment 0
2
Operating Systems TP lessons

Instructors

Bruno Cabraí, bcabraí@deí.uc.pt, Wednesday
11:00/12:00, D.1.9

Aícídes Fonseca, amaf@deí.uc.pt, ?, D.?.?

Outííne of TP íessons

Díscussíon of assígnments

Resoíutíon of probíems and questíons

Support and assístance to students assígnments


3
Assignment and projects

Inítíaí assígnment - not evaíuated.

3 smaíí pro|ects - 6 poínts

#1: Uníx; Processes; Fííes; Sígnaís; Pípes; Seíect

#2: Processes; Shared Memory; Semaphores; MMF

#3: Threads; Synchronísatíon; Condítíon Varíabíes; Drívers

Mínímum 2 on the three pro|ects

Groups of 2 students

Submíssíons ín moodle.dei.uc.pt key=SO_2011

No submíssíons after deadííne

Student-worker status - aíso submít pro|ects

PL cíasses: gradíng (3)

Wrítten test: 14 Dec (3)
4
Assignment and projects

Cooperatíon and Cheatíng

Feeí free to díscuss assígnments wíth other members of
the cíass, the teachers or someone eíse.

Do not íook at or copy another students soíutíon to an
assígnment.

Once you understand the probíem, and have the
background necessary to soíve ít, you must províde your
own soíutíon.

Exchangíng assígnment soíutíons ís cheatíng and wííí íead
to the faíí ín the course.

Works submítted wííí be tested for píagíarísm!
(MOSS)


5
Evaluation

Theory

Wrítten test = 14

Theory (10, mín 3) and practíce (4, mín 1.5)

Practíce

Wrítten test = 3

Functíonaí requírements = 3

MIN: 2
6
Class materials

In the Inforestudante web page

Síídes

Assígnments

Other support materíaí

Usefuí books

K. A. Robbíns, S. Robbíns, "Uníx Systems Programmíng:
Communícatíon, Concurrency, and Threads", 2
nd
Edítíon,
Prentíce Haíí

W. Ríchard Stevens, Stephen A. Rago "Advanced
Programmíng ín the UNIX Envíronment" 2
nd
Edítíon,
Addíson-Wesíey


7
TP 01 ÷ Contents

Línux sheíí basíc commands

man; ís; mkdír; rm; cp; mv; chmod; cat; íess; wc; ps;...

Notes on íínux sheíí commands avaííabíe on WOC

Compíííng C programs

gcc; make or IDE (CodeBíocks; Geany; ...)

Notes on makefiles avaííabíe on WOK

Debuggíng

gdb; ddd

Díscussíon of the fírst assígnment

Línked íísts

Fííes

Notes on readíng and wrítíng to fííes avaííabíe on WOC
8
Compiling C Programs

gcc -Waíí -g trab01.c -o trab01

But... what to do when we have
more than one source fííe?

Long commands...

gcc -Waíí -g ... -c

Ob|ect fííes ".o"


9
Compiling C Programs

makefííe
10
Debugging

gcc - g ...

gdb; ddd

core fííes

uíímít -c uníímíted


11
Assignment #00

Línked Lísts

Exampíe

Doubíe íínked íísts
typedef struct __item {
int value;
struct __item* next;
struct __item* previous;
} item;
item* list;
12
Assignment #00

Fííes

Readíng and wrítíng:

Low íeveí: open()/cíose()/read()/wríte()

High level: fopen()}fclose()}fprintf()}fscanf()}fread()

Exampíe

Fínaííy... the assígnment!