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

Linux Kernel Linked List Explained

²Î¼û£ºhttp://isis.poly.edu/kulesh/stuff/src/klist/
Introduction:
Linux kernel is mostly written in the C language. Unlike many other languages C does not have
a good collection of data structures built into it or supported by a collection of standard libraries.
Therefore, you're probably excited to hear that you can borrow a good implementation of a
circularly-linked list in C from the Linux kernel source tree.
The file include/linux/list.h
in the source tree implements a type oblivious, easy-to-use, circularly-linked list in the C
language. The implementation is efficient and portable-- otherwise it would not have made it
into the kernel. Whenever someone needs a list in the Linux kernel they rely on this
implementation to strung up any data structure they have. With very little modifications
(removing hardware prefetching of list items) we can also use this list in our applications.
A usable version of this file is available
here for download
.
Some of the advantages of using this list are:
Type Oblivious:
This list can be used to strung up any data structure you have in mind.
Portable:
Though I haven't tried in every platform it is safe to assume the list implementation
is very portable. Otherwise it would not have made it into the kernel source tree.
Easy to Use:
Since the list is type oblivious same functions are used to initialize, access,
and traverse any list of items strung together using this list implementation.
Readable:
The macros and inlined functions of the list implementation makes the resulting
code very elegant and readable.
Saves Time:
Stops you from reinventing the wheel. Using the list really saves a lot of
debugging time and repetitively creating lists for every data structure
you need to link.
Linux implementation of the linked list is different from the many
linked list

implementations you might have seen. Usually a linked list contains
the items that are to be linked. For example:
struct my_li


Ïà¹ØÎĵµ£º

linux route ²Ù×÷ÃüÁî

¼ÙÈçÓÐÒÔϵķÓÉ±í£º
10.101.184.32   *               255.255.255.224 U     0      0        0 eth0
10.101.186.0&nb ......

linux grepÃüÁǿ´óµÄÎı¾ËÑË÷

linux grepÃüÁǿ´óµÄÎı¾ËÑË÷
1.×÷ÓÃ
linuxϵͳÖÐgrepÃüÁîÊÇÒ»ÖÖÇ¿´óµÄÎı¾ËÑË÷¹¤¾ß£¬ËüÄÜʹÓÃÕýÔò±í´ïʽËÑË÷Îı¾£¬²¢°ÑÆ¥ÅäµÄÐдòÓ¡³öÀ´¡£grepÈ«³ÆÊÇGlobal Regular Expression Print£¬±íʾȫ¾ÖÕýÔò±í´ïʽ°æ±¾£¬ËüµÄʹÓÃȨÏÞÊÇËùÓÐÓû§¡£
2.¸ñʽ
grep [options]
3.Ö÷Òª²ÎÊý
[options]Ö÷Òª²ÎÊý£º
£­c£ºÖ»Êä³öÆ¥Åä ......

linux send recvº¯ÊýÏê½â


i
nt send( SOCKET s, const char FAR *buf, int len, int flags );

    ²»ÂÛÊǿͻ§»¹ÊÇ·þÎñÆ÷Ó¦ÓóÌÐò¶¼ÓÃsendº¯ÊýÀ´ÏòTCPÁ¬½ÓµÄÁíÒ»¶Ë·¢ËÍÊý¾Ý¡£
¿Í»§³ÌÐòÒ»°ãÓÃsendº¯ÊýÏò·þÎñÆ÷·¢ËÍÇëÇ󣬶ø·þÎñÆ÷Ôòͨ³£ÓÃsendº¯ÊýÀ´Ïò¿Í»§³ÌÐò·¢ËÍÓ¦´ð¡£
    ¸Ãº¯ÊýµÄµÚÒ»¸ö²ÎÊýÖ¸¶¨·¢ËͶËÌ ......

¹ØÓÚlinux»·¾³±äÁ¿Îļþ

/etc/profile:´ËÎļþΪϵͳµÄÿ¸öÓû§ÉèÖû·¾³ÐÅÏ¢,µ±Óû§µÚÒ»´ÎµÇ¼ʱ,¸ÃÎļþ±»Ö´ÐÐ.²¢´Ó/etc/profile.dĿ¼µÄÅäÖÃÎļþÖÐËѼ¯shellµÄÉèÖÃ.
/etc/bashrc:Ϊÿһ¸öÔËÐÐbash shellµÄÓû§Ö´ÐдËÎļþ.µ±bash shell±»´ò¿ªÊ±,¸ÃÎļþ±»¶ÁÈ¡.
~/.bash_profile:ÿ¸öÓû§¶¼¿ÉʹÓøÃÎļþÊäÈëרÓÃÓÚ×Ô¼ºÊ¹ÓõÄshellÐÅÏ¢,µ±Óû§µÇ¼ʱ, ......

linuxϵÄvivi¡¢Äںˡ¢rootµÄ°²×°²½ÖèÓë²âÊÔ

ÉÕд2410£­S linux ²Ù×÷ϵͳ£º
ÔÚwindows xpϽøÐУ¬ÐèÒªµÄÎļþÔÚ¹âÅÌÖеÄimgĿ¼ºÍflashviviĿ¼ÏÂÌṩ¡£
ÉÕд2410£­S linux ²Ù×÷ϵͳ°üÀ¨ÉÕдvivi,kernel,rootÈý¸ö²½Ö裬³ý´ËÎÒÃÇ»¹ÒªÉÕдyaffs.tar£¬ÕâËĸöÎļþÔÚimgĿ¼ÖС£
vivi ----linux²Ù×÷ϵͳÆô¶¯µÄbootloader;     
zImage----linu ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