linux µ÷¶ÈÆ÷·¢Õ¹¼òÊö
·¢²¼µÄ 2.6.23 ÄÚºËÖаüº¬ÁËÒ»¸öÖØÒªµÄ±ä»¯£¬ÓÃCFSÌæ´úÁËÒÔÇ°µÄµ÷¶ÈÆ÷¡£CFS ±»ºÏ²¢µ½ mainline ֮ǰ£¬¹ØÓÚÄں˵÷¶ÈÆ÷»¹ÓÐÒ»¸öÖØÒªµÄ patch£ºRSDL¡£×îÖÕ 2.6.23 ¾ö¶¨½« CFS ºÏ²¢µ½ mainline ¶ø·ÅÆúÁË RSDL¡£ÎªÊ²Ã´ÒªÒýÈëеĵ÷¶ÈÆ÷£¬CFS ºÍ RSDL ÓÐʲôÁªÏµºÍÇø±ð£¿±¾ÎÄÊÔͼ¶ÔÄں˵÷¶ÈËã·¨µÄ·¢Õ¹ÀúÊ·×öÒ»¸ö¼òÒª½éÉÜ£¬Ï£ÍûÄܶÔÉÏÊöÎÊÌâµÄÀí½âÓÐËù°ïÖú¡£
ÒýÑÔ
½ø³Ìµ÷¶ÈÊDzÙ×÷ϵͳµÄºËÐŦÄÜ¡£µ÷¶ÈÆ÷Ö»ÊÇÊǵ÷¶È¹ý³ÌÖеÄÒ»²¿·Ö£¬½ø³Ìµ÷¶ÈÊǷdz£¸´ÔӵĹý³Ì£¬ÐèÒª¶à¸öϵͳÐͬ¹¤×÷Íê³É¡£±¾ÎÄËù¹Ø×¢µÄ½öΪµ÷¶ÈÆ÷£¬ËüµÄÖ÷Òª¹¤×÷ÊÇÔÚËùÓÐ RUNNING ½ø³ÌÖÐÑ¡Ôñ×îºÏÊʵÄÒ»¸ö¡£×÷Ϊһ¸öͨÓòÙ×÷ϵͳ£¬Linux µ÷¶ÈÆ÷½«½ø³Ì·ÖΪÈýÀࣺ
½»»¥Ê½½ø³Ì
´ËÀà½ø³ÌÓдóÁ¿µÄÈË»ú½»»¥£¬Òò´Ë½ø³Ì²»¶ÏµØ´¦ÓÚ˯Ãß״̬£¬µÈ´ýÓû§ÊäÈë¡£µäÐ͵ÄÓ¦ÓñÈÈç±à¼Æ÷ vi¡£´ËÀà½ø³Ì¶ÔϵͳÏìӦʱ¼äÒªÇó±È½Ï¸ß£¬·ñÔòÓû§»á¸Ð¾õϵͳ·´Ó¦³Ù»º¡£
Åú´¦Àí½ø³Ì
´ËÀà½ø³Ì²»ÐèÒªÈË»ú½»»¥£¬ÔÚºǫ́ÔËÐУ¬ÐèÒªÕ¼ÓôóÁ¿µÄϵͳ×ÊÔ´¡£µ«ÊÇÄܹ»ÈÌÊÜÏìÓ¦ÑÓ³Ù¡£±ÈÈç±àÒëÆ÷¡£
ʵʱ½ø³Ì
ʵʱ¶Ôµ÷¶ÈÑÓ³ÙµÄÒªÇó×î¸ß£¬ÕâЩ½ø³ÌÍùÍùÖ´Ðзdz£ÖØÒªµÄ²Ù×÷£¬ÒªÇóÁ¢¼´ÏìÓ¦²¢Ö´ÐС£±ÈÈçÊÓƵ²¥·ÅÈí¼þ»ò·É»ú·ÉÐпØÖÆϵͳ£¬ºÜÃ÷ÏÔÕâÀà³ÌÐò²»ÄÜÈÝÈ̳¤Ê±¼äµÄµ÷¶ÈÑÓ³Ù£¬ÇáÔòÓ°ÏìµçÓ°·ÅӳЧ¹û£¬ÖØÔò»ú»ÙÈËÍö¡£
¸ù¾Ý½ø³ÌµÄ²»Í¬·ÖÀà Linux ²ÉÓò»Í¬µÄµ÷¶È²ßÂÔ¡£¶ÔÓÚʵʱ½ø³Ì£¬²ÉÓà FIFO »òÕß Round Robin µÄµ÷¶È²ßÂÔ¡£¶ÔÓÚÆÕͨ½ø³Ì£¬ÔòÐèÒªÇø·Ö½»»¥Ê½ºÍÅú´¦ÀíʽµÄ²»Í¬¡£´«Í³ Linux µ÷¶ÈÆ÷Ìá¸ß½»»¥Ê½Ó¦ÓõÄÓÅÏȼ¶£¬Ê¹µÃËüÃÇÄܸü¿ìµØ±»µ÷¶È¡£¶ø CFS ºÍ RSDL µÈеĵ÷¶ÈÆ÷µÄºËÐÄ˼ÏëÊÇ“ÍêÈ«¹«Æ½”¡£Õâ¸öÉè¼ÆÀíÄî²»½ö´ó´ó¼ò»¯Á˵÷¶ÈÆ÷µÄ´úÂ븴ÔӶȣ¬»¹¶Ô¸÷ÖÖµ÷¶ÈÐèÇóµÄÌṩÁ˸üÍêÃÀµÄÖ§³Ö¡£
ÔÚ̽ÌÖCFSºÍRSDL֮ǰ£¬ÎÒÃÇÊ×ÏȻعËÒ»ÏÂLinux2.4ºÍLinux2.6.0ÖÐËùʹÓõĵ÷¶ÈÆ÷¡£
Äں˵÷¶ÈÆ÷µÄ¼òµ¥ÀúÊ·
2.1 Linux2.4 µÄµ÷¶ÈÆ÷
Linux2.4.18 ÖÐʹÓõĵ÷¶ÈÆ÷²ÉÓûùÓÚÓÅÏȼ¶µÄÉè¼Æ£¬Õâ¸öµ÷¶ÈÆ÷ºÍ Linus ÔÚ 1992 Äê·¢²¼µÄµ÷¶ÈÆ÷ûÓдóµÄÇø±ð¡£¸Ãµ÷¶ÈÆ÷µÄ pick next Ëã·¨·Ç³£¼òµ¥£º¶Ô runqueue ÖÐËùÓнø³ÌµÄÓÅÏȼ¶½øÐÐÒÀ´Î½øÐбȽϣ¬Ñ¡Ôñ×î¸ßÓÅÏȼ¶µÄ½ø³Ì×÷ΪÏÂÒ»¸ö±»µ÷¶ÈµÄ½ø³Ì¡£(Runqueue ÊÇ Linux ÄÚºËÖб£´æËùÓоÍÐ÷½ø³ÌµÄ¶ÓÁÐ) ¡£ÊõÓï pick next ÓÃÀ´Ö¸´ÓËùÓкòÑ¡½ø³ÌÖÐÌôÑ¡ÏÂÒ»¸öÒª±»µ÷¶ÈµÄ½ø³ÌµÄ¹ý³Ì¡£
ÿ¸ö½ø³Ì±»´´½¨Ê±¶¼±»¸³ÓèÒ»¸öʱ¼äƬ¡£Ê±ÖÓÖжϵݼõµ±Ç°ÔËÐнø³ÌµÄʱ¼äƬ£¬µ±½ø³ÌµÄʱ¼äƬ±»ÓÃÍêʱ£¬Ëü±ØÐëµÈ´ýÖ
Ïà¹ØÎĵµ£º
´´½¨×ÀÃæͼ±ê
Ä¿Ç°½«ÍøÂçÓ¦ÓÃÀ©Õ¹µ½×ÀÃæÊÇÒ»¸öÇ÷ÊÆ£¬´æÔÚןܶà½â¾ö·½°¸£¬±¾ÎÄÒÔ Mozilla Prism ΪÀý£¬ÀàËƵķ½·¨Í¬ÑùÊÊÓÃÓÚ Google Chrome ¡£
1. µ½ Mozilla Prism µÄÍøÕ¾ÉÏÏÂÔØ Prism£¬µã»÷ Download Now Ö®ºó»áÌáʾÓÐÁ½ÖÖ£¬Ò»ÖÖÊÇÒÔ Mozilla Firefox À©Õ¹µÄ·½Ê½£¬ÊʺÏÒѾ°²×°ÓÐ Firefox µÄÅóÓÑ£»Ò»Ö ......
Ò»¡¢¸ÅÊö
ϵͳµ÷ÓÃÊÇÒ»¸öÈíÖжϣ¬ÖжϺÅÊÇ0x80£¬ËüÊÇÉϲãÓ¦ÓóÌÐòÓëLinuxϵͳÄں˽øÐн»»¥Í¨ÐŵÄΨһ½Ó¿Ú¡£Í¨¹ýint 0x80£¬¾Í¿ÉʹÓÃÄÚºË×ÊÔ´¡£²»¹ý£¬Í¨³£Ó¦ÓóÌÐò¶¼ÊÇʹÓþßÓбê×¼½Ó¿Ú¶¨ÒåµÄCº¯Êý¿â¼ä½ÓµÄʹÓÃÄں˵Äϵͳµ÷Ó㬼´Ó¦ÓóÌÐòµ÷ÓÃCº¯Êý¿âÖеĺ¯Êý£¬Cº¯Êý¿âÖÐ ......
ÔÛ¾Í˵˵linuxÔõôһ²½µ½Î»ÉèÖÃϵͳʱ¼ä¡£ÄÃlinuxÐéÄâ»ú×öʵÑéµÄÅóÓÑ»áÖªµÀ¡£µ±Äã°Ñlinux»¹Ôµ½Ä³¸öµãµÄʱºò£¬vmware°ï²»ÁËÄã°Ñϵͳʱ¼äÒ²¸øÖØÉèÁË¡£ËùÒÔÕâʱºò¾ÍÒªÊÖ¹¤À´¸ã¡£¹ØÓÚÕ¦Éèlinuxʱ¼ä¡£ÍøÉϽéÉÜÒ²ºÜ¶à£¬µ«ÊǶ¼ÊdzÀ´³È¥µÄ¶«Î÷¡£ÄÇÔõô²ÅÄܸßЧ¿ì½ÝµÄÉèÖÃϵͳʱ¼äÄØ£¿
&nb ......
LinuxÄÚºË×·×Ùÿ¸ö½ø³ÌʹÓõÄ×Ê ±ÈÈç ¶ÑÕ» ´úÂë¶Î Êý¾Ý¶Î ÔËÐеÄλÖÃ
int getrusage(int who , struct rusage * usage) ¼ì²é½ø³Ì±¾Éí£¬×Ó½ø³Ì»òÕßÁ½ÕßÖ®ºÍµÄ×ÊԴʹÓÃ
º¯Êý·µ»ØÒ»¸öusage½á¹¹£¬´æ·Å½ø³ÌʹÓõÄ×ÊÔ´
usageÊǺܳ¤µÄL ......
£¨1£©ÈýÐǵĴ¥ÃþÆÁÇý¶¯s3c-ts.c£º
s3c_ts_init-¡·platform_driver_register(&s3c_ts_driver)£»
static struct platform_driver s3c_ts_driver = {
.probe = s3c_ts_probe,
.dri ......