Mr. ProcessµÄÒ»Éú£LinuxÄں˵ÄÉç»áÊÓ½Ç (2)Æô¶¯
ÆäʵÕâ²ÅÓ¦¸ÃÊÇÕâһϵÁÐÎÄÕµĵÚÒ»½Ú£¬ÒòΪÕâƪÎÄÕ½²µÄÊÇÅ̹ſªÌìµØµÄÊ¡£»°ËµMr.
ProcessÊÇÒ»¸öÏÖ´úÈË£¬µ«ÊÇ£¬Ö»ÒªÊÇÈË£¬×ܸÃÓиö×æÏÈ¡£ÈËÃÇ×ÜÏëÖªµÀ×Ô¼º´ÓÄÄÀ´£¬È»ºó²Å¿ÉÒÔ¹ÀÃþËãÒ»ÏÂ×Ô¼º½«È¥ÏòºÎ·½¡£ËùÒÔÔÛÒ²ÒªÁ˽âÒ»ÏÂ
LinuxµÄÊÀ½çÀïÈËÀàµÄÆðÔ´¡£
ͼ1£º´ÓÉϵ絽BIOS
°´ÏµçÔ´¿ª¹ØµÄÄǸöÕæʵµÄÈ˾ÍÊÇLinuxÊÀ½çÀïµÄÉϵۣ¬Ëû´´ÔìÁËLinuxÊÀ½çµÄÒ»ÇС£µ±Ëû°´Ï»úÏäÉϵĵçÔ´¿ª¹Øʱ£¬Ö÷°å¿ªÊ¼¹©µç£¬CPUÉϵÄ
Reset
Pin±»À¸ß£¬Õâ»áÒýÆðCPUµÄһϵÁж¯×÷£¬ÕâЩ¶¯×÷ÊÇоƬÉè¼Æʱ¾Í¾ö¶¨µÄ¡£CPUÖеÄһЩ¼Ä´æÆ÷±»ÖÃΪ¹Ì¶¨µÄÖµ£¬ÒòΪÕâЩ¼Ä´æÆ÷¿ÉÄÜÔÚÆô¶¯µÄ¹ý³ÌÖÐҪʹ
Ó㬱ÈÈçCS£¨´úÂë¶Î¼Ä´æÆ÷£©ºÍEIP£¨Ö¸ÕëÖ¸Áî¼Ä´æÆ÷£©¡£ÕâÒ»²½Íê³ÉÖ®ºó£¬CPU¾Í¿É¿ªÖ´ÐеØַΪ0xfffffff0ÀïµÄROMÖеijÌÐò¡£Õâ¶Î³ÌÐò¾Í
ÊÇBIOS(Basic Input Output System)¡£
BIOSÍê³ÉÏÂÃæµÄ¹¦ÄÜ£º
1.POST£¨Power-On Self Test£©£º¹ËÃû˼Ãû£¬¾ÍÊDzé²éÓÐʲôÉ豸£¬ÕâЩÉ豸ÊDz»ÊÇÕý³£¡£ÒªÊÇCPUÓÐAdvanced
Configuration and Power Interface(ACPI
)µÄÖ§³Ö£¬Ò²ÔÚÕâ¸öʱºò½øÐС£ACPIÊÇÓÃÀ´¶ÔµçÔ´½øÐйÜÀíµÄ£¬ÓÃÀ´½ÚµçÖ®ÀàµÄ¡£
2.³õʼ»¯É豸£ºÈ·±£Ã»ÓÐIRQºÍIO³åÍ»¡£
3.Ñ°ÕÒOS/Bootloader¡£ÕâÒ»²½ºóÃæµãÔÙϸ˵
ÎÒÃÇÔÚBIOSµÄÉèÖò˵¥ÀïÄܹ»ÉèÖôӺδ¦Æô¶¯£¬±ÈÈçÈíÅÌ£¬Ó²ÅÌ£¬¹âÇý…BIOS»á°´ÎÒÃÇÉ趨µÄ˳ÐòËÑË÷OS¡£
4.°ÑBootloader¸´ÖƵ½RAMÀµØַΪ0×00007c00£©£¬È»ºóÄǸöµØÖ·¿ªÊ¼Ö´ÐС£
ʲôÊÇBootloader
£¿
ÏÖÔÚ£¬ÎÒÃÇÖ»Òª¹ØÐĵÄÊÇ£ºbootloader
»áÕÒµ½OS
£¬°ÑOS
ÄÚºËCOPY
µ½RAM
ÖС£
ͼ2£ºboot loaderµÄ¼ÓÔØ
ÈçÉÏͼËùʾ£¬ÔÚÓ²Å̵ĵÚÒ»¸ösector£¬ÓÐÒ»¸ö·ÖÇø±í£¨¼Ç¼ÁËÄÄЩ·ÖÇøÉÏÓвÙ×÷ϵͳ£©ºÍÒ»¸öС°æµÄBootloader¡£µ±Õâ¸öBIOS±»ÉèÖÃΪ
´ÓÕâÀïÆô¶¯Ê±£¬Õâ¸öС°æµÄbootloader±»¸´ÖƵ½RAMµÄ0×00007c00¡£È»ºóËü»á°Ñ×Ô¼ºÓÖÒƶ¯µ½0×00096a00¡£ÔÚÕâÖ®ºó£¬ËüÔÙ°ÑÁí
Ò»¶ÎBootloader´ÓÓ²ÅÌÉϸ´ÖƵ½0×00096c00£¬È»ºó´ÓÄÇÀ↑ʼִÐС£·Ö×÷Á½¶ÎµÄÔÒòÊÇÒòΪÏÖÔÚµÄbootloaderÌ«´óÁË£¬ÔÚMBRÉÏ
´æ²»ÍêÄÇô¶à¡£
Bootloader»á°ÑOSµÄÄÚºËÓ³Ïñ¸´ÖƵ½RAMÖС£
BootloaderµÄ¹¤×÷
1. µ÷ÓÃBIOSÒÔÏÔʾ“Loading Image”µÄÏûÏ¢¡£
2. µ÷ÓÃBIOS£¬°ÑÄÚºËÓ³ÏñµÄÇ°512×Ö½Ú¸´ÖƵ½0×00090000£¬setup()º¯ÊýÔÚ0×00090200¡£
3. µ÷ÓÃBIOS£¬°ÑʣϵÄÄÚºËÓ³Ïñ¼ÓÔص½0×00010000£¨Ð¡ÄÚºËzImage£©»ò0×00100000£¨´óÄÚºËbzImage£©
4. Ìøµ½
Ïà¹ØÎĵµ£º
¹ØÓÚ×ÔÐýËøÓ÷¨½éÉܵÄÎÄÕ£¬ÒѾÓкܶ࣬µ«ÓÐЩϸ½ÚµÄµØ·½µãµÄ»¹²»¹»Í¸¡£ÎÒÕâÀï¾Í°ÑÎÒ¸öÈËÈÏΪ´ó¼ÒÈÝÒ×ÓÐÒÉÎʵĵط½ÄóöÀ´ÌÖÂÛһϡ£
Ò»¡¢×ÔÐýËø£¨spinlock£©¼ò½é
×ÔÐýËøÔÚͬһʱ¿ÌÖ»Äܱ»×î¶àÒ»¸öÄÚºËÈÎÎñ³ÖÓУ¬ËùÒÔÒ»¸öʱ¿ÌÖ»ÓÐÒ»¸öÏß³ÌÔÊÐí´æÔÚÓÚÁÙ½çÇøÖС£Õâµã¿ÉÒÔÓ¦ÓÃÔڶദÀí»úÆ÷¡¢»òÔËÐÐÔÚµ¥´¦ÀíÆ÷ÉϵÄÇ ......
iptablesÊÇÒ»¸ö
Linux
ÏÂÓÅÐãµÄnat+·À»ðǽ¹¤¾ß£¬ÎÒʹÓøù¤¾ßÒԽϵÍÅäÖõĴ«Í³pcÅäÖÃÁËÒ»¸ö
Áé»îÇ¿¾¢µÄ·À»ðǽ+natϵ
ͳ,СÓÐÐĵ㬿´
ÁËÍøÉÏÒ²ÓкܶàÕâ·½ÃæµÄÎÄÕ£¬µ«ÊÇËƺõҪô˵µÄ±È½ÏÉÙ£¬ÒªÃ´¾ÍÊDZȽÏÆ«£¬ÄÚÈݲ»È«£¬ÈÝÒ×Îóµ¼£¬ÎÒÑо¿ÁËÒ»¶Îʱ¼äµÄiptablesͬʱҲÓÃÁ˺ܾã¬ÓеãµÎ
¾Ñ飬дÀ´¹©´ó¼Ò²Î¿¼£¬Í¬Ê±Ò²±¸ ......
poweroff
shutdown -h Á¢¿Ì¹Ø»ú
shutdown -h 10 10·Öºó¹Ø»ú
shutdown -h 20:25 ʲôʱºò¶¨Ê±¹Ø»ú
shutdown -r now
reboot
pwd ÏÔʾµ±Ç°Â·¾¶
cd .. ·µ»ØÉÏÒ»¼¶
mkdir -p animal/dog Ç¿ÖÆ´´½¨animalĿ¼ÒÔ¼°×ÓĿ¼dog
rm * ɾ³ýÎļþ»òÕßĿ¼
rm -f * Ç¿ÖÆɾ³ý
cat a.txt>>b.ini ½«a.txtÏÔʾ²¢×·¼Óµ½b.iniµÄÄ ......
PCIÊÇÍâΧÉ豸»¥ÁªµÄ¼ò³Æ(Peripheral Component
Interconnect)µÄ¼ò³Æ£¬×÷ΪһÖÖͨÓõÄ×ÜÏß½Ó¿Ú±ê×¼£¬ËûÔÚ¼ÆËã»úϵͳÖеõ½Á˹㷺µÄʹÓá£PCIµÄËÙ¶ÈÄܹ»´ïµ½132M/s¡£ÔÚÕâÀï¼òµ¥µÄ½é
ÉÜһϠlinux ÏÂPCIÇý¶¯µÄʵÏÖ¡£
ÔÚ±àдһ¸öPCIÇý¶¯µÄʱºòÎÒÃÇÏȵÃÈ·¶¨ÏµÍ³ÖÐÊÇ·ñÓÐÎÒÃǵÄÉ豸¡£ÎÒÃÇ¿ÉÒÔͨ¹ýlspci
²é¿´PCIÉ豸¡£
[roo ......
ÍøÂç±à³ÌºÍÆäËû±à³Ì×î´óµÄÇø±ð¾ÍÊÇ£ºÍøÂç±à³ÌÓÉÁ½²¿·Ö×é³É£¬¿Í»§¶ËºÍ·þÎñÆ÷¶Ë¡£ÏÈÆô¶¯·þÎñÆ÷¶Ë¡¢µÈ´ý¿Í»§¶ËµÄ³ÌÐòÔËÐв¢½¨Á¢Á¬½Ó£»Ò»°ãÀ´Ëµ£¬ÊÇ·þÎñÆ÷¶ËµÄ³ÌÐòÔÚÒ»¸ö¶Ë¿ÚÉϼàÌý£¬µÈ´ýÓÐÒ»¸ö¿Í»§¶ËµÄ³ÌÐò·¢À´ÇëÇó¡£
ÍøÂç±à³Ì»¹ÒªÒýÈëÒ»¸ö¸ÅÄÐÒé¡£ÔÚÍøÂç ......