From my notes Flashcards

the points I found important from lectures and tutorials (27 cards)

1
Q

מהו תהליך?

A

תהליך הוא תוכנית בזמן הריצה שלה

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

מהם חלקי תהליך?

A

text section הקוד
current activity רגיסטר שאומר איפה אנחנו בתהליך
stack הזיכרון הלא מוקצה דינמית שהתהליך משתמש בו - גודלו יכול להשתנות בזמן ריצת התהליך
Data המשתנים הגלובלים
Heap הזיכרון המוקצה דינמית במהלך ריצת התהליך - גודלו יכול להשתנות במהלך ריצת התהליך

Text, current activity, stack, Data, heap

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

מהו ההבדל בין תוכנית program ותהליך process?

תוכנית = program
תהליך = process

A

Program is passive entity stored on disk (executable file)
However, process is active

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

draw the sections of a process

A

max
+——-+
| stack | ← (grows downward)
+——-+
| |
| | (gap for growth)
| |
+——-+
| heap | ← (grows upward)
+——-+
| data |
+——-+
| text |
+——-+
0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what are the states of a process?

A

New: it is being created
Running: Instructions are being executed
Waiting: it is waiting for some event to occur
Ready: it is waiting to be assigned to a processor
Terminated: it has finished execution

New, Running, Waiting, Ready, Terminated

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

draw the states of a process

A

First write the states
Then add these arrows:

new -> ready: Admitted (Process is admitted into the ready queue by the OS)
ready -> running: Scheduler dispatch (CPU scheduler selects process to run)
running -> ready: Interrupt (Process is preempted and moved back to ready state)
running -> waiting: I/O or event wait (Process requests I/O or waits for an event)
waiting -> ready: I/O or event completion (I/O operation completes, process moves to ready)
running -> terminated: Exit (Process finishes execution and is terminated)

there should be 6 arrows and they are described above

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what a process control block (PCB) contain?

A

Process state – running, waiting, etc.
Program counter – location of instruction to next execute
CPU registers – contents of all process-centric registers
CPU scheduling information- priorities, scheduling queue pointers
Memory-management information – memory allocated to the process
Accounting information – CPU used, clock time elapsed since start, time limits
I/O status information – I/O devices allocated to process, list of open files

7 things

Process state, Program counter, CPU registers, CPU scheduling information, Memory-management information, Accounting information, I/O status information

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

נכון או לא?

סיגנלים = פסיקות

A

לא נכון

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

מה kill עושה?

A

שולח לתהליך מסויים סיגנל מסויים

סתם שם מבלבל שלא משקף מה הפונקציה עושה

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

נכון או לא?

ניתן לטפל בדרך שהיא לא ה default בכל סיגנל

A

לא נכון
בכל סיגנל ניתן לטפל בדרך שהיא לא Default
פרט ל
SIGKILL (9) ו SIGSTOP (17)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the types of system calls?

A

Process control
File managment
Device management
Information maintenance
Communications
Protection

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

מה קורה בעת הדלקת המחשב?

A
  1. BIOS (Basic Input/Output System)
  2. Bootable device
  3. MBR (Master Boot Record)
  4. Boot Loader
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

איך פועל BIOS ומהי מטרתו?

A

זהו הקוד הראשון שרץ כשמדליקים את המחשב.

BIOS מאוחסן על שבב בלוח האם.

תפקידו לבדוק את תקינות החומרה (POST – Power-On Self Test) ולזהות התקני אחסון (כמו דיסק קשיח).

לאחר מכן, הוא מחפש התקן אתחול (bootable) לפי סדר שנקבע בהגדרות BIOS.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what is a bootable device?

A

זהו התקן (למשל דיסק קשיח, דיסק און קי, וכו’) שיש עליו מערכת הפעלה או קבצי אתחול.

ה-BIOS מנסה לאתר התקן שניתן לאתחל ממנו.

