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

Ïêϸ½²½â ¹ØÓÚLinux¾²Ì¬¿âºÍ¶¯Ì¬¿âµÄ·ÖÎö


»ù±¾¸ÅÄî
 
¿âÓж¯Ì¬Ó뾲̬Á½ÖÖ£¬¶¯Ì¬Í¨³£ÓÃ.soΪºó׺£¬¾²Ì¬ÓÃ.aΪºó׺¡£
 
ÀýÈ磺libhello.so libhello.a ΪÁËÔÚͬһϵͳÖÐʹÓò»Í¬°æ±¾µÄ¿â£¬¿ÉÒÔÔÚ¿âÎļþÃûºó¼ÓÉÏ°æ±¾ºÅΪºó׺,ÀýÈ磺 libhello.so.1.0,ÓÉÓÚ³ÌÐòÁ¬½ÓĬÈÏÒÔ.soΪÎļþºó׺Ãû¡£ËùÒÔΪÁËʹÓÃÕâЩ¿â£¬Í¨³£Ê¹Óý¨Á¢·ûºÅÁ¬½ÓµÄ·½Ê½¡£
ln -s libhello.so.1.0 libhello.so.1
ln -s libhello.so.1 libhello.so
1¡¢Ê¹Óÿâ
 
µ±ÒªÊ¹Óþ²Ì¬µÄ³ÌÐò¿âʱ£¬Á¬½ÓÆ÷»áÕÒ³ö³ÌÐòËùÐèµÄº¯Êý£¬È»ºó½«ËüÃÇ¿½±´µ½Ö´ÐÐÎļþ£¬ÓÉÓÚÕâÖÖ¿½±´ÊÇÍêÕûµÄ£¬ËùÒÔÒ»µ©Á¬½Ó³É¹¦£¬¾²Ì¬³ÌÐò¿âÒ²¾Í²»ÔÙÐèÒªÁË¡£È» ¶ø£¬¶Ô¶¯Ì¬¿â¶øÑÔ£¬¾Í²»ÊÇÕâÑù¡£¶¯Ì¬¿â»áÔÚÖ´ÐгÌÐòÄÚÁôÏÂÒ»¸ö±ê¼ÇÖ¸Ã÷µ±³ÌÐòÖ´ÐÐʱ£¬Ê×ÏȱØÐëÔØÈëÕâ¸ö¿â¡£ÓÉÓÚ¶¯Ì¬¿â½ÚÊ¡¿Õ¼ä£¬linuxϽøÐÐÁ¬½ÓµÄȱʡ²Ù×÷ÊÇÊ×ÏÈÁ¬½Ó¶¯Ì¬¿â£¬Ò²¾ÍÊÇ˵£¬Èç¹ûͬʱ´æÔÚ¾²Ì¬ºÍ¶¯Ì¬¿â£¬²»ÌرðÖ¸¶¨µÄ»°£¬½«Ó붯̬¿âÏàÁ¬½Ó¡£ ÏÖÔÚ¼ÙÉèÓÐÒ»¸ö½ÐhelloµÄ³ÌÐò¿ª·¢°ü£¬ËüÌṩһ¸ö¾²Ì¬¿âlibhello.a Ò»¸ö¶¯Ì¬¿âlibhello.so,Ò»¸öÍ·Îļþhello.h,Í·ÎļþÖÐÌṩsayhello()Õâ¸öº¯Êý /* hello.h */ void sayhello(); ÁíÍ⻹ÓÐһЩ˵Ã÷Îĵµ¡£
 
ÕâÒ»¸öµäÐ͵ijÌÐò¿ª·¢°ü½á¹¹ Ó붯̬¿âÁ¬½Ó linuxĬÈϵľÍÊÇÓ붯̬¿âÁ¬½Ó£¬ÏÂÃæÕâ¶Î³ÌÐòtestlib.cʹÓÃhello¿âÖеÄsayhello()º¯Êý
 
/*testlib.c*/
 
#include <>
 
#include <>
 
int main()
{
   sayhello();
   return 0;
}
 
ʹÓÃÈçÏÂÃüÁî½øÐбàÒë $gcc -c testlib.c -o testlib.o
 
ÓÃÈçÏÂÃüÁîÁ¬½Ó£º $gcc testlib.o -lhello -o testlib
 
