Oct 30, 2009

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.

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

Oct 28, 2009

Generating the Keystream Letters

ဒီမွာ အဓိကက်တာ keystream ဆုိတာေျပာခဲ့ျပီးပါျပီ ..အဲဒီ keystream ကုိ solitaire ကေန ဘယ္လုိထုတ္မလဲ .. Solitaire ဟာ keystream ကုိ ဖဲထုတ္ကုိ အသံုးျပဳျပီးေဖာ္ရပါတယ္ ။ ဖဲထုတ္မွာ 13*4=52 + 2 joker = 54 cards ရွိပါတယ္။ ဖဲထုတ္မွာ ကတ္ေတြ တည္ရွိေနႏုိင္ပံုက 54 ! = 2.31*10^71 ေလာက္ျဖစ္ႏုိင္ပါတယ္။ solitaire အသံုးျပဳဖုိ႕အတြက္ အဲဒီ 54 ကတ္လံုးကုိ အသံုးျပဳပါမယ္ ။ joker ႏွစ္ခုရွိတာကုိ တစ္ခုစီကုိ သီးျခားမွတ္သားထားပါ ။ ေနာက္ပုိင္းမွာ joker A နဲ႔ joker B ဆုိျပီးအသံုးျပဳမွာ ျဖစ္ပါတယ္။ (အမွတ္အသားကုိေတာ့ joker ေပၚမွာပဲ တစ္ခုေပၚမွာ A ၊ တစ္ခုေပၚမွာ B လုိ႔ ေရးထားရင္ လံုေလာက္ပါျပီ ) solitaire ကေန keystream ကုိ ေအာက္ပါ အဆင့္မ်ားအတုိင္းလုပ္ျပီး ေဖာ္ရပါမယ္။
၁။ joker A ကုိရွာပါ။ အဲဒီ joker ကုိယူျပီး ေအာက္ဘက္ကုိ တစ္ကတ္ေရႊ႕ပါ။
၂။ joker B ကုိရွာပါ။ အဲဒီ joker ကုိယူျပီး ေအာက္ဘက္ကုိ ႏွစ္ကတ္ေရႊ႕ပါ။ဖဲခ်ပ္ေတြကုိ အေပၚဆံုးနဲ႔ ေအာက္ဆံုးဖဲခ်ပ္က ဆက္ေနတယ္လုိ႔ ယူဆေပးပါ။
ဥပမာ ၁။ ဖဲခ်ပ္တည္ေနပံုက A 7 2 B 9 4 1 ဆုိပါစုိ႔ ။ step 2 ျပီးသြားတဲ့ အခ်ိန္မွာေတာ့ ေအာက္ပါအတုိင္းျဖစ္ေနပါလိမ့္မယ္။ 7 A 2 9 4 B 1
ဥပမာ ၂။ ဖဲခ်ပ္တည္ေနပံုက 3 A B 8 9 6 ဆုိပါစုိ႔ ။ step 2 ျပီးသြားတဲ့ အခ်ိန္မွာေတာ့ ေအာက္ပါအတုိင္းျဖစ္ေနပါလိမ့္မယ္။
3 A 8 B 9 6
၃။ Triple cut လုိ႔ေခၚပါတယ္။ joker A နဲ႔ B ကုိ ရွာပါ ။ joker A နဲ႔ B ရဲ႕ ၾကားထဲက ဖဲခ်ပ္မ်ားကုိ ခ်န္ျပီး joker ရဲ႕ အေပၚနဲ႔ ေအာက္က ဖဲခ်ပ္မ်ား ကုိ တစ္ခု နဲ႔ တစ္ခု ေနရာခ်ိန္းပါ။ joker ဖဲခ်ပ္က A ျဖစ္ျဖစ္ B ျဖစ္ျဖစ္ ရပါတယ္ ။
ဥပမာ။
2 4 6 B 5 8 7 1 A 3 9 ဆုိရင္ Triple cut လုပ္ျပီးတဲ့အခါမွာ 3 9 B 5 8 7 1 A 2 4 6 ျဖစ္သြားပါလိမ့္မယ္။ အကယ္လုိ႔ joker က ထိပ္ဆံုး သုိ႔ ေအာက္ဆံုးကုိ ေရာက္ေနရင္လည္း ေအာက္ပါအတုိင္းေနရာလဲပါ။
B 5 8 7 1 A 3 9 ဆုိပါစုိ႔ ။
3 9 B 5 8 7 1 A ျဖစ္သြားပါမယ္ ။
B 5 8 7 1 A ကေတာ့ မေျပာင္းလဲပါဘူး ။
၄။ Count cut လုိ႔ ေခၚပါတယ္ ။ ဖဲထုပ္ေအာက္ဆံုးကတ္ကုိ ၾကည့္ပါမယ္။ သူ႔တန္ဖုိးအတုိင္း အေပၚဆံုး ကတ္ကေန စေရတြက္ျပီးယူပါမယ္ ။ ျပီးရင္ အဲဒီကတ္ေတြကုိ ေအာက္ဆံုးကတ္ရဲ႕ ေရွ႕မွာ ကပ္ျပီးထည့္ပါမယ္။ ကတ္တန္ဖုိးယူတဲ့အခါမွာ ညွင္း . ေဒါင့္ . ဟတ္ . စပိတ္ ဆုိျပီးစီရပါမယ္ ။ ဆုိလုိတာက ညွင္းဆုိရင္ မူရင္း တန္ဖုိး ေဒါင့္ ဆုိရင္ မူရင္းတန္ဖုိး + ၁၃ ျဖစ္ပါမယ္ ။ဟတ္ဆုိရင္ မူရင္းတန္ဖုိး+၂၆ ျဖစ္ပါမယ္ ။ joker ႏွစ္ခုလံုး တန္ဖုိးကုိေတာ့ ၅၃ လုိ႔ပဲ ယူဆပါမယ္ ။ ၅၃ ဆုိရင္ေတာ့ ဖဲထုပ္ဟာ ဒီအတုိင္းပဲ ရွိေနမွာ ျဖစ္ပါတယ္ ။(ဖဲ ၅၄ ခ်ပ္ သာရွိလုိ႔ပါ)
ဥပမာ။ ….. 4 5 ….. … 8 9 ဆုိပါေတာ့ ။ ေရွ႕ဆုံးကေနျပီး ၉ ကတ္ေျမာက္က ၄ ျဖစ္မယ္ဆုိရင္ ၄ အထိ ကတ္ေတြအားလံုးကုိ ယူျပီး ေနာက္ဆံုးကတ္ျဖစ္တဲ့ ၉ ရဲ႕ အေရွ႕မွာကပ္ထားရပါမယ္ ။ ဒါဆုိရင္ 5…. ……. 8 …. .. … .4 9 ျဖစ္သြား ပါလိမ့္မယ္။
၅။ Output card ကုိရွာပါမယ္။ ဖဲထုပ္အေပၚဆံုးအခ်ပ္ကုိ ၾကည့္ပါ။ သူ႕တန္ဖုိးအတုိင္း အေပၚဆံုးကေန စျပီး ေရတြက္ပါ။ က်တဲ့ကတ္က ပထမဆံုး output card ပါပဲ။ ကတ္ေတြရဲ႕ တန္ဖုိးကုိေတာ့ အဆင့္ (၄)မွာ ယူတဲ့ အတုိင္းယူပါ။ အကယ္လုိ႔ က်တဲ့ကတ္က joker ဆုိရင္ေတာ့ keystream မွာ အဲဒီေနရာမွာ null လုိ႔ ယူဆ ပါမယ္။
၆။ Output card ကေန number ကုိေျပာင္းပါမယ္။ေအာက္ပါအတုိင္းေျပာင္းပါ။
၁ ညွင္း မွ ကင္း ညွင္း အထိ ၁ မွ ၁၃
၁ ေဒါင့္ မွ ကင္း ေဒါင့္ အထိ ၁၄ မွ ၂၆
၁ ဟတ္ မွ ကင္း ဟတ္ အထိ ၁ မွ ၁၃
၁ စပိတ္ မွ ကင္း စပိတ္ အထိ ၁၄ မွ ၂၆
ဒါဆုိရင္ ကၽြန္ေတာ္တုိ႔ဟာ solitaire ကုိ အသံုးျပဳျပီး အကၡရာတစ္လံုးကုိ ဘယ္လုိ ေဖာ္သလဲဆုိတာ သိေလာက္ ပါျပီ။ ၾကိဳက္သေလာက္ keystream စာလံုးအေရအတြက္ကုိ ဖန္တီးလုိ႔ ရပါတယ္။

