100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Samenvatting Besturingssystemen $4.77
Add to cart

Summary

Samenvatting Besturingssystemen

1 review
 122 views  5 purchases
  • Course
  • Institution

Zeer uitgebreide samenvatting Besturingssystemen. Bevat geen oefeningen voor Windows en/of Linux. Compleet met uitgebreide inhoudstafel. Verbetering tegenover het gebruik van slides.

Preview 10 out of 51  pages

  • January 8, 2019
  • 51
  • 2018/2019
  • Summary

1  review

review-writer-avatar

By: milands99 • 4 year ago

avatar-seller
BESTURINGSSYSTEMEN
Academiejaar 2018 - 2019




Jakob Lierman
HoGent

,Jakob Lierman Besturingssystemen


Inhoud
INLEIDING .................................................................................................................................................. 8

WAT IS LINUX ........................................................................................................................................................... 8

AAN DE SLAG MET LINUX ............................................................................................................................................ 8

De terminal ...................................................................................................................................................... 8

Het Linux bestandssysteem.............................................................................................................................. 8

Oriëntatie in het bestandssysteem .................................................................................................................. 8

Met de shell leren werken ................................................................................................................................ 8

Enkele commando’s ....................................................................................................................................................... 8

Hulp (man pages) ........................................................................................................................................... 10

WAT IS EEN BESTURINGSSYSTEEM ............................................................................................................................... 10

Functies .......................................................................................................................................................... 10

Historisch overzicht ........................................................................................................................................ 10

Soorten besturingssystemen .......................................................................................................................... 11

Single-tasking ............................................................................................................................................................... 11

Multitasking (single-user) ............................................................................................................................................ 11

Multi-user-systemen .................................................................................................................................................... 11

Virtuele machines ........................................................................................................................................................ 12

Concepten van besturingssystemen .............................................................................................................. 12

Proces........................................................................................................................................................................... 12

Resources ..................................................................................................................................................................... 12

Concurrency ................................................................................................................................................................. 12

Ontwerp-criteria .......................................................................................................................................................... 13

Compromissen ............................................................................................................................................................. 13

SCHEDULING ............................................................................................................................................ 14


2

,Jakob Lierman Besturingssystemen


NOODZAAK TOT SCHEDULING..................................................................................................................................... 14

DOELSTELLINGEN VAN SCHEDULING ............................................................................................................................ 14

UITVOEREN VAN EEN PROCES ..................................................................................................................................... 15

SYSTEEMBEELD VAN EEN PROCES ................................................................................................................................ 16

Procestoestand-diagram................................................................................................................................ 17

Procestoestanden ........................................................................................................................................................ 17

Toestandsovergangen.................................................................................................................................................. 17


Process Control Blocks (PCB) .......................................................................................................................... 18

Niveaus van scheduling.................................................................................................................................. 18

STRATEGIEËN VOOR LOW-LEVEL SCHEDULING................................................................................................................ 18

Round Robin scheduling (RR) ......................................................................................................................... 19

First-In-First-Out scheduling (FIFO) of First-Come-First-Served scheduling (FCFS) ........................................ 19

Multilevel feedback queues (MFQ) ................................................................................................................ 20

Shortest-Job-First scheduling (SJF) ................................................................................................................. 20

Starvation....................................................................................................................................................... 21

Samenvatting strategieën low-level scheduling ............................................................................................ 21

SCRIPTING IN LINUX ................................................................................................................................. 22

INLEIDING .............................................................................................................................................................. 22

Eigenschappen van een goed script ............................................................................................................... 22

Structuur van een shell script ......................................................................................................................... 22

Instructies bovenaan het script ................................................................................................................................... 22

Debuggen van een bash script ....................................................................................................................... 22

VARIABELEN EN PARAMETERS .................................................................................................................................... 23

Variabele koppelen ........................................................................................................................................ 23

Variabele aanroepen...................................................................................................................................... 23


3

,Jakob Lierman Besturingssystemen


