linux 0.11 Îļþϵͳ£¨Èý£©
Ŀ¼ÏîºÍ³¬¼¶¿é£¬½ÚµãµÄ¸ÅÄͬ£¬ËüÔÚÉ豸ÉÏûÓжÔÓ¦µÄ´ÅÅÌÊý¾Ý½á¹¹¡£Ïà·´£¬ËüÊÇĿ¼ÎÄ ¼þµÄÒ»²¿·Ö¡£linuxÖÐĿ¼ҲÊÇÒ»ÖÖÎļþ£¬ÀàÐÍÊÇ'd'¡£µ«ÊÇĿ¼ÖеÄÄÚÈݺÍÆÕͨÎļþ²»Í¬£¬ËüÊÇÓÉĿ¼Ïî×é³ÉµÄ¡£×¢ÒâĿ¼Ïî²»ÊÇĿ¼¡£ÎÒÃǾ³£Ó÷¾¶Ãû Ö´ÐÐÏà¹Ø²Ù×÷£¬Ä¿Â¼Ïî¾ÍÊÇΪÁ˲éÕÒ·½±ãµÄ¡£
struct dirt_entry{
unsigned short inode;
char name[NAME_LEN];
}£»
¿É ÒÔ¿´µ½Ò»¸öĿ¼ÏîÖаüº¬ÁËÎļþµÄi½ÚµãºÅºÍÎļþµÄÃû³Æ¡£Â·¾¶ÓÐÁ½ÖÖ£¬Ò»ÖÖÊǾø¶Ô·¾¶£¬Ò»ÖÖÊÇÏà¶Ô·¾¶¡£±ÈÈç/home/fish¾ÍÊǾø¶Ô·¾¶£¬ËüÒÔ¸ùĿ¼ /Ϊ¿ªÍ·£¬¶ø X11/xorg.conf¾ÍÊÇÏà¶Ô·¾¶£¬ËüÏà¶ÔÓÚĿ¼/etc,Ò²¾ÍÊÇ˵ºóÕߵľø¶Ô·¾¶ÊÇ/etc/X11/xorg.conf¡£Â·¾¶ÊÇÓÉĿ¼Ïî×é³É µÄ¡£Äà /home/fish/fish.cÀ´Ëµ£¬µÚÒ»¸öĿ¼ÊÇ/£¬¼´¸ùĿ¼¡£ÔÚ¸ùĿ¼ÎļþÖÐÓÐÃû×ÖΪhomeµÄĿ¼ÏȻºóͨ¹ýhomeĿ¼ÏîÖеÄi½Úµã¾Í¿ÉÒÔ ÕÒµ½homeÎļþ£¬Í¨¹ýi½ÚµãÖеÄi_mode×ֶοÉÖªËüÊÇÒ»¸öĿ¼£¬ÔÚÕâ¸öÎļþÖÐÓÐÃûΪfishµÄĿ¼ÏȻºó¸ù¾ÝÕâ¸öĿ¼ÏîÖеÄi½ÚµãºÅÕÒµ½fish Îļþ¡£Í¬ÑùÓÉfishµÄinode->i_modeÖªÕâÒ²ÊǸöĿ¼¡£Í¬ÑùÔÚfishÎļþÖÐÕÒµ½ÃûΪfish.cµÄĿ¼Ï¾Í¿ÉÒÔÕÒ³öfish.cµÄ i½Úµã£¬ËÑË÷Íê³É¡£
namei.c ÊÇÄÚºËÖÐ×µÄÒ»¸öÎļþ£¬Ëü°üº¬ÁËÐí¶à¹ØÓÚĿ¼µÄ²Ù×÷£¬Èçfind_entry(´ÓÒ»¸öĿ¼ÖÐËÑË÷Öƶ¨µÄĿ¼Ïî),add_entry(ÍùÖ¸¶¨µÄĿ¼ÖÐÌí ¼ÓÒ»¸öÎļþĿ¼Ïî),get_dir(¸ù¾Ý·¾¶ÃûÕÒµ½Ö¸¶¨µÄĿ¼),dir_namei(·µ»ØÖ¸¶¨Ä¿Â¼µÄi½ÚµãÖ¸Õë),»¹ÓÐnamei(¸ù¾Ý·¾¶ÃûÕÒµ½Ö¸ ¶¨Â·¾¶µÄi½Úµã)µÈµÈ¡£ÎÒÃǾÍÏÈÄÃfind_entryÀ´¿´Ò»Ï¡£
//dir:Ö¸¶¨Ä¿Â¼µÄi½ÚµãÖ¸Õë¡£name:ÎļþÃû,namelen£ºÎļþÃû³¤¶È¡£
//·µ»Ø£º¸ßËÙ»º³åÇøÖ¸ÕëºÍÏàÓ¦µÄĿ¼ÏîÖ¸Õë¡£
static struct buffer_head* find_entry(struct m_inode **dir,const char*name,int namelen,struct dir_entry **res_dir)
{
int entries;
int block ,i;
struct buffer_head *bh;
struct dir_entry *de;
struct super_blocl *sb;
//Èç¹û¶¨ÒåÁËNO_TRUNCATE,ÔòÈç¹ûÎļþÃû´óÓÚ×î´ó³¤¶ÈNAME_LEN,·µ»Ø¡£
Ïà¹ØÎĵµ£º
ÓÉÓÚҪʹÓõ½log4cppµÄ¿â£¬¶ølog4cµÄ×ÊÁÏÊǷdz£µÄÉÙ£¬Ò²ÀÁµÃÈ¥Ñо¿ËüµÄÓ÷¨£¬ÓÚÊǾ;ö¶¨ÊÔÊÔ»ìºÏ±à³ÌÕßÍæÒâ¡£
Ê×ÏÈÏÈÒýÓÃÏÂC++ËüµÄfather: StroustrupµÄһƪÎÄÕ¡¶C++ Style and Technique FAQ¡·£¨http://www2.research.att.com/~bs/bs_faq2.html£©ÀïµÄһС¸öÆ ......
±¾ÎÄÁгöÁ˴󲿷ֳ£¼ûµÄLinuxϵͳµ÷Ó㬲¢¸½ÓмòÒªÖÐÎÄ˵Ã÷¡£
ÒÔÏÂÊÇLinuxϵͳµ÷ÓõÄÒ»¸öÁÐ±í£¬°üº¬Á˴󲿷ֳ£ÓÃϵͳµ÷ÓúÍÓÉϵͳµ÷ÓÃÅÉÉú³öµÄµÄº¯Êý¡£Õâ¿ÉÄÜÊÇÄãÔÚ»¥ÁªÍøÉÏËùÄÜ¿´µ½µÄΨһһƪÖÐÎÄ×¢Ê͵ÄLinuxϵͳµ÷ÓÃÁÐ±í£¬¼´Ê¹ÊǼòµ¥µÄ×ÖĸÐòÓ¢ÎÄÁÐ±í£¬ÄÜ×öµ½ÕâôÍêÈ«Ò²ÊǺܺ±¼ûµÄ¡£
°´ÕÕ¹ßÀý£¬Õâ¸öÁбíÒÔman
pagesµÚ2 ......
sourceÃüÁ
sourceÃüÁîÒ²³ÆΪ“µãÃüÁ¬Ò²¾ÍÊÇÒ»¸öµã·ûºÅ£¨.£©¡£sourceÃüÁîͨ³£ÓÃÓÚÖØÐÂÖ´ÐиÕÐ޸ĵijõʼ»¯Îļþ£¬Ê¹Ö®Á¢¼´ÉúЧ£¬¶ø²»±Ø×¢Ïú²¢ÖØеǼ¡£
Ó÷¨£º
#vim ~/.bashrc
#source ~/.bashrc
......
fg¡¢bg¡¢jobs¡¢&¡¢ctrl + z¶¼ÊǸúϵͳÈÎÎñÓйصģ¬ËäÈ»ÏÖÔÚ»ù±¾Éϲ»ÔõôÐèÒªÓõ½ÕâЩÃüÁµ«Ñ§»áÁËÒ²ÊǺÜʵÓõÄ
Ò»¡£& ×î¾³£±»Óõ½
Õâ¸öÓÃÔÚÒ»¸öÃüÁîµÄ×îºó£¬¿ÉÒÔ°ÑÕâ¸öÃüÁî·Åµ½ºǫִ́ÐÐ
¶þ¡£ctrl + z
¿ÉÒÔ½«Ò»¸öÕýÔÚǰִ̨ÐеÄÃüÁî·Åµ½ºǫ́£¬²¢ÇÒÔÝÍ£
Èý¡£jobs
²é¿´µ±Ç°ÓжàÉÙÔÚºǫ́ÔËÐеÄÃüÁî
ËÄ¡£fg
......
2.1 LinuxÄÚºËģʽ
µ¥ÄÚºËģʽµÄÄں˿ÉÒÔ´ÖÂԵķÖΪÈý¸ö²ã´Î£ºµ÷Ó÷þÎñµÄÖ÷³ÌÐò²ã¡¢Ö´ÐÐϵͳµ÷ÓõķþÎñ²ãºÍÖ§³Öϵͳµ÷Óõĵײ㺯Êý¡£
2.2 LinuxÄÚºËÌåϵ½á¹¹
LinuxÄÚºËÓÉÎå¸öÄ£¿é×é³É£º½ø³Ìµ÷¶ÈÄ£¿é¡¢ÄÚ´æ¹ÜÀíÄ£¿é¡¢Îļþϵͳģ¿é¡¢½ø³Ì¼äͨР......