Linux Kernelѧϰ±Ê¼Ç
Linux Kernelѧϰ±Ê¼Ç
Table of Contents
1. ´æ´¢Æ÷Ñ°Ö·
2. É豸Çý¶¯³ÌÐò¿ª·¢
3. ×Ö·ûÉ豸Çý¶¯³ÌÐò
3.1. É豸ºÅ
3.2. É豸ºÅµÄ·ÖÅäºÍÊÍ·Å
3.3. ÖØÒªµÄÊý¾Ý½á¹¹
3.4. ¶ÁºÍд
4. PCIÉ豸
5. Äں˳õʼ»¯ÓÅ»¯ºê
6. ·ÃÎÊÄں˲ÎÊýµÄ½Ó¿Ú
7. Äں˳õʼ»¯Ñ¡Ïî
8. ÄÚºËÄ£¿é±à³Ì
8.1. ÈëÃÅ
8.2. Ϊģ¿éÌí¼ÓÃèÊöÐÅÏ¢
8.3. ÄÚºËÄ£¿é´¦ÀíÃüÁî½éÉÜ
9. ÍøÂç×Óϵͳ
9.1. sk_buff½á¹¹
9.2. sk_buff½á¹¹²Ù×÷º¯Êý
9.3. net_device½á¹¹
9.4. ÍøÂçÉ豸³õʼ»¯
9.5. ÍøÂçÉ豸ÓëÄں˵ŵͨ·½Ê½
9.6. ÍøÂçÉ豸²Ù×÷²ãµÄ³õʼ»¯
9.7. ÄÚºËÄ£¿é¼ÓÔØÆ÷
9.8. ÐéÄâÉ豸
9.9. 8139too.cÔ´Âë·ÖÎö
9.10. ÄÚºËÍøÂçÊý¾ÝÁ÷
10. ±¸Íü¼
Chapter 1. ´æ´¢Æ÷Ñ°Ö·
ÔÚ80x86΢´¦ÀíÆ÷ÖУ¬ÓÐÈýÖÖ´æ´¢Æ÷µØÖ·£º
· Âß¼µØÖ·£¨logical address£©£¬°üº¬ÔÚ»úÆ÷ÓïÑÔÖ¸ÁîÖÐÓÃÀ´Ö¸¶¨Ò»¸ö²Ù×÷Êý»òÒ»ÌõÖ¸ÁîµÄµØÖ·¡£Ã¿¸öÂß¼µØÖ·¶¼ÓÉÒ»¸ö¶Î£¨segment£©ºÍÒ»¸öÆ«ÒÆÁ¿£¨offset£©×é³É¡£Æ«ÒÆÁ¿Ö¸Ã÷Á˴ӶεĿªÊ¼µ½Êµ¼ÊµØÖ·Ö®¼äµÄ¾àÀë¡£
· ÏßÐÔµØÖ·£¨linear address£©£¨Ò²³ÆΪÐéÄâµØÖ·£¬virtual address£©£¬ËüÊÇÒ»¸ö32λÎÞ·ûºÅÕûÊý£¬¿ÉÓÃÒÔ±í´ï¸ß´ï4GµÄµØÖ·£¨2µÄ32´Î·½£©¡£Í¨³£ÒÔÊ®Áù½øÖÆÊý±íʾ£¬ÖµµÄ·¶Î§´Ó0X00000000µ½0Xffffffff¡£
· ÎïÀíµØÖ·£¨physical address£©£¬ÓÃÓÚ´æ´¢Æ÷оƬ¼¶´æ´¢µ¥ÔªÑ°Ö·£¬ËüÃÇÓë´Ó΢´¦ÀíÆ÷µÄµØÖ·Òý½Å·¢Ë͵½´æ´¢Æ÷×ÜÏßÉϵĵçÐźÅÏà¶ÔÓ¦¡£ÎïÀíµØÖ·ÓÉ32λÎÞ·ûºÅÕûÊý±íʾ¡£
CPU¿ØÖƵ¥ÔªÍ¨¹ýÒ»ÖÖ³ÆΪ·Ö¶Îµ¥Ôª£¨segmentation unit£©µÄÓ²¼þµç·°ÑÒ»¸öÂß¼µØַת»»³ÉÏßÐÔµØÖ·;ÏßÐÔµØÖ·ÓÖͨ¹ýÒ»¸ö·ÖÒ³µ¥Ôª£¨paging unit£©µÄÓ²¼þµç·°ÑÒ»¸öÏßÐÔµØַת»»³ÉÎïÀíµØÖ·¡£
Âß¼µØÖ·ÓÉÁ½²¿·Ý×é³É£¬Ò»¸ö¶Î±êʶ·ûºÍÒ»¸öÖ¸¶¨¶ÎÓÉÏà¶ÔµØÖ·µÄÆ«ÒÆÁ¿¡£¶Î±êʶ·ûÊÇÒ»¸ö16볤µÄ×ֶΣ¬³ÆΪ¶ÎÑ¡Ôñ·û£¨segment selector£©£¬Æ«ÒÆÁ¿ÊÇÒ»¸ö32볤µÄ×ֶΡ£
´¦ÀíÆ÷ÌṩרÃŵĶμĴæÆ÷ÒÔ¿ìËÙ´¦Àí¶ÎÑ¡Ôñ·û£¬¶Î¼Ä´æÆ÷µÄΨһĿµÄ¾ÍÊÇ´æ·Å¶ÎÑ¡Ôñ·û¡£¹²ÓÐ6¸ö¶Î¼Ä´æÆ÷£¬·Ö±ðÊÇcs¡¢ss¡¢ds¡¢es¡¢fsºÍgs¡£ÆäÖÐcs¡¢ss¡¢ds¼Ä´æÆ÷ÓÐרÃŵÄÓÃ;¡£
· csÊÇ´úÂë¶Î¼Ä´æÆ÷£¬Ö¸Ïò°üº¬³ÌÐòÖ¸ÁîµÄ¶Î¡£
· ssÊÇÕ»¼Ä´æÆ÷£¬Ö¸Ïò°üº¬µ±Ç°³ÌÐòÕ»µÄ¶Î¡£
· dsÊÇÊý¾Ý¶Î¼Ä´æÆ÷£¬Ö¸Ïò°üº¬¾²Ì¬Êý¾Ý»òÕßÍⲿÊý¾ÝµÄ¶Î¡£
cs¼Ä´æÆ÷ÓÐÒ»¸öÖØÒª¹¦ÄÜ£¬Ëü°üº¬ÓÐÒ»¸öÁ½Î»µÄ×Ö
Ïà¹ØÎĵµ£º
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.ref ......
1. ÄÚ´æ·ÖÅ䷽ʽ
(1) ´Ó¾²Ì¬´æ´¢ÇøÓò·ÖÅä¡£ÄÚ´æÔÚ³ÌÐò±àÒëµÄʱºò¾ÍÒѾ·ÖÅäºÃ£¬Õâ¿éÄÚ´æÔÚ³ÌÐòµÄÕû¸öÔËÐÐÆڼ䶼´æÔÚ¡£ÀýÈ磺ȫ¾Ö±äÁ¿£¬static±äÁ¿¡£
(2) ÔÚÕ»ÉÏ´´½¨¡£ÔÚÖ´Ðк¯Êýʱ£¬º¯ÊýÄÚ¾Ö²¿±äÁ¿µÄ´æ´¢µ¥Ôª¶¼¿ÉÒÔÔÚÕ»ÉÏ´´½¨£¬º¯ÊýÖ´ÐнáÊøµÄʱºòÕâЩ´æ´¢µ¥Ôª×Ô¶¯±»ÊÍ·Å¡£Õ»ÄÚ´æ·ÖÅäÔËËãÄÚÖÃÓÚ´¦ÀíÆ÷µÄÖ¸ÁÖУ¬Ð§Âʺܸ ......
Ç°¼¸ÌìÖØ×°ÁËwindowsϵͳ£¬µ¼ÖÂÒÔÇ°°²×°µÄLinux½ø²»È¥ÁË£¬ÎÞ·¨½øÈëLinux£¬Óò»ÏëÖØа²×°Linux£¬ÄÇÑùÌ«·ÑÊÂÁË£¬ÔÚÍøÉÏËÑË÷ÁËһϣ¬ÕÒµ½»Ö¸´LinuxÒýµ¼µÄ·½·¨£¬¾ÊµÑ飬ÖØÐÂÒýµ¼½øÈëÔÀ´µÄLinuxϵͳ£¬Ôڴ˼òµ¥¼Ç¼һÏ£º
Ê×ÏÈ£¬ÏÂÔØÒ»¸öGrub4dos£¬½âѹµ½CÅ̸ùĿ¼Ï£¬°ÑÀïÃæµÄgrldr¸´ÖƵ½¸ùĿ¼Ï£¬ÐÞ¸Äboot.iniÎļþ£ ......
¼¤¶¯°¡£¬½ñÌìÏÂÎç·ÅѧÀíÍê·¢»ØÀ´ÎÒ°Ö¸æËßÎÒ˵¼ÄÀ´Ñù¶«Î÷£¬»¹ÊÇ´Ó¹úÍâ¼ÄÀ´µÄ£¡ÕâÊÇÎÒµÚÒ»´Î´Ó¹úÍâ±ðÈ˸øÎҼĶ«Î÷¡£·Ï»°²»¶à˵£¬ÉÏͼ²ÅÊÇÍõµÀ¡£ÓÉÓÚÅÄÉãÌõ¼þ¹ýÓÚ¼òª£¨ÁªÏëI398ÊÖ»ú+ÊÖµçͲ£©£¬Óе㱾ßÁË¡£
°ü¹üÕýÃæµÄÍâ°ü×°
°ü¹ü±³Ã棨Ϊ·ÀÖ¹¸öÈËÐÅϢй¶ÄÃÅçÆáºÍгÁËһϣ©
°ü¹ü×îÉÏÃ棬ÓÉÓÚÓ¢ÓïˮƽÓÐÏÞÿ̫¿´¶®ÊÇÊ²Ã´Ò ......