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

¹ØÓÚ linux ÄÚ´æ

Ê×ÏÈ£¬ÄÚ´æµÄ´óСÔÚlinuxÄÚºËÖеĻñÖª·½·¨
1.ͨ¹ýbootloader µÄ tag mem´«Èë¡£
Setup.c Öеĺ¯ÊýÈçÏ£º
static int __init parse_tag_mem32(const struct tag *tag)
{
if (meminfo.nr_banks >= NR_BANKS) {
printk(KERN_WARNING
"Ignoring memory bank 0x%08x size %dKB\n",
tag->u.mem.start, tag->u.mem.size / 1024);
return -EINVAL;
}
arm_add_memory(tag->u.mem.start, tag->u.mem.size);
return 0;
}
 
__tagtable(ATAG_MEM, parse_tag_mem32);
 
ÆäÖÐ×îÖØÒªµÄº¯ÊýΪ£º arm_add_memory
Õâ¸öº¯ÊýÏò meminfoÊý×éÖÐÌí¼ÓÁËÒ»Ïî¹ØÓÚ memµÄÃèÊö
2.ÁíÍâÒ»¸ö·½·¨£ºÍ¨¹ýÄÚºËÆô¶¯²ÎÊýmem=À´´«µÝ
Setup.c Öеĺ¯ÊýÈçÏ£º
 
static void __init early_mem(char **p)
{
static int usermem __initdata = 0;
unsigned long size, start;
 
/*
* If the user specifies memory size, we
* blow away any automatically generated
* size.
*/
if (usermem == 0) {
usermem = 1;
meminfo.nr_banks = 0;
}
 
start = PHYS_OFFSET;
size = memparse(*p, p);
if (**p == '@')
start = memparse(*p + 1, p);
 
arm_add_memory(start, size);
}
__early_param("mem=", early_mem);
 
ÆäÖеڶþÖÖ·½·¨¾ßÓиߵÄÓÅÏȼ¶¡£
ÁíÍ⣬»¹ÓÐÒ»ÖÖÐÞ¸ÄmemoryÊôÐԵİ취£º
mdesc->fixup(mdesc, tags, &from, &meminfo);
ÕâÖÖ·½·¨ÒÀÀµÓÚÌض¨µÄ¿ª·¢Æ½Ì¨£¬ÔÚƽ̨³õʼ»¯µÄÃèÊö½á¹¹Öж¨Òå¡£
 
×îÖÕ£¬ËùÒԵĹØÓÚmemoryµÄÐÅϢͨ¹ýº¯Êý
paging_init(&meminfo, mdesc);
´«µÝ¸ø mem ³õʼ»¯µÄ²¿·Ö¡£
 
µÚ¶þ£¬memoryµÄ³õʼ»¯¡£
paging_init µÄ¶¨ÒåÔÚ arch/arm/mm/mmu.cÖС£
 
ÔÚ paging_init ×îÖØÒªµÄº¯ÊýÊÇ£ºbootmem_init
 
¸Ãº¯Êý¶¨ÒåÓÚ£ºarch/arm/mm/init.cÖС£


Ïà¹ØÎĵµ£º

ÔÚLinuxÏÂÃæµÄµ÷ÓÃping

ÎÒÃÇÔÚÍøÂç±à³ÌµÄʱºò¾­³£Òª¼ì²âϵͳÊÇ·ñµÃµ½ÁËÓÐЧµÄIP,ÊÇ·ñ¿ÉÒÔÕýÈ·ÁªÍ¨µ½ÍøÂçÀïÃ档ͨ³£µÄ¼ì²é·½·¨¾ÍÊÇʹÓÃPINGÃüÁî¡£
¶øÔÚ³ÌÐòÀïÃæÈçºÎ×Ô¶¯ÈóÌÐòÖªµÀÁ¨?ÓÐÁ½ÖÖ°ì·¨£¬
Ò»ÖÖÊÇÀûÓÃϵͳµÄÄÜÁ¦£¬Ö±½Óµ÷ÓÃϵͳµÄshell£¬Èç·½·¨Ò»¾Í¿ÉÒÔÔÚlinuxϵͳÖкܺÃʹÓá£
ÁíÍâÒ»ÖÖÊÇÖ±½ÓÔÚ´úÂëÀïÃæʵÏÖpingÃüÁͨ¹ýµ÷Óú¯ÊýµÄÐÎʽ ......

linux ³£ÓÃcº¯Êý


opendir£¨´ò¿ªÄ¿Â¼£©
Ïà¹Øº¯Êý
open£¬readdir£¬closedir£¬rewinddir£¬seekdir£¬telldir£¬scandir
±íÍ·Îļþ
#include<sys/types.h>
#include<dirent.h>
¶¨Ò庯Êý
DIR * opendir(const char * name);
º¯Êý˵Ã÷
opendir()ÓÃÀ´´ò¿ª²ÎÊýnameÖ¸¶¨µÄĿ¼£¬²¢·µ»ØDIR*ÐÎ̬µÄĿ¼Á÷£¬ºÍopen()ÀàËÆ£¬½ÓÏ ......

LinuxµÄshell±à³Ì


 
Shell±¾ÉíÊÇÒ»¸öÓÃCÓïÑÔ±àдµÄ³ÌÐò£¬ËüÊÇÓû§Ê¹ÓÃLinuxµÄÇÅÁº¡£Shell¼ÈÊÇÒ»ÖÖÃüÁîÓïÑÔ£¬ÓÖÊÇÒ»ÖÖ³ÌÐòÉè¼ÆÓïÑÔ¡£×÷ΪÃüÁîÓïÑÔ£¬Ëü½»»¥Ê½µØ½âÊͺÍÖ´ÐÐÓû§ÊäÈëµÄÃüÁ×÷Ϊ³ÌÐòÉè¼ÆÓïÑÔ£¬Ëü¶¨ÒåÁ˸÷ÖÖ±äÁ¿ºÍ²ÎÊý£¬²¢ÌṩÁËÐí¶àÔڸ߼¶ÓïÑÔÖвžßÓеĿØÖƽṹ£¬°üÀ¨Ñ­»·ºÍ·ÖÖ§¡£ËüËäÈ»²»ÊÇLinuxϵͳºËÐĵÄÒ»²¿·Ö£¬µ«Ë ......

linuxÎļþºó׺

Ê×ÏÈҪ˵Ã÷µÄÊÇÔÚLinuxϵͳÖУ¬¿ÉÖ´ÐÐÎļþûÓÐͳһµÄºó׺£¬ÏµÍ³´ÓÎļþµÄÊôÐÔÀ´Çø·Ö¿ÉÖ´ÐÐÎļþºÍ²»¿ÉÖ´ÐÐÎļþ¡£¶øgccÔòͨ¹ýºó׺À´Çø±ðÊäÈëÎļþµÄÀà±ð£¬ÏÂÃæÎÒÃÇÀ´½éÉÜgccËù×ñÑ­µÄ²¿·ÖÔ¼¶¨¹æÔò¡£Ò»°ã
.cΪºó׺µÄÎļþ£¬CÓïÑÔÔ´´úÂëÎļþ£»
.aΪºó׺µÄÎļþ£¬ÊÇÓÉÄ¿±êÎļþ¹¹³ÉµÄµµ°¸¿âÎļþ£»
.C£¬.cc»ò.cxxΪºó׺µÄÎļþ£¬ÊÇC ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