a)What is Operating System : Application can not run directly on computer hardware, that need software. It is called Operating system.
Rel Post -https://studentsweat.blogspot.com/2010/06/linux-kernel-important-process-kernel.html
Rel Post -https://studentsweat.blogspot.com/2010/06/linux-kernel-important-process-kernel.html
What are the component of the Linux? Linux Internal Parts
Linux Operating System have two parts
Kernel Space + User Space
Linux Operating System have two parts
Kernel Space + User Space
b)Kernel important Responsibility
1.OS kernel space : – only small amount of trusted code run with high privilege.since it is run on high privilege, if any code mismatch happens kernel panic error will occur.it facilitates interaction between H/W and S/W.init is first program run on startup.
2.Memory Management(Memory Protection):
Definition : Every program to run, it requires memory for both kernel/user space program.Kernel is responsible for allocation of memory to the process for the execution and dellocates the memory when the process is no longer needed.
control the memory access right prevent the process from accessing memory that has not be allocated(Paging/segmentation).
3. Device Management(Handling Hardware)
- Instead of placing hardware management code into every application.it has been placed device driver code in to the kernel.I/O device handling such as keyboard,mouse,mice,disk drivers,printers,USB devices,network adapter and display devices.Kernel allocate request from program to the I/O devices.(Interrupt handling,boot device drivers, system calls.)
4.Process Scheduling
- Process : simply a program in execution.The execution of a process must progress in a sequential fashion.To put it in simple terms, we write our computer programs in a text file, and when we execute this program, it becomes a process which performs all the tasks mentioned in the program.
- How it will be execute -> program is loaded into memory and it becomes process.
5.File system management
- Regular User space – execute at lower privilege(unprivilege mode) level to protect the system from malicious program.Ex : command line,Shell, graphical application,glibc(GNU C Library),what is Syscall -> Linux application/Process request resource to the Linux kernel through glibc.
what is glibc – GNU C Library.This library provides Critical API(providing interface to communicate with other program) like POSIX,BSD.
Why Syscall required – Most operation from user application interacting with system require permission not available at the user level process.To do this operation it is require the system call. To get the details about what are the systemcall has been used we use the command strace command.it will list out all the systemcall has been used.like write(),open(),read()
c)Relationship between user space,glibc -> systemcall, kernel space refer below image
Common Points
Built Kernel,
- Kernel designs differ how they manage system calls and resources.
d)Interrupt - (How Kernel respond to Interrupt)
1. interrupt is input signal -> process -> indicating event that needs immediate attenditation.
2. Interrupt that commonly used by HW devices indicate physical state has been changed. Ex : keyboard key stroke, mouse key moment ,Wireless adapter,real clock timer,network card.pciehp –PCI hot plug,i915 intel graphics card,snd_hda_intel sound card.it is asynchronously,it can happen at any time with respect to the processor clock. This interrupt we can monitor by cat \proc\interrupts
3. Software interrupt requested by the processor itself upon executing particular instruction.it is synchronous.Ex: requesting OS interacting with device driver read and write the storage.
4. Execution Error : software error also happens unexpectedly by program execution, like divided by zero exception thrown interupt,this will catch and handle the exception. If it is not properly handle complete system may be hang.
Comparison between HW/SW Interrupt - https://vivadifferences.com/7-difference-between-hardware-interrupt-and-software-interrupt/
e)while monitoring we need to check following metrics
1)CPU 2) MEMORY
1.CPU Load Avg is high -> program more depends on the air thematic operating
while checking in depth – Analyze the program behavior.
To Check in Detail with Top Command
- CPU involves in disk read and write -> i/o time is high split in (wait +Idle)
- CPU involves in User CPU(non kernel program) time -> it is Desktop application will run
- CPU involves in System CPU(Kernel program) time -> it is utilize kernel program(it is having separate address space compare to the user CPU TIME)
NOTE: To know which process running on which CPU, choose the following field in top command press f + j (Last used CPU(p))
0 Comments