OS Operations
- This is 1.4
- Quick OS load
- Turn the computer on.
- It starts (if it is an intel like chip) executing the BIOS (basic input/output system) or UEFI (unified Extensible Firmware Interface) or something else hardware dependent
- In the old days this was called bootstrap program.
- Believe it or not, at one point, I keyed one of these into a vax 750.
- This is firmware or software written to EEPROM
- It it is responsible for items like
- Initializing things such as memory and CPU
- Initializing devices
- Discovering the boot mode/devices
- Loading the kernel and any temporary services needed.
- Starting the kernel
- Once the kernel starts and is configured, it starts the first program.
- On linux/unix this is accomplished through systemd.
- This replaced
init
and is not the only way.
- The system service daemon.
- Responsible for starting and restarting services.
- Daemons.
- Starts the service on boot.
- If the service dies, it will restart it.
- Also a set of control functions
-
systemctl status httpd
-
systemctl restart httpd
- Configured in //usr/lib/systemd/system
- peek at httpd.service
- So systemd will start the other daemons.
- Things start to change as interaction happens
- For example, someone may connect via ssh.
- They contact the sshd, which starts another sshd
- Which handles login and might start a shell
- And the shell will start processes
-
ps -aux --forest
- Just in case someone asks,
kthreadd
manages the kernel threads (or processes that are running for the kernel)
- We might look at the lightdm (this is sort of the parent of the graphics display)
- As we said before, the user will need to get back to the kernel eventually
- This is done through a system call. (intel centric)
- This is done by generating an system interrupt 80
- With RAX containing the service you want.
- a table.
- This allows the kernel to operate in secure mode.
- More on this in a second.
- Some terms
- A ruining program in called a process.
- A thread is a lightweight process
- A process can have multiple cooperating threads
- That can share memory
- Either at the process or kernel level.
- A system that allows more than one process at a time is called multiprogramming.
- This allows more efficient use of the cpu. (especially when there was only one, no cores)
- Remember back in the bad old days, there were very few of these, so we wanted to keep them busy.
- Remember, to do I/O we need to make a system call
- This allows the kernel to take over.
- And I/O is very slow.
- So there is time to let another program run while we are getting the data the current program needs.
- We will see this in the future.
- This lead to multitasking
- At least a primitive scheduler is needed here.
- At least primitive memory management is needed.
- Multitasking
- The OS switches frequently between tasks.
- Each task runs for a quantum, or time slice, or until it makes a system call and is blocked for a resource
- The OS really needs a scheduler to do this.
- The attempt is to provide the illusion that all programs are running at the same time.
- Multitasking requires more sophisticated memory management systems.
- Physical memory is the reality.
- But logical memory is a user's view of memory.
- And virtual memory allows the OS to manage the two.
- A chunk of memory can be written to the hard drive when a process is "swapped out"
- This can be loaded again when the process is swapped in.