linuxÆô¶¯Ê±¹ÒÔØrootfsµÄ¼¸ÖÖ·½Ê½
[ת]linuxÆô¶¯Ê±¹ÒÔØrootfsµÄ¼¸ÖÖ·½Ê½
Ò»Ö±¶ÔlinuxÆô¶¯Ê±¹ÒÔظùÎļþϵͳµÄ¹ý³Ì´æÔÚןܶàÒÉÎÊ£¬½ñÌìÔÚˮľ¾«»ªÇøÕÒµ½ÁËÓÐÓõÄ×ÊÁÏ£¬ÕªÂ¼ÈçÏ£º
1¡£linuxÆô¶¯Ê±£¬¾¹ýһϵÁгõʼ»¯Ö®ºó£¬ÐèÒªmount ¸ùÎļþϵͳ£¬Îª×îºóÔËÐÐinit½ø³ÌµÈ×ö×¼±¸£¬mount
¸ùÎļþϵͳÓÐÕâô¼¸ÖÖ·½Ê½£º
1£©ÎļþϵͳÒѾ´æÔÚÓÚÓ²ÅÌ£¨»òÕßÀàËƵÄÉ豸£©µÄij¸ö·ÖÇøÉÏÁË£¬kernel¸ù¾ÝÆô¶¯µÄÃüÁîÐвÎÊý£¨root£½/dev/xxx),Ö±½Ó½øÐÐmount¡£
ÕâÀïÓÐÒ»¸öÎÊÌ⣬ÔÚrootÎļþϵͳ±¾Éí»¹²»´æÔÚµÄÇé¿öÏ£¬kernelÈç
ºÎ¸ù¾Ý/dev/xxxÀ´ÕÒµ½¶ÔÓ¦µÄÉ豸ÄØ£¿×¢Ò⣺¸ùÎļþϵͳºÍÆäËûÎļþϵͳµÄmount·½Ê½ÊDz»Ò»ÑùµÄ£¬kernelͨ¹ýÖ±½Ó½âÎöÉ豸µÄÃû³ÆÀ´»ñµÃÉ豸
µÄÖ÷¡¢´ÓÉ豸ºÅ£¬È»ºó¾Í¿ÉÒÔ·ÃÎʶÔÓ¦µÄÉ豸Çý¶¯
ÁË¡£ËùÒÔÔÚinit/main.cÖÐÓкܳ¤Ò»´®µÄroot_dev_names£¨Èç
hda,hdab,sda,sdb,nfs,ram,mtdblock……£©£¬Í¨¹ýÕâ¸ö±í¾Í¿ÉÒÔ¸ù¾ÝÉ豸Ãû³ÆµÃµ½É豸ºÅ¡£×¢Ò⣬bootloader»òÄÚ
ºËÖÐÉ趨µÄÆô¶¯²ÎÊý£¨root£½/dev/xxx)Ö»ÊÇÒ»¸ö´úºÅ£¬Êµ¼ÊµÄ¸ùÎļþϵͳÖв»Ò»¶¨´æÔÚÕâ¸öÉ豸Îļþ£¡
2£©´ÓÈíÇýµÈ±È½ÏÂýµÄÉ豸ÉÏ×°ÔظùÎļþϵͳ£¬Èç¹ûkernelÖ§³Öramdisk£¬ÔÚ×°ÔØrootÎļþϵͳʱ£¬ÄÚºËÅжϵ½ÐèÒª´ÓÈíÅÌ
£¨fdx£©mount(root=/dev/fd0)£¬¾Í»á×Ô¶¯°ÑÎļþϵͳӳÏó¸´ÖƵ½ramdisk£¬Ò»°ã¶ÔÓ¦É豸ram0£¬È»ºóÔÚram0ÉÏmount
¸ùÎļþϵͳ¡£ ´ÓÔ´Âë¿´£¬Èç¹ûkernel±àÒëʱûÓÐÖ§³Öramdisk£¬¶øÆô¶¯²ÎÊýÓÖÊÇroot=/dev/fd0,
ϵͳ½«Ö±½ÓÔÚÈíÅÌÉÏmount£¬³ýÁËËٶȱȽÏÂý£¬ÀíÂÛÉÏÊÇ¿ÉÐеģ¨Ã»ÊÔ¹ý£¬²»ÖªµÀÊDz»ÊÇÕâÑù£¿£©
3£©Æô¶¯Ê±Óõ½initrdÀ´mount¸ùÎļþϵͳ¡£×¢ÒâÀí½âramdiskºÍinitrdÕâÁ½¸ö¸ÅÄÆäʵramdiskÖ»ÊÇÔÚramÉÏʵÏֵĿéÉ豸£¬
ÀàËÆÓëÓ²Å̲Ù×÷£¬µ«Óиü¿ìµÄ¶ÁдËٶȣ¬Ëü¿ÉÒÔÔÚϵͳÔËÐеÄÈκÎʱºòʹÓ㬶ø²»½ö½öÊÇÓÃÓÚÆô¶¯£»initrd£¨boot
loader initialized RAM
disk£©¿ÉÒÔ˵ÊÇÆô¶¯¹ý³ÌÖÐÓõ½µÄÒ»ÖÖ»úÖÆ£¬¾ßÌåµÄʵÏÖ¹ý³ÌҲʹÓÃramdisk¼¼Êõ¡£¾ÍÊÇÔÚ×°ÔØlinux֮ǰ£¬bootloader¿ÉÒÔ°ÑÒ»¸ö±È½Ï
СµÄ¸ùÎļþϵͳµÄÓ³Ïó×°ÔØÔÚÄÚ´æµÄij¸öÖ¸¶¨Î»Ö㬹ÃÇÒ°ÑÕâ¶ÎÄÚ´æ³ÆΪinitrd£¨ÕâÀïÊÇinitrdËùÕ¼µÄÄڴ棬²»ÊÇramdisk£¬×¢ÒâÇø±ð£©£¬È»ºó
bootloaderͨ¹ý´«µÝ²ÎÊýµÄ·½Ê½¸æËßÄÚºËinitrdµÄÆðʼµØÖ·ºÍ´óС£¨Ò²¿ÉÒÔ°ÑÕâЩ²ÎÊý±àÒëÔÚÄÚºËÖУ©£¬ÔÚÆô¶¯½×¶Î¾Í¿ÉÒÔÔÝʱµÄÓÃinitrd
À´mount¸ùÎļþϵͳ¡£initrdµÄ×î³õµÄÄ¿µÄÊÇΪÁË°ÑkernelµÄÆô¶¯·Ö³ÉÁ½¸ö½×¶Î£ºÔÚkernelÖб£Áô×îÉÙ×î»ù±¾µÄÆô¶¯´úÂ룬Ȼºó°Ñ¶Ô¸÷ÖÖ¸÷
ÑùÓ²¼þÉè
Ïà¹ØÎĵµ£º
Ò»£ºÇ°ÑÔ
×î½üÔÚÑо¿androidµÄsensor driver£¬Ö÷ÒªÊÇE-compass£¬ÆäÖÐÓõ½ÁËLinux input×Óϵͳ.ÔÚÍøÉÏÒ²¿´Á˺ܶàÕâ·½ÃæµÄ×ÊÁÏ£¬¸Ð¾õ»¹ÊÇÕâƪ·ÖÎöµÄ±È½ÏϸÖÂ͸³¹£¬Òò´ËתÔØÒ»ÏÂÒÔ±ã×Ô¼ºÑ§Ï°£¬Í¬Ê±ºÍ´ó¼Ò·ÖÏí£¡
£¨Õâƪ²©¿ÍÖ÷ÒªÊÇÒÔ¼üÅÌÇý¶¯ÎªÀýµÄ£¬²»¹ý½²½âµÄÊÇLinux Input Subsystem£¬¿ÉÒÔ×ÐϸµÄÑо¿Ò»Ï£¡£©
¼üÅÌÇý¶¯½«¼ì ......
linuxÐźŻúÖÆ
ÐźÅÌṩÁËÒ»ÖÖ֪ͨ½ø³Ìϵͳʼþ·¢ÉúµÄ»úÖÆ£¬ËüÒ²ÊÇ×÷ΪÓû§½ø³ÌÖ®¼äͨÐźÍͬ²½µÄ
Ò»ÖÖÔʼ»úÖÆ¡£ÔÚ½ø³ÌǨÒƵÄÇé¿öÏ£¬ÈçºÎ´¦ÀíÐźÅÄØ£¿Õⲿ·Ö½éÉÜÁËMOSIXϵͳ¶ÔÐźÅ
»úÖƵĴ¦Àí¡£
LINUXÐźŻúÖÆ
ÐźÅÊÇÒì²½µÄ½ø³Ì¼äͨѶ»úÖÆ,ÊÇÔÚÈí¼þ²ã´ÎÉ϶ÔÖжϻúÖƵÄÒ»ÖÖÄ£Äâ¡£LINUXÄں˵ÄÐÅ
ºÅ» ......
´ÓÓû§µÄ½Ç¶È¿´£¬MySQL±»SunÊÕ¹º£¬ÓÖ±»OracleÊÕ¹º¿ÉÄÜÕæ²»ÊÇʲôºÃÊ¡£MySQL±¾À´¾Í±»Oracleͨ¹ý²¢¹ºÆäÒÀÀµµÄ´æ´¢ÒýÇæInnobase¡¢BerkeleyDBÕÛÌڵIJ»ÐУ¬ÓÖÔÚ±»SunÊÕ¹ººó·¢ÉúÁËMonty´´½¨Ð·ÖÖ§MariaDBÕâÑùµÄÊÂÇ飬×îÖÕ»¹ÊÇËæ×ÅSunÒ»Æð±»Oracle²¢¹º£¬Ã»ÓÐÌÓÍÑLarry ElisonµÄħצ¡£Ò²Ðí£¬¿ªÔ´Èí¼þµÄºÃ´¦¾ÍÔÚ ......
linux—selectÏê½â
selectϵͳµ÷ÓÃʱÓÃÀ´ÈÃÎÒÃǵijÌÐò¼àÊÓ¶à¸öÎļþ¾ä±úµÄ״̬±ä»¯µÄ¡£³ÌÐò»áÍ£ÔÚselectÕâÀïµÈ´ý£¬Ö±µ½±»¼àÊÓµÄÎļþ¾ä±úÓÐÒ»¸ö»ò¶à¸ö·¢ÉúÁË״̬¸Ä±ä¡£
¹ØÓÚÎļþ¾ä±ú£¬Æäʵ¾ÍÊÇÒ»¸öÕûÊý£¬Í¨¹ýsocketº¯ÊýµÄÉùÃ÷¾ÍÃ÷°×ÁË£º
int socket(int domain, int type, int protocol);
ÎÒÃÇ×îÊìϤµÄ¾ä±úÊÇ0¡¢1¡¢2 ......
linux—selectÏê½â
selectϵͳµ÷ÓÃʱÓÃÀ´ÈÃÎÒÃǵijÌÐò¼àÊÓ¶à¸öÎļþ¾ä±úµÄ״̬±ä»¯µÄ¡£³ÌÐò»áÍ£ÔÚselectÕâÀïµÈ´ý£¬Ö±µ½±»¼àÊÓµÄÎļþ¾ä±úÓÐÒ»¸ö»ò¶à¸ö·¢ÉúÁË״̬¸Ä±ä¡£
¹ØÓÚÎļþ¾ä±ú£¬Æäʵ¾ÍÊÇÒ»¸öÕûÊý£¬Í¨¹ýsocketº¯ÊýµÄÉùÃ÷¾ÍÃ÷°×ÁË£º
int socket(int domain, int type, int protocol);
ÎÒÃÇ×îÊìϤµÄ¾ä±úÊÇ0¡¢1¡¢2 ......