Oct 27, 2009

feel not well

bad bad bad so bad !i got flu .. not well .. got coach
:(
wanna be healthy !!!!!!!!!!

Oct 20, 2009

The Solitaire Encryption Algorithm

version 1.2, 5/26/99
Designed by Bruce Schneier
Featured in Neal Stephenson's Cryptonomicon

ဒီနည္းကုိ တီထြင္သူက ေတာ့ Bruce Schneier ပါ။ Neal Stephenson ရဲ႔ ၀တၳဳ Cryptonomicon မွာ ကုတ္နာမည္ Pontifex ဟာ ဒီ ဖဲခ်ပ္မ်ားက ေနျပီး ၀ွက္စာေဖၚတဲ႔ နည္းကုိ ရည္ညြန္းတာပါ။ Solitaire မွာ အီလက္ထေရာနစ္ မပါဘဲနဲ႔ ၀ွက္စာမ်ားကို ၀ွက္တာေဖၚတာ ေတြကုိ လံုျခံဳစိတ္ခ်စြာ လုပ္ေဆာင္ႏုိင္ပါတယ္။ Solitaire ဟာ ဖဲခ်ပ္မ်ားရဲ႕ randomly တည္ရွိေနမႈ ဆုိတဲ့ security ကုိ ရယူထားပါတယ္။
ဒီနည္းမွာ key stream ဆုိတဲ့ ဂဏန္းအတန္း က အဓိကက်ပါတယ္ ။အဲဒါနဲ႔ ပဲ အားလံုးကုိ ေဖၚရတာျဖစ္ပါ တယ္။ အဲဒီ key stream ကုိ ဖဲခ်ပ္ထုတ္ထဲမွာ ဖြက္ထားပါတယ္။ Encrypt နဲ႔ Decrypt ကုိ key stream သိမွပဲလုပ္လုိ႔ရမွာ ျဖစ္ပါတယ္။ key stream ရဲ႕ စာတန္းအရွည္က Encrypt လုပ္ထားတဲ့စာတန္းအရွည္နဲ႔ အတူတူျဖစ္ရပါမယ္။

Encrypting with Solitaire
၁။ စာေၾကာင္းကေနျပီး punctuation ေတြအားလံုးကုိျဖဳတ္ျပီး character အားလံုးကုိ တစ္ပံုစံတည္း လုပ္ပါ။(ဆုိလုိတာက အားလံုးစာလံုးအၾကီးအေသးမရွိ အတူတူပဲ)
၂။ character အားလံုးကုိ ဂဏန္းတန္ဖုိးကုိေျပာင္းပါ။ A=1, B=2 ,C=3 ,etc (ေနာက္တြင္ plaintext လုိ႔ေခၚ ပါမည္)
၃။ Encrypt လုပ္ဖုိ႔အတြက္ plaintext က ဂဏန္းမ်ားကုိ key stream က ဂဏန္းေတြနဲ႔ တစ္လံုးခ်င္း စီေပါင္း ပါ။ ေပါင္းရာမွာ ဂဏန္းတန္ဖုိးက ၂၆ (အဂၤလိပ္စာလံုးေပါင္း ၂၆ လံုးသာရွိသည္) ထက္ေက်ာ္သြားရင္ mod 26 ယူေပးပါ(26 နဲ႔ စားျပီးအၾကြင္းကုိယူပါ) အဲဒီ ဂဏန္းတန္းကေတာ့ Encrypt လုပ္ျပီးသားျဖစ္ပါတယ္။
ဥပမာ။ DO NOT USE PC ဆုိတဲ့ စာေၾကာင္း (plain text) ကုိ ၀ွက္မယ္ဆုိရင္ အရင္ဆံုး ၅ လံုးစီပါတဲ့ group တစ္ခုစီကုိ လုပ္ပါ။ DONOT USEPC ဆုိတဲ႔ ဟာရပါတယ္။ေနာက္ key stream letter ကုိ KDWUP ONOWT လုိ႔ထားပါ။ plain text ကုိ ဂဏန္းေျပာင္းရင္ (A=1, B=2, etc)
4 15 14 15 20 21 19 5 16 3
key stream letter ကုိေျပာင္းရင္
11 4 23 21 16 15 14 15 23 20
ျပီးရင္အဲဒီႏွစ္ေၾကာင္းကုိေပါင္းပါမယ္။ ဥပမာ။ 1+1=2, 26+1=1
15 19 11 10 10 10 7 20 13 23
ဒါကုိ စာေၾကာင္းျပန္ေျပာင္းပါမယ္။
OSKJJ JGTMW

Decrypting with Solitaire
အျပန္အလွန္အေနနဲ႔ receiver ကလည္း key stream ကုိ အရင္ထုတ္ရပါမယ္။Encrypt stream ကေန အဲဒီ key stream ကုိ ႏႈတ္လုိက္ရင္ မူရင္း stream ကုိ ရပါမယ္။
ဥပမာ။ ေပးထားတဲ့ ciphertext ကုိ ၅ လံုးစီ ပါတဲ့ group ေလးေတြခဲြပါမယ္။
OSKJJ JGTMW
ျပီးရင္ Solitaire ကုိအသံုးျပဳျပီး key stream ကုိထုတ္ပါမယ္။အဲဒီ key stream က encrypt လုပ္တဲ့သူ အသံုးျပဳခဲ့တဲ့ key stream နဲ႔ တူရပါမယ္။
KDWUP ONOWT
ciphertext ကုိ ဂဏန္းေတြေျပာင္းပါမယ္။
15 19 11 10 10 10 7 20 13 23
key stream ကုိေျပာင္းပါမယ္။
11 4 23 21 16 15 14 15 23 20
အဲဒီႏွစ္ခုကုိ ႏႈတ္ပါမယ္။ ဥပမာ။ 21-1=20, 1-22=5 ,etc)
4 15 14 15 20 21 19 5 16 3
စာေၾကာင္းေျပာင္းပါ.
DONOT USEPC