Soorten variabelen ......................................................................................................................................... 23

Constanten ................................................................................................................................................................... 23

Lokale variabelen ......................................................................................................................................................... 23

Omgevingsvariabelen .................................................................................................................................................. 23

Shell-variabelen ........................................................................................................................................................... 24


Werken met invoer......................................................................................................................................... 24

Positionele parameters ................................................................................................................................................ 24

Speciale parameters .................................................................................................................................................... 24

Commando substitution................................................................................................................................. 25

REGULIERE EXPRESSIES ............................................................................................................................................. 25

PROGRAMMEERBARE FILTERS .................................................................................................................................... 26

SED: Stream EDitor......................................................................................................................................... 26

Substitutieopdrachten.................................................................................................................................... 27

FLOW-CONTROL ...................................................................................................................................................... 28

Exit-status, exit............................................................................................................................................... 28

Return en test................................................................................................................................................. 28

File testers.................................................................................................................................................................... 29

File comparisons .......................................................................................................................................................... 30

String tests ................................................................................................................................................................... 30

Integer tests - operators .............................................................................................................................................. 30

If then else ...................................................................................................................................................... 30

Case ................................................................................................................................................................ 31

For .................................................................................................................................................................. 31

While / until ................................................................................................................................................... 31

REKENEN IN EEN SCRIPT ............................................................................................................................................ 32

FUNCTIES ............................................................................................................................................................... 32
4

,Jakob Lierman Besturingssystemen


Waarden uit functie teruggeven .................................................................................................................... 32

OPTIES .................................................................................................................................................................. 33

Manueel parsen ............................................................................................................................................. 33

Grep parsen.................................................................................................................................................... 33

Getopts parsen ............................................................................................................................................... 34

CONCURRENCY – PARALLELLE PROCESSEN................................................................................................. 35

WAT IS CONCURRENCY? ........................................................................................................................................... 35

WEDERZIJDSE UITSLUITINGEN (MUTUAL EXCLUSION) ...................................................................................................... 35

Concurrency met meerdere processors ......................................................................................................... 35

Concurrency met één processor ..................................................................................................................... 35

Wederzijdse uitsluiting................................................................................................................................... 36

PROGRAMMEREN VAN WEDERZIJDSE UITSLUITINGEN ...................................................................................................... 36

Eerste poging ................................................................................................................................................. 36

Tweede poging ............................................................................................................................................... 36

Derde poging.................................................................................................................................................. 36

ALGORITME VAN DEKKER .......................................................................................................................................... 37

ALGORITME VAN PETERSON ...................................................................................................................................... 38

SEMAFOREN ........................................................................................................................................................... 39

Inleiding.......................................................................................................................................................... 39

Sterke semaforen ........................................................................................................................................... 41

Implementatie semaforen ............................................................................................................................. 43

MONITOREN .......................................................................................................................................................... 44

SYNCHRONISATIE ..................................................................................................................................................... 44

DEADLOCK ............................................................................................................................................................. 44

Aspecten van deadlock .................................................................................................................................. 45

5

,Jakob Lierman Besturingssystemen


Preventie ...................................................................................................................................................................... 45

Vermijding .................................................................................................................................................................... 45

Signalering.................................................................................................................................................................... 45

Herstel .......................................................................................................................................................................... 45

THREADS ............................................................................................................................................................... 46

PROCESSEN IN LINUX ................................................................................................................................ 47

WAT IS EEN PROCES? ............................................................................................................................................... 47

SOORTEN PROCESSEN ............................................................................................................................................... 47

Interactieve processen ................................................................................................................................... 47

Automatische (batch) processen ................................................................................................................... 47

Daemons ........................................................................................................................................................ 47

BACKGROUND ........................................................................................................................................................ 47

EIGENSCHAPPEN ..................................................................................................................................................... 48

INFORMATIE WEERGEVEN ......................................................................................................................................... 48

Korte info........................................................................................................................................................ 48

Uitgebreide info ............................................................................................................................................. 48

