Operation System များအကြောင်း(၂)

Program execution

OS ဟာ Application နဲ့ hardware ရဲ့ interface အဖြစ် လုပ်ဆောင်ပါတယ်။ User က hardware ကို တခြားနည်းလမ်းနဲ့ ထိန်းချုပ်တာလို့ ပြောလို့ ရတယ်။ OS ဆိုတာ a set of services which simplifies development of applications လို့ပြောလို့ ရတယ်။ Program တွေ run ရာမှာ OS ရဲ့ process တွေ ဖန်တီးပေးတာက အရေးပါပါတယ်။ အဲဒီမှာ kernel က အဲဒီ process အတွက် memory assign လုပ်ပေးပါတယ်။ Resources တွေကို assign လုပ်ပေးပါတယ်။ process တွေကို အစီအစဉ်တကျ စီစဉ်ပေးပါတယ်။ (in multitasking system ) (loading program code to memory and execute the program) ဒီလိုနဲ့ Program ဟာ user နဲ့ တခြား device တွေနဲ့ ဆက်သွယ်ပြီး သူ့ function ကို ပြီးအောင် လုပ်ဆောင်သွားပါတယ်။


Interrupts
Interrupts are central to operating systems as they provide an efficient way for the operating system to interact and react to its environment. ကြားဖြတ်ခြင်းပါပဲ။ Interrupt တစ်ခုကို လက်ခံရပြီဆိုတာနဲ့ Computer’s hardware automatically suspends whatever program is currently running, save its status ,and runs computer code previously associated with the interrupt. (interrupt နဲ့ အတူပါလာတဲ့ code ကို တန်း run ပါတယ်။ ) ဥပမာ ဖုန်းဆက်နေရင်း နောက်တစ် call ၀င်လာရင် အရင် call ကို ခဏမှတ်ထားပြီး နောက်ဟာကို အရင်လုပ်တာပါပဲ။ ဒီ system’s interrupt ကို OS’s kernel ကို လုပ်ဆောင်ပါတယ်။ Interrupt ဟာ hardware တွေကရော ၊ running program တွေကရောလာနိုင်ပါတယ်။ Hardware device တခုခုက interrupt လာပြီဆိုရင် OS’s kernel က ဒါက ဘယ်လို event လဲ။ ဘာလဲ ဘယ်လို code တွေလိုလဲ။ ဆိုတာဆုံးဖြတ်ပါတယ်။ Hardware interrupt ဆိုတာ device drivers က လိုအပ်တဲ့ အချိန်မှာ ပေးလိုက်တဲ့ task တစ်ခု ဖြစ်ပါတယ်။


Memory management
Memory management ကို kernel ကသာလုပ်ဆောင်ပါတယ်။ မလောက်ရင် harddisk ကနေယူသုံးပါတယ်။ swap file လို့ window မှာခေါ်ပါတယ်။ Virtual memory addressing means that the kernel can choose what memory each program may use at any given time ,allowing the operating system to use the same memory location for multiple tasks. Swapping လို့ခေါ်ပါတယ်။
Multitasking ဆိုတာကတော့ ကွန်ပြူတာတစ်လုံးထဲမှာ များစွာသော မတူညီတဲ့ ပရိုဂရမ်များကို Run တာပါပဲ။ ကွန်ပြူတာက တချိန်တည်းမှာ အလုပ်အားလုံးကို လုပ်နေတယ်လို့ ထင်ရစေပါတယ်။ OS’skernel မှာ scheduler ဆိုတဲ့ software လေးပါ ပါတယ်။သူက ပရိုဂရမ်တစ်ခုစီ အတွက် အချိန်ဘယ်လောက်သုံးပေးရမယ် ဘယ်လိုအစီအစဉ်အတိုင်း ဒီပရိုဂရမ်တွေကို Run ရမယ်ဆိုတာတွက်ချက်ပေးပါတယ်။ နောက် kernel ကနေပြီး အဲဒီ Run မယ်ဆိုတဲ့ control process တစ်ခုကို pass လုပ်ပါတယ်။ အဲဒီ control လေး kernel ဆီကို ပြန်ရောက်တာနဲ့ အဲဒီ program ဟာ CPU နဲ့ memory ကိုအသုံးပြုခွင့်ရသွားပါပြီ။ ဒီလို kernel နဲ့ application ကြား control passing ကို context switch လို့ခေါ်ပါတယ်။ Pre-emptive multitasking ဆိုတာကလဲ time-shared scheduling ပါပဲ။ Preemptive multitasking involves the use of an interrupt mechanism which suspends the currently executing process and invokes a scheduler to determine which process should execute next. Therefore all processes will get some amount of CPU time at any given time.

ဆက်ပါဦးမယ်..

No Response to "Operation System များအကြောင်း(၂)"

Post a Comment

powered by Blogger