Oct 19, 2009

My Blog Posts From MyanmarDate.com

Now here it is ... I collect my little posts (poems) from www.myanmardate.com

dock dock dock !!! House owner !!!
-Can i come in ??? My name is Dr.LOVE. i heard that something is happened in your heart...i can cure you ....Take my LOVE...

Loving to the innocent rabbit who give a lot of trouble to me
..but....because of this rabbit...
-can feel the lyric more than melody
-can feel the breeze more than wind
-can feel the romance more than humor
-can love blue color more than red color
-want to show happiness ,,and want to be not knowing any of sadness ...
Whatever happened to me ,,, i only read this book .."about you "..


the man who take a little piece of hope ==>"when will she love me ??? "
the man who take a little piece of jealous ===>"when she loves others , ???"
the man who take a little piece of kind ===> "when can i help her ???"
the man who take a little piece of forgiveness ===> "whatever her do ,, ???"
the man who take a little piece of knowledge ===> "only about you "


From my childhood,,i play ,,,i read,,, i eat,,,i sleep,,,are all about i do and i understand....but after seeing you ,,,,i really know "i am a human ". coz when i see you,,my heart beats fast .. i feel LOVE ..i touch LOVE...ohhh ...so strange ..."even cannot tell any words in front of you " ..so strong .."even can die in front of you "...IS IT LOVE ??? ...or IS HE A FOOL ???? crazy !
but i accept that life is not perfect if there isn't LOVE !!!

Oct 15, 2009

ဒီတေလာ(၆)

So Busy And Bad Connection