Á¬½ÓʱҪעÒ⣬¼ÙÉèlibhello.o ºÍlibhello.a¶¼ÔÚȱʡµÄ¿âËÑË÷·¾¶ÏÂ/usr/libÏ£¬Èç¹ûÔÚÆäËüλÖÃÒª¼ÓÉÏ-L²ÎÊý ÓëÓ뾲̬¿âÁ¬½ÓÂ鷳һЩ£¬Ö÷ÒªÊDzÎÊýÎÊÌâ¡£»¹ÊÇÉÏÃæµÄÀý×Ó£º
$gcc testlib.o -o testlib -WI,-Bstatic -lhello
×¢£ºÕâ¸öÌرðµÄ"-WI£¬-Bstatic"²ÎÊý£¬Êµ¼ÊÉÏÊÇ´«¸øÁËÁ¬½ÓÆ÷ld¡£Ö¸Ê¾ËüÓ뾲̬¿âÁ¬½Ó£¬Èç¹ûϵͳÖÐÖ»Óо²Ì¬¿âµ±È»¾Í²»ÐèÒªÕâ¸ö²ÎÊýÁË¡£ Èç¹ûÒªºÍ¶à¸ö¿âÏàÁ¬½Ó£¬¶øÿ¸ö¿âµÄÁ¬½Ó·½Ê½²»Ò»Ñù£¬±ÈÈçÉÏÃæµÄ³ÌÐò¼ÈÒªºÍlibhello½øÐо²Ì¬Á¬½Ó£¬ÓÖÒªºÍlibbye½øÐж¯Ì¬Á¬½Ó£¬ÆäÃüÁîӦΪ£º
$gcc testlib.o -o testlib -WI,-Bstatic -lhello -WI,-Bdynamic -lbye
 
 
2¡¢¶¯Ì¬¿âµÄ·¾¶ÎÊÌâ ΪÁËÈÃÖ´ÐгÌÐò˳ÀûÕÒµ½¶¯Ì¬¿â£¬ÓÐÈýÖÖ·½·¨£º
&nb


Ïà¹ØÎĵµ£º

linux ¹ÜµÀѧϰ

¹ÜµÀÊÇLinuxÖкÜÖØÒªµÄÒ»ÖÖͨÐÅ·½Ê½,ÊÇ°ÑÒ»¸ö³ÌÐòµÄÊä³öÖ±½ÓÁ¬½Óµ½ÁíÒ»¸ö³ÌÐòµÄÊäÈë,³£ËµµÄ¹ÜµÀ¶àÊÇÖ¸ÎÞÃû¹ÜµÀ,ÎÞÃû¹ÜµÀÖ»ÄÜÓÃÓÚ¾ßÓÐÇ×Ôµ¹ØϵµÄ½ø³ÌÖ®¼ä£¬ÕâÊÇËüÓëÓÐÃû¹ÜµÀµÄ×î´óÇø±ð¡£ 
ÓÐÃû¹ÜµÀ½Ðnamed pipe»òÕßFIFO(ÏȽøÏȳö)£¬¿ÉÒÔÓú¯Êýmkfifo()´´½¨¡£ 
Linux¹ÜµÀµÄʵÏÖ»úÖÆ 
ÔÚLinuxÖУ¬¹ÜµÀÊÇÒ»ÖÖ ......

ѧϰLinuxÄں˵ķ½·¨Ð¡½ázz

¼Ù¶¨Äã»áCÓïÑÔ£¬¶øÇÒÃ÷°×CÓïÑÔÃæÏò¶ÔÏó±à³ÌµÄschme£¬¶Ô²Ù×÷ϵͳ£¨°üÀ¨µ÷¶È£¬ÄÚ´æ·ÖÅ䣬·ÖÒ³£¬Í¬²½£¬etc£©±È½ÏÁ˽⡣ÄÇôÄã¿ÉÒÔ°´ÕÕÈçÏÂ˳ÐòѧϰLinux Äںˡ£
    1.¿´Linux Device DriverÕâ±¾Êé¡£ÕâÊÇΪÁËÈÃÄ㶮µÃ±àÒëÄÚºËÄ£¿éµÄ·½·¨¡£»¹ÓÐΪLinux¸÷ÖÖÉ豸ÁôÏÂһЩӡÏó¡£Í¬Ê±Ò»±é¿´ÊéÒ»±ß¿´Ä³Ð©É豸µÄÔ´´ú ......

Linux·¢Ëͺ¯Êýdev_queue_xmit·ÖÎö

µ±Éϲã×¼±¸ºÃÒ»¸ö°üÖ®ºó£¬½»¸øÏÂÃæÕâ¸öº¯Êý´¦Àí
int dev_queue_xmit(struct sk_buff *skb)
{
struct net_device *dev = skb->dev;
struct netdev_queue *txq;
struct Qdisc *q;
int rc = -ENOMEM;
/* GSO will handle the following emulations directly. */
if (netif_needs_gso(dev, skb))
goto gso; ......

Linux ÄÚºËÓжàÉÙ´úÂëÊÇÀ´×Ô»ªÈ˵űÏ×£¿

ÀïÓÐÒ»¸öͳ¼Æ http://www.remword.com/kps_result/china.php
µã»÷Á¬½Ó½øÈ¥£¬¿ÉÒÔ¿´Äܵ½£º
Total patch sets of this kernel release: 157236
5337 person contribute their works to this kernel release.
Averagely, every person committed 29 patch sets.
299(5.60%) Chinese people contribute 6185(3.93%) patch ......

LinuxÐźÅ

from: http://cc.byexamples.com/20070520/tap-the-interrupt-signal/
When you hit control+c, you are actually send a SIGINT ( Interrupt signal ) to your program. By default, your program will be terminated after receiving SIGINT. But you can change the way of handling Interrupt signal.
Some of the a ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