Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

[ת]Linux ÖÐ x86 µÄÄÚÁª»ã±à

Linux ÖÐ x86 µÄÄÚÁª»ã±à
¼¶±ð£º ³õ¼¶
Bharata B. Rao (rbharata@in.ibm.com)IBM Linux ¼¼ÊõÖÐÐÄ£¬IBM Èí¼þʵÑéÊÒ£¬Ó¡¶È
2001 Äê 3 ÔÂ 01 ÈÕ
Bharata B. Rao ÌṩÁËÔÚ Linux ƽ̨ÉÏʹÓú͹¹Ôì x86 ÄÚÁª»ã±àµÄ¸ÅÀ¨ÐÔ½éÉÜ¡£Ëû½éÉÜÁËÄÚÁª»ã±à¼°Æä¸÷ÖÖÓ÷¨µÄ»ù´¡ÖªÊ¶£¬ÌṩÁËһЩ»ù±¾µÄÄÚÁª»ã±à±àÂëÖ¸µ¼£¬²¢½âÊÍÁËÔÚ Linux ÄÚºËÖÐÄÚÁª»ã±à´úÂëµÄһЩʵÀý¡£
Èç¹ûÄúÊÇ Linux Äں˵Ŀª·¢ÈËÔ±£¬Äú»á·¢ÏÖ×Ô¼º¾­³£Òª¶ÔÓëÌåϵ½á¹¹¸ß¶ÈÏà¹ØµÄ¹¦ÄܽøÐбàÂë»òÓÅ»¯´úÂë·¾¶¡£ÄúºÜ¿ÉÄÜÊÇͨ¹ý½«»ã±àÓïÑÔÖ¸Áî²åÈëµ½ C Óï¾äµÄÖм䣨ÓÖ³ÆΪÄÚÁª»ã±àµÄÒ»ÖÖ·½·¨£©À´Ö´ÐÐÕâЩÈÎÎñµÄ¡£ÈÃÎÒÃÇ¿´Ò»Ï Linux ÖÐÄÚÁª»ã±àµÄÌض¨Ó÷¨¡££¨ÎÒÃǽ«ÌÖÂÛÏÞÖÆÔÚ IA32 »ã±à¡££©
GNU »ã±à³ÌÐò¼òÊö
ÈÃÎÒÃÇÊ×ÏÈ¿´Ò»Ï Linux ÖÐʹÓõĻù±¾»ã±à³ÌÐòÓï·¨¡£GCC£¨ÓÃÓÚ Linux µÄ GNU C ±àÒëÆ÷£©Ê¹Óà AT&T »ã±àÓï·¨¡£ÏÂÃæÁгöÁËÕâÖÖÓï·¨µÄһЩ»ù±¾¹æÔò¡££¨¸ÃÁбí¿Ï¶¨²»ÍêÕû£»Ö»°üÀ¨ÁËÓëÄÚÁª»ã±àÏà¹ØµÄÄÇЩ¹æÔò¡££©
¼Ä´æÆ÷ÃüÃû
¼Ä´æÆ÷Ãû³ÆÓÐ % ǰ׺¡£¼´£¬Èç¹û±ØÐëʹÓà eax£¬ËüÓ¦¸ÃÓÃ×÷ %eax¡£
Ô´²Ù×÷ÊýºÍÄ¿µÄ²Ù×÷ÊýµÄ˳Ðò
ÔÚËùÓÐÖ¸ÁîÖУ¬ÏÈÊÇÔ´²Ù×÷Êý£¬È»ºó²ÅÊÇÄ¿µÄ²Ù×÷Êý¡£ÕâÓ뽫Դ²Ù×÷Êý·ÅÔÚÄ¿µÄ²Ù×÷ÊýÖ®ºóµÄ Intel Óï·¨²»Í¬¡£
mov %eax, %ebx, transfers the contents of eax to ebx.
²Ù×÷Êý´óС
¸ù¾Ý²Ù×÷ÊýÊÇ×Ö½Ú (byte)¡¢×Ö (word) »¹Êdz¤ÐÍ (long)£¬Ö¸ÁîµÄºó׺¿ÉÒÔÊÇ b¡¢w »ò l¡£Õâ²¢²»ÊÇÇ¿ÖÆÐԵģ»GCC »á³¢ÊÔͨ¹ý¶ÁÈ¡²Ù×÷ÊýÀ´ÌṩÏàÓ¦µÄºó׺¡£µ«ÊÖ¹¤Ö¸¶¨ºó׺¿ÉÒÔ¸ÄÉÆ´úÂëµÄ¿É¶ÁÐÔ£¬²¢¿ÉÒÔÏû³ý±àÒëÆ÷²Â²â²»ÕýÈ·µÄ¿ÉÄÜÐÔ¡£
movb %al, %bl -- Byte move
movw %ax, %bx -- Word move
movl %eax, %ebx -- Longword move
Á¢¼´²Ù×÷Êý
ͨ¹ýʹÓà $ Ö¸¶¨Ö±½Ó²Ù×÷Êý¡£
movl $0xffff, %eax -- will move the value of 0xffff into eax register.
¼ä½ÓÄÚ´æÒýÓÃ
ÈκζÔÄÚ´æµÄ¼ä½ÓÒýÓö¼ÊÇͨ¹ýʹÓà ( ) À´Íê³ÉµÄ¡£
movb (%esi), %al -- will transfer the byte in the memory
pointed by esi into al
register
»ØÒ³Ê×
ÄÚÁª»ã±à
GCC ΪÄÚÁª»ã±àÌṩÌØÊâ½á¹¹£¬Ëü¾ßÓÐÒÔϸñʽ£º
GCG µÄ "asm" ½á¹¹
asm ( assembler template

: output operands (optional)

: input operands (optional)

: list of clobbered registers
(optional)

);
±¾ÀýÖУ¬»ã±à³ÌÐòÄ£°åÓÉ»ã±àÖ¸Áî×é³É¡£ÊäÈë²Ù


