代写代考 COMP 3430 Operating systems

COMP 3430 Operating systems
Processes part 3

January 28th, 2022

Copyright By PowCoder代写 加微信 powcoder

By the end of today’s lecture, you should be able to:
▶ Describe what an OS might need to know about a process.
▶ Describe the lifecycle of a process.
The Rocket Book (Public Domain)

Let’s do a quiz.

Starting the process
Ready, steady, go! (Pixabay License)
▶ TheOScanreadafile.
▶ The OS needs to load the file into
▶ Into a data structure that has
information about the process.

Libraries! (Pixabay License)
With your team, answer the question:
What information might an OS need to keep about a running process?
Think about this in two ways:
▶ Operating system responsibilities.
▶ What your programs ask an OS for.

What does a real OS know?
Let’s take a look at struct task_struct.
1. Did you think about anything that isn’t in struct task_struct?
2. What kinds of things are in struct task_struct that you didn’t think of?
3. Left as an exercise for the reader: How is struct task_struct in Linux different from struct task in Darwin/XNU ?

“States” (Public Domain)
Let’s take a look at states in struct task_struct.
▶ Let’s draw a state transition graph (COMP 2080 & 3030).
▶ The start state is the default state – what’s the default on Linux?
▶ Now identify what the next state is, until we find an end state.

Process states
▶ This is one piece of metadata an OS keeps about a process. ▶ Helps inform:
▶ Scheduling activities.
▶ Maintenance activities.
▶ We can represent these states as a graph 𝐺 = (𝑉 , 𝐸) where:
▶ 𝑉 are the states
▶ 𝐸 are possible transitions between states

▶ An OS keeps lots of information about processes.
▶ Process control block PCB struct task_struct
▶ Some information is architecture-specific.
▶ Processes have a lifecycle, modelled as state.

Let’s take a look at the schedule.
Chip-scale atomic clock (Public Domain)

Trap tables
▶ Remember: The OS is tightly coupled with the hardware.
▶ The OS cooperates with the hardware to accomplish its job.
▶ Let’s peruse the system calls for x86_64 on Linux
©English Lock (CC BY-SA 3.0)

Trap tables
▶ How does the kernel register system calls with hardware???
▶ A bit outside the scope of this course.
▶ …you can read about it on LWN (1 and 2).

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com