LinuxÄÚºËVmallocÇøÓò´óСµÄ¼ÆËã
ÒÔÇ°×Ô¼º¸ú×ÅÄÚºËÄÚ´æ¹ÜÀíµÄһЩºê¶¨Ò廹ýÄÚ´æ·Ö²¼Í¼
±ÈÈçVMALLOC_START, VMALLOC_END, FIXADDR_STARTµÈµÈ
Ò»Ö±ÒÔΪÕâЩֵÔÚʵ¼ÊÄÚºËÖжà¶àÉÙÉÙ»áÓÐÎó²î£¬Ã»Ï뵽ǰ¼¸Ìì¿´ÁËÒ»ÏÂ
¾ÓÈ»ÍêÈ«ÎǺϡ£
À´ÊÔ׿ÆËãÒ»ÏÂVmallocµÄ×Ü´óС£¬ÎªÁ˱ãÓÚ¼ÆËãÎÒÃÇÈÏΪ1GµÄÄں˿ռä´Ó0µØÖ·¿ªÊ¼¡£
Ê×ÏÈÎÒµÄÎïÀíÄڴ泬¹ýÁË896M£¬Òò´Ëhigh_memory¾ÍÊÇ896M
ÆäÉÏÊÇ8MµÄ¿Õ¶´ÓÃÓÚ²¶×½Ô½½çµÄÄÚ´æ·ÃÎÊ£¬ÓÚÊÇVMALLOC_STARTÔÚ896M+8M = 904M
ÏÂÃæÔÙÀ´¼ÆËãVMALLOC_END¡£
×ÉÏÊÇÒ»¸öÄÚ´æ¿Õ¶´£¬È»ºóÊǹ̶¨Ó³ÉäµÄÇøÓò£¬Õâ¸öÇøÓòµÄ·Ö²¼¿ÉÒԲο¼ÏÂÃæÕâ¸öö¾Ù
enum fixed_addresses {
FIX_HOLE,
FIX_VDSO,
FIX_DBGP_BASE,
FIX_EARLYCON_MEM_BASE,
#ifdef CONFIG_X86_LOCAL_APIC
FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */
#endif
#ifdef CONFIG_X86_IO_APIC
FIX_IO_APIC_BASE_0,
FIX_IO_APIC_BASE_END = FIX_IO_APIC_BASE_0 + MAX_IO_APICS-1,
#endif
#ifdef CONFIG_X86_VISWS_APIC
FIX_CO_CPU, /* Cobalt timer */
FIX_CO_APIC, /* Cobalt APIC Redirection Table */
FIX_LI_PCIA, /* Lithium PCI Bridge A */
FIX_LI_PCIB, /* Lithium PCI Bridge B */
#endif
#ifdef CONFIG_X86_F00F_BUG
FIX_F00F_IDT, /* Virtual mapping for IDT */
#endif
#ifdef CONFIG_X86_CYCLONE_TIMER
FIX_CYCLONE_TIMER, /*cyclone timer register*/
#endif
FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
#ifdef CONFIG_PCI_MMCONFIG
FIX_PCIE_MCFG,
#endif
#ifdef CONFIG_PARAVIRT
FIX_PARAVIRT_BOOTMAP,
#endif
__end_of_permanent_fixed_addresses,
/*
* 256 temporary boot-time mappings, used b
Ïà¹ØÎĵµ£º
http://blog.chinaunix.net/u/25764/showart_1882931.html
Òý£º±¾À´´òË㽫Õⲿ·ÖÄÚÈݲ¢Èëµ½¡¶The Linux Kernel Module Programming Guide±Ê¼Ç¡·ÖÐÈ¥£¬µ«ÊÇÏëÏÂÄÚ´æ¿Õ¼ä¹ÜÀí·ÃÎÊÏ൱»ù´¡ÖØÒª¶øÇÒÄÚÈÝÁ¿½Ï´ó£¬ËùÒԾ͵¥¶À¼Ç¼¡£ÔÚ¹ýÈ¥Ò»ÄêÀÓÉÓڳɹ¦¿ª·¢¹ý¼¸¸öÆÄΪ¸´ÔÓµÄÉ豸Çý¶¯£¬¾Í×ÔÒÔΪÕÆÎÕÁËÇý¶¯¿ª·¢µÄ·½·¨ºÍ¼¼ÇÉ£¬ÊÂÊ ......
µ±Éϲã×¼±¸ºÃÒ»¸ö°üÖ®ºó£¬½»¸øÏÂÃæÕâ¸öº¯Êý´¦Àí
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Äں˿ª·¢¹¤³Ìʦ£¬ÊÔÊÔ¿´£¡
1)LinuxÖÐÖ÷ÒªÓÐÄļ¸ÖÖÄÚºËËø£¿
2)LinuxÖеÄÓû§Ä£Ê½ºÍÄÚºËģʽÊÇʲôº¬Ò⣿
3)ÔõÑùÉêÇë´ó¿éÄÚºËÄڴ棿
4)Óû§½ø³Ì¼äͨÐÅÖ÷ÒªÄļ¸ÖÖ·½Ê½£¿
5)ͨ¹ý»ï°éϵͳÉêÇëÄÚºËÄÚ´æµÄº¯ÊýÓÐÄÄЩ£¿
6)Í ......
1.ʲôÊÇ¿â
ÔÚwindowsƽ̨ºÍlinuxƽ̨϶¼´óÁ¿´æÔÚ×Å¿â¡£
±¾ÖÊÉÏÀ´Ëµ¿âÊÇÒ»ÖÖ¿ÉÖ´ÐдúÂëµÄ¶þ½øÖÆÐÎʽ£¬¿ÉÒÔ±»²Ù×÷ϵͳÔØÈëÄÚ´æÖ´ÐС£
ÓÉÓÚwindowsºÍlinuxµÄ±¾Öʲ»Í¬£¬Òò´Ë¶þÕß¿âµÄ¶þ½øÖÆÊDz»¼æÈݵġ£
±¾ÎĽöÏÞÓÚ½éÉÜlinuxϵĿ⡣
2.¿âµÄÖÖÀà
linuxϵĿâÓÐÁ½ÖÖ£º¾²Ì¬¿âºÍ¹²Ïí¿â£¨¶¯Ì¬¿â£©¡£
¶þÕߵIJ»Í¬µãÔÚÓÚ´úÂë ......
ÓÐÕâôһϵÁеÄÎÊÌ⣬ÊÇ·ñÔÚÀ§ÈÅ×ÅÄ㣺Óû§³ÌÐò±àÒëÁ¬½ÓÐγɵĵØÖ·¿Õ¼äÔÚʲô·¶Î§ÄÚ£¿Äں˱àÒëºóµØÖ·¿Õ¼äÔÚʲô·¶Î§ÄÚ£¿Òª¶ÔÍâÉè½øÐзÃÎÊ£¬I/OµÄµØÖ·¿Õ¼äÓÖÊÇʲôÑùµÄ£¿
ÏȻشðµÚÒ»¸öÎÊÌâ¡£Linux×î³£¼ûµÄ¿ÉÖ´ÐÐÎļþ¸ñʽΪelf(Executable and Linkable Format)¡£ÔÚelf¸ñʽµÄ¿ÉÖ´ÐдúÂëÖУ¬ld×ÜÊÇ´Ó0x8000000¿ªÊ¼°²ÅųÌÐòµÄ& ......