ÏàʶLinuxÖ÷Ö¸µ¼¼Í¼£¨MBR£©¼°Æ书Ч
Linux MBRÏÈÈÝÓë×÷ÓÃ
MBR£¬¼´Ö÷Ö¸µ¼¼Í¼£¨Master Boot Record£©£¬ÊÇ´æ´¢ÔÚÅÌËã»úÓ²Å̵ĵÚÒ»¸öÉÈÇø£¨¼´0ºÅÉÈÇø£©µÄһС¶Î³ÌÐò£¬Í¨³£Õ¼ÓÐ512×Ö½Ú¡£ËüÊÇÅÌËã»úÖ¸µ¼Æô¶¯µÄÖ÷Òª×é³É²¿·Ö£¬Æðµ½Á˳ÐÉÏÆôϵÄÒªº¦×÷Óá£ÔÚLinuxϵͳÖУ¬MBRͬÑùÊÎÑÝ×ÅÖ÷ÒªµÄ½ÇÉ«£¬½ÓÏÂÀ´½«ÏêϸÏÈÈÝLinux MBRµÄ½á¹¹¡¢¹¦Ð§¼°Ïà¹Ø´úÂëʾÀý¡£
Ò»¡¢Linux MBR½á¹¹
Linux MBRÒ»Ñùƽ³£ÓÉÈý²¿·Ö×é³É£º
Ö÷Ö¸µ¼³ÌÐò£¨Boot Loader£©£ºÈÏÕæ¼ÓÔزÙ×÷ϵͳ£¬ÈçGRUB£¨GRand Unified Bootloader£©£»
·ÖÇø±í£¨Partition Table£©£º¼Í¼ӲÅÌ·ÖÇøÐÅÏ¢£¬°üÀ¨·ÖÇøÀàÐÍ¡¢ÆðʼλÖᢾÞϸµÈ£»
MBRÊðÃû£¨MBR Signature£©£º±êʶMBRÓÐÓÃÐԵıê¼Ç£¬Îª0x55AA¡£
¶þ¡¢Linux MBR×÷ÓÃ
Linux MBRµÄ×÷ÓÃÖ÷Òª°üÀ¨ÒÔϼ¸µã£º
Ö¸µ¼²Ù×÷ϵͳ£ºMBRÖеÄÖ÷Ö¸µ¼³ÌÐò»á³õʼ»¯Ö¸µ¼³ÌÐòÁ´£¬¼ÓÔزÙ×÷ϵͳ½¹µãÎļþ£¬Æô¶¯²Ù×÷ϵͳ£»
·ÖÇøÖÎÀí£º·ÖÇø±í¼Í¼ÁËÓ²ÅÌÉϸ÷·ÖÇøµÄÐÅÏ¢£¬ÈçÂß¼µØµã¡¢¾ÞϸµÈ£¬×ÊÖú²Ù×÷ϵͳ׼ȷʶ±ðÓ²ÅÌ·ÖÇø£»
Êý¾Ý±£»¤£ºMBRÊðÃûÓÃÓÚÑéÖ¤MBRµÄÓÐÓÃÐÔ£¬±ÜÃâ¶ñÒâ¸Ä¶¯»òË𻵣¬È·±£ÏµÍ³Çå¾²¿É¿¿¡£
Èý¡¢Linux MBR´úÂëʾÀý
ÏÂÃæ¸ø³öÒ»¸ö¼òÆÓµÄLinux MBR´úÂëʾÀý£¬Í¨¹ýÇ¿µ÷GRUBµÄ¼ÓÔØÀú³Ì£¬Õ¹Ê¾ÁËMBRµÄ×÷Óãº
; mbr.S ; Simple MBR program to load GRUB .code16 .section .text .org 0x7C00 start: jmp 0x00, end_of_program ; Ìøתµ½GRUB¼ÓÔصã nop end_of_program: cli hlt
µÇ¼ºó¸´ÖÆ
ÔÚÉÏÊöʾÀýÖУ¬Í¨¹ýjmp 0x00Ìøתµ½GRUBµÄ¼ÓÔص㣬´Ó¶ø¼ÓÔØGRUBÖ¸µ¼²Ù×÷ϵͳ¡£
×ܽ᣺Linux MBR×÷ΪÅÌËã»úÖ¸µ¼Æô¶¯µÄÒªº¦×é³É²¿·Ö£¬ÔÚLinuxϵͳÖÐÊ©Õ¹×ÅÖÁ¹ØÖ÷ÒªµÄ×÷Óá£Í¨¹ýÉÏÊöÏÈÈݵĽṹ¡¢¹¦Ð§¼°´úÂëʾÀý£¬Ï£Íû¶ÁÕ߶ÔLinux MBRÓÐÁ˸üÉîÈëµÄÏàʶ¡£
ÒÔÉϾÍÊÇÏàʶLinuxÖ÷Ö¸µ¼¼Í¼£¨MBR£©¼°Æ书ЧµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