ʹÓà Linux ϵͳµ÷ÓõÄÄÚºËÃüÁî
2007 Äê 4 ÔÂ 17 ÈÕ
Linux® ϵͳµ÷Óà ——
ÎÒÃÇÿÌ춼ÔÚʹÓÃËüÃÇ¡£²»¹ýÄúÇå³þϵͳµ÷ÓÃÊÇÈçºÎÔÚÓû§¿Õ¼äºÍÄÚºËÖ®¼äÖ´ÐеÄÂ𣿱¾ÎĽ«Ì½¾¿ Linux
ϵͳµ÷Óýӿڣ¨SCI£©£¬Ñ§Ï°ÈçºÎÌí¼ÓеÄϵͳµ÷Óã¨ÒÔ¼°ÊµÏÖÕâÖÖ¹¦ÄܵÄÆäËû·½·¨£©£¬²¢½éÉÜÓë SCI ÓйصÄһЩ¹¤¾ß¡£
ϵͳµ÷ÓÃ
¾ÍÊÇÓû§¿Õ¼äÓ¦ÓóÌÐòºÍÄÚºËÌṩµÄ·þÎñÖ®¼äµÄÒ»¸ö½Ó¿Ú¡£ÓÉÓÚ·þÎñÊÇÔÚÄÚºËÖÐÌṩµÄ£¬Òò´ËÎÞ·¨Ö´ÐÐ
Ö±½Óµ÷Óã»Ïà·´£¬Äú±ØÐëʹÓÃÒ»¸ö½ø³ÌÀ´¿çÔ½Óû§¿Õ¼äÓëÄÚºËÖ®¼äµÄ½çÏÞ¡£ÔÚÌض¨¼Ü¹¹ÖÐʵÏִ˹¦Äܵķ½·¨»áÓÐËù²»Í¬¡£Òò´Ë£¬±¾ÎĽ«×ÅÑÛÓÚ×îͨÓõļܹ¹ ——
i386¡£
ÔÚ±¾ÎÄÖУ¬ÎÒ½«Ì½¾¿ Linux SCI£¬ÑÝʾÈçºÎÏò 2.6.20
ÄÚºËÌí¼ÓÒ»¸öϵͳµ÷Óã¬È»ºó´ÓÓû§¿Õ¼äÀ´Ê¹ÓÃÕâ¸öº¯Êý¡£ÎÒÃÇ»¹½«Ñо¿ÔÚ½øÐÐϵͳµ÷Óÿª·¢Ê±·Ç³£ÓÐÓõÄһЩº¯Êý£¬ÒÔ¼°ÏµÍ³µ÷ÓõÄÆäËûÑ¡Ôñ¡£×îºó£¬ÎÒÃǽ«½éÉÜ
Óëϵͳµ÷ÓÃÓйصÄһЩ¸¨Öú»úÖÆ£¬±ÈÈçÔÚij¸ö½ø³ÌÖиú×Ùϵͳµ÷ÓõÄʹÓÃÇé¿ö¡£
SCI
Linux ÖÐϵͳµ÷ÓõÄʵÏÖ»á¸ù¾Ý²»Í¬µÄ¼Ü¹¹¶øÓÐËù±ä»¯£¬¶øÇÒ¼´Ê¹ÔÚijÖÖ¸ø¶¨µÄÌå¼Ü¹¹ÉÏÒ²»á²»Í¬¡£ÀýÈ磬ÔçÆÚµÄ x86
´¦ÀíÆ÷ʹÓÃÁËÖжϻúÖÆ´ÓÓû§¿Õ¼äǨÒƵ½Äں˿ռäÖУ¬²»¹ýÐ嵀 IA-32 ´¦ÀíÆ÷ÔòÌṩÁËһЩָÁî¶ÔÕâÖÖת»»½øÐÐÓÅ»¯£¨Ê¹Óà sysenter
ºÍ sysexit
Ö¸Á¡£ÓÉÓÚ´æÔÚ´óÁ¿µÄ·½·¨£¬×îÖÕ½á¹ûÒ²·Ç³£¸´ÔÓ£¬Òò´Ë±¾ÎĽ«×ÅÖØÓÚ½Ó¿Úϸ½ÚµÄ±í²ãÌÖÂÛÉÏ¡£¸üÏ꾡µÄÄÚÈÝÇë²Î¿´±¾ÎÄ×îºóµÄ ²Î
¿¼×ÊÁÏ
¡£
Òª¶Ô Linux µÄ SCI ½øÐиĽø£¬Äú²»ÐèÒªÍêÈ«Àí½â SCI
µÄÄÚ²¿ÔÀí£¬Òò´ËÎÒ½«Ê¹ÓÃÒ»¸ö¼òµ¥µÄϵͳµ÷Óýø³Ì£¨Çë²Î¿´Í¼ 1£©¡£Ã¿¸öϵͳµ÷Óö¼ÊÇͨ¹ýÒ»¸öµ¥Ò»µÄÈë¿Úµã¶à·´«ÈëÄںˡ£eax
¼Ä´æÆ÷ÓÃÀ´±êʶӦµ±µ÷ÓõÄij¸öϵͳµ÷Óã¬ÕâÔÚ C
¿âÖÐ×öÁËÖ¸¶¨£¨À´×ÔÓû§¿Õ¼äÓ¦ÓóÌÐòµÄÿ¸öµ÷Óã©¡£µ±¼ÓÔØÁËϵͳµÄ C
¿âµ÷ÓÃË÷ÒýºÍ²ÎÊýʱ£¬¾Í»áµ÷ÓÃÒ»¸öÈí¼þÖжϣ¨0x80 Öжϣ©£¬Ëü½«Ö´ÐÐ system_call
º¯Êý£¨Í¨¹ýÖжϴ¦Àí³ÌÐò£©£¬Õâ¸öº¯Êý»á°´ÕÕ eax ÄÚÈÝÖеıêʶ´¦ÀíËùÓеÄϵͳµ÷Óá£ÔÚ¾¹ý¼¸¸ö¼òµ¥²âÊÔÖ®ºó£¬Ê¹Óà system_call_table
ºÍ eax Öаüº¬µÄË÷ÒýÀ´Ö´ÐÐÕæÕýµÄϵͳµ÷ÓÃÁË¡£´Óϵͳµ÷ÓÃÖзµ»Øºó£¬×îÖÕÖ´ÐÐ syscall_exit
£¬²¢µ÷Óà resume_userspace
·µ»ØÓû§¿Õ¼ä¡£È»ºó¼ÌÐøÔÚ C
¿âÖÐÖ´ÐУ¬Ëü½«·µ»Øµ½Óû§Ó¦ÓóÌÐòÖС£
ͼ 1. ʹÓÃÖжϷ½·¨µÄϵͳµ÷Óõļò»¯Á÷³Ì
SCI µÄºËÐÄÊÇϵͳµ÷Óöà··Ö½â±í¡£Õâ¸ö±íÈçͼ 2 Ëùʾ£¬
Ïà¹ØÎĵµ£º
3ks:http://boz8.com/house/article.aspx?aid=112
ÔÚLinuxϽøÐÐCÓïÑÔ±à³Ì£¬±ØȻҪ²ÉÓÃGNU GCCÀ´±àÒëCÔ´´úÂëÉú³É¿ÉÖ´ÐгÌÐò¡£
Ò»¡¢GCC¿ìËÙÈëÃÅ
GccÖ¸ÁîµÄÒ»°ã¸ñʽΪ£ºGcc [Ñ¡Ïî] Òª±àÒëµÄÎļþ [Ñ¡Ïî] [Ä¿±êÎļþ]
ÆäÖУ¬Ä¿±êÎļþ¿Éȱʡ£¬GccĬÈÏÉú³É¿ÉÖ´ÐеÄÎļþÃûΪ£º±àÒëÎļþ.out
ÎÒÃÇÀ´¿´Ò»Ï¾µäÈëÃųÌÐò"Hello Wor ......
ʹÓÃBusyBoxÖÆ×÷linux¸ùÎļþϵͳ£¨CramFS+mdev£©
²Ù×÷ϵͳ£ºUbuntu9.04
Äں˰汾£ºlinux-2.6.24.7
¿ª·¢°å£º²©´´arm2410s
½»²æ±àÒ빤¾ß£ºarm-linux-gcc-4.1.1
BusyBox£ºbusybox-1.11.1
CramFS£ºCramFS-1.1
×¢Ò⣺ÓÉÓÚÒªÖ ......
linuxÍøÂçÁ¬½ÓÅäÖÃͨ¹ýÃüÁîifconfigÀ´Íê³É£¬Ò²¾ÍÊÇinterface configuration¡£
£¡£¡ÓÑÇéÌáÐÑ£ºÏÂÃæÓõÄÃüÁîÓÐЩÐèÒªrootȨÏÞ
²é¿´ÍøÂçÁ¬½Ó
ifconfig
eth0 Link encap:ÒÔÌ«Íø Ó²¼þµØÖ· 00:e0:61:02:af:ba
&n ......
±¾ÎÄÁгöÁ˴󲿷ֳ£¼ûµÄLinuxϵͳµ÷Ó㬲¢¸½ÓмòÒªÖÐÎÄ˵Ã÷¡£ ÒÔÏÂÊÇLinuxϵͳµ÷ÓõÄÒ»¸öÁÐ±í£¬°üº¬Á˴󲿷ֳ£ÓÃϵͳµ÷ÓúÍÓÉϵͳµ÷ÓÃÅÉÉú³öµÄµÄº¯Êý¡£Õâ¿ÉÄÜÊÇÄãÔÚ»¥ÁªÍøÉÏËùÄÜ¿´µ½µÄΨһһƪÖÐÎÄ×¢Ê͵ÄLinuxϵͳµ÷ÓÃÁÐ±í£¬¼´Ê¹ÊǼòµ¥µÄ×ÖĸÐòÓ¢ÎÄÁÐ±í£¬ÄÜ×öµ½ÕâôÍêÈ«Ò²ÊǺܺ±¼ûµÄ¡£ °´ÕÕ¹ßÀý£¬Õâ¸öÁбíÒÔman pagesµÚ2½ ......