Ïà¹ØÎĵµ£º

UÅÌ°²×°Linux£¬¸æ±ð¹âÅÌÁË

1¡¢½«Grub°²×°µ½uÅÌ(ͨ³£ÐèÒªÔÚLinuxÖнøÐÐ)
ÔÚUbuntu9.10Öа²×°grub2ÈçÏ£º
sudo grub-install --root-directory=/media/sdb1 /dev/sdb
##×¢½â£ºÉÏÊöÃüÁîÖеÄ·¾¶Ãû¿ÉÄܻ᲻ͬ£¨/media/sdb1ÖÐsdb1ÊÇuÅ̹ÒÔغóµÄÎļþÃû£¬ÊÓ¸÷È˵ľßÌåÇé¿ö¶ø¶¨£©
 
2¡¢´ÓÍøÉÏÏÂÔØÁ½¸öÎļþvmlinuzºÍinitrd.gz
##Äã»á·¢ÏÖÆäʵÔÚÄãËù ......

linuxÎļþĿ¼½á¹¹£¨×ª£©


Ò»Ö±¶¼ºÜÏëÀíÇåubuntuÎļþĿ¼µÄ½á¹¹£¬½ñÌì͵¿ÕÕÒ¸öʱ¼äѧϰһÏ£¬googleÕÒµ½µÄÎÄÕ£¬·ÇÔ­´´£¬·¢ÉÏÀ´Ò»ÆðѧϰÏ£º
תÔØ£ºhttp://tech.ccidnet.com/art/305/20080118/1347213_1.html
ÒÔÏÂΪUbuntuĿ¼µÄÖ÷ҪĿ¼½á¹¹£¬ÄúÉÔ΢Á˽âËüÃǶ¼°üº¬ÁËÄÄЩÎļþ¾Í¿ÉÒÔÁË£¬²»ÐèÒª¼ÇÒä¡£
/ ¸ùĿ¼
©¦
©Àboot/ Æô¶¯Îļþ¡£ËùÓÐÓëÏµÍ ......

Ò»·Ýlinux±ÊÊÔÌâÄ¿

Ò»£®Ìî¿ÕÌâ
1. ÔÚLinuxϵͳÖУ¬ÒÔ       ·½Ê½·ÃÎÊÉ豸 ¡£
2. LinuxÄÚºËÒýµ¼Ê±£¬´ÓÎļþ       ÖжÁÈ¡Òª¼ÓÔصÄÎļþϵͳ¡£
3. LinuxÎļþϵͳÖÐÿ¸öÎļþÓà      À´±êʶ¡£
4. È«²¿´ÅÅÌ¿éÓÉËĸö²¿·Ö×é³É£¬·Ö±ðΪ   ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