אם לא נמצא התקן כזה – תופיע שגיאה בסגנון “No bootable device found”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is MBR (Master Boot Record)

A

ברגע שה-BIOS מזהה התקן אתחול, הוא טוען את ה-MBR מה-sector הראשון של ההתקן (Sector 0).

ה-MBR כולל קוד קטן שתפקידו להעביר שליטה לטעינת מערכת ההפעלה.

הוא גם מכיל טבלת מחיצות (partition table) כדי לזהות איפה נמצאת מערכת ההפעלה.

17
Q

what is a Boot Loader?

A

ה-MBR מפעיל את ה-boot loader (לדוגמה: GRUB בלינוקס, Windows Boot Manager).

זהו תוכנה שתפקידה לטעון את מערכת ההפעלה לזיכרון.

במערכות מרובות מערכות הפעלה (dual boot), ה-boot loader מאפשר לבחור איזו מערכת תעלה.

18
Q

?מה זה מודול

A

קובץ קוד שמאפשר להוסיף יכולות לקרנל של מערכת ההפעלה בלי לקמפל אותו מחדש.

19
Q

מהם השימושים העיקריים של מודלים?

A
  1. הרחבת פונקציונליות של הקרנל
    מודולים מאפשרים להוסיף תכונות לקרנל בלי לקמפל אותו מחדש. זה שימושי מאוד לפיתוח, בדיקה או הוספת תכונות בצורה דינמית.
  2. תמיכה בהתקני חומרה (Device Drivers)
    זה השימוש הכי נפוץ – מודולים משמשים כדרייברים שמאפשרים לקרנל “לדבר” עם התקני קלט/פלט כמו עכבר, מקלדת, מצלמות, דיסקים, כרטיסי רשת וכו’.
  3. תמיכה בפרוטוקולי רשת
    למשל, אם רוצים להוסיף פרוטוקול רשת חדש (כמו VPN מסוים), אפשר לעשות זאת עם מודול.
  4. תמיכה במערכות קבצים
    אם רוצים לתמוך במערכת קבצים חדשה (כמו ext4, NTFS, FAT וכו’), אפשר להטעין מודול שמממש אותה.
  5. יכולת דינמית: טעינה/פריקה בזמן ריצה
    אפשר להטעין (insmod / modprobe) או לפרוק (rmmod) מודול בזמן שהמערכת פועלת – זה נותן גמישות גבוהה בלי אתחול.
  6. קוד מתוחזק היטב בנפרד
    מודולים מאפשרים לשמור רכיבי מערכת מורכבים (כמו דרייברים) בקוד נפרד שקל יותר לפתח ולתחזק.
20
Q

מהם היתרונות של מודולים?

A
  • גמישות
  • חיסכון בזיכרון (נטען רק כשצריך)
  • פיתוח קל יותר
  • אין צורך לאתחל את המחשב אחרי כל שינוי
21
Q

what is speedup?

A

Speedup is a measure of how much faster a program runs using multiple processors compared to a single processor.

22
Q

How to compute speedup?

A

Amdahl’s Law:
((1-P)+P/N)^-1

for example: If only 80% of the program can be parallelized and you’re using 4 processors:
speedup = ((1-0.8)+0.8/4))^-1 = 2.5 ** !=** 4 = 4/1

23
Q

What is an API?

A

An API (Application Programming Interface) is a set of rules that lets programs communicate with each other.

It’s like a menu in a restaurant: You choose from options (make a request) and the kitchen (system) gives you the dish (response).

25
Why are APIs useful?
They let developers use features or data from another system without knowing how it works internally.
26
למה multiprogramming?
כי תוכנות נראות כך: (CPU burst, I/O burst, CPU burst...) ובזמן ה I/O התוכנה לא צריכה את ה CPU ולכן כדאי להריץ תוכנה אחרת בזמן יקר זה
27
# נכון \ לא נכון? ב round robin צריך ש time quantinum יהיה גדול יחסית ל context switch
נכון