top commando ............................................................................................................................................... 49

pstree commando .......................................................................................................................................... 49

PROCESSEN BEHEREN ............................................................................................................................................... 49

Prioriteit veranderen ...................................................................................................................................... 50

PROCESSEN ONDERBREKEN........................................................................................................................................ 50

kill commando ................................................................................................................................................ 50

xkill commando .............................................................................................................................................. 50

PROCESSEN PROGRAMMEREN VOOR AUTOMATISCHE UITVOERING .................................................................................... 50

LEVENSCYCLUS ........................................................................................................................................................ 51


6

,Jakob Lierman Besturingssystemen


Proces aanmaken ........................................................................................................................................... 51

systemd .......................................................................................................................................................... 51

Proces beëindigen .......................................................................................................................................... 51




7

,Jakob Lierman Besturingssystemen



Inleiding
Wat is Linux
Besturingssysteem ontwikkeld vanuit UNIX door Linus Torvalds.


Aan de slag met Linux

De terminal

# commando [-opties] [argument(en)]
# Bijvoorbeeld:
ls -l /etc


Het Linux bestandssysteem




Oriëntatie in het bestandssysteem

Absoluut pad: start vanaf de root en begint met een slash (/).
Relatief pad: start vanaf de huidige map.

Met de shell leren werken

Een shell is een programma dat wordt opgestart in een terminal venster.

Enkele commando’s

Werken met mappen:
8

,Jakob Lierman Besturingssystemen


# Map aanmaken (meerdere namen mag)
mkdir

# Map verwijderen (enkel lege mappen) (meerdere namen mag)
rmdir

Werken met tekstbestanden:

# Laat de inhoud van een tekstbestand over het scherm lopen
cat

# Toon tekst in omgekeerde volgorde
tac

# Laat toe om de tekst scherm per scherm te bekijken
less

# Toont de eerste 10 lijnen
head

# Toont de laatste 10 lijnen
tail

# Tekstbestanden aanmaken
touch bestand1 bestand2

# Bestanden kopiëren
cp bronmap/bronbestand doelmap/doelbestand
# Enkele opties:
# -r recursive
# -v verbose

# Bestanden verplaatsen
mv bronmap/bronbestand doelmap/doelbestand
# Enkele opties:
# -i interactive
# -v verbose
# -f force

# Bestanden verwijderen
rm map/bestand
# Enkele opties:
# -r recursive
# -v verbose

Tekst zoeken in bestanden:

grep [opties] tekenreeks [bestanden]
# Enkele opties:
# -i --ignore-case
# -n --line-number
# -s --silent

9

, Jakob Lierman Besturingssystemen


Zoeken:

# Zoeken op bestandsnaam
locate bestandsnaam
find zoekmap zoekoptie(s) [tests] [acties]

# Zoeken naar commando’s
which commandonaam


Hulp (man pages)

# Man page opvragen
man commando

Vaak ook bij het commando beschikbaar als optie --help.


Wat is een besturingssysteem
Besturingssysteem = programma dat het mogelijk maakt de hardware van een computer te
gebruiken.

Functies

- Opslaan en ophalen van informatie
- Programma’s afschermen
- Gegevensstroom regelen
- Prioriteiten regelen
- Het mogelijk maken om bronnen te delen
- Tijdelijke samenwerking tussen onafhankelijke programma’s mogelijk maken
- Reageren op fouten
- Tijdsplanning maken

Historisch overzicht

1e computers → Geen OS

Jaren 50 → Eenvoudig OS:

- Sequentieel opladen & opstarten v programma’s
- Alle bronnen bruikbaar door slechts 1 programma

Begin jaren 60 → Geavanceerder OS:

- Verscheidene programma’s konden tegelijk opgeslagen worden in geheugen
- Beurtelingse uitvoering programma’s
- Gemeenschappelijke bronnen


10

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller jakoblierman. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $4.77. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

51662 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 15 years now

Start selling
$4.77  5x  sold
  • (1)
Add to cart
Added