没有合适的资源?快使用搜索试试~ 我知道了~
linux启动的函数调用关系
4星 · 超过85%的资源 需积分: 31 47 下载量 23 浏览量
2008-10-27
20:40:29
上传
评论
收藏 11KB TXT 举报
温馨提示
试读
6页
跟踪linux启动代码 从start_kernel()开始一直到rest_init();描述了 linux启动过程中的函数调用关系
资源推荐
资源详情
资源评论
start_kernel()
-->setup_arch()
-->paging_init() //paging_init() sets up the page tables, initialises the zone memory maps, and sets up the zero page, bad page and bad page tables.
-->zero_page = alloc_bootmem_low_pages(PAGE_SIZE); //allocate the zero page. ^^allocated(adr:0xc0000000 size:0x1000)
//Note that we count on this going ok.
-->memtable_init(mi) //Setup initial mappings.
//We use the page we allocated for zero page to hold the mappings,
//which will get overwritten by the vectors in traps_init().
//The mappings must be in virtual address order.
^^allocate (adr:0xc0000000 size:0x1000) for saving mappings information in it
^^use create_mapping() to mapping
^^SFR: 0xc0000000->0x30000000 (0x4000000)
^^FLUSH_BASE: 0xdf000000->0xe0000000 (0x100000)
^^FLUSH_BASE_MINICACHE: 0xde000000->0xe0100000 (0x100000)
^^machine vectors: 0xffff0000->0x30001000 (0x1000)because the size<0x100000
^^ we need allocate (adr:0xc0002000 size:0x1000) to make a level 2 page table
-->mdesc->map_io() //function pointer to smdk_map_io();
-->s3c2410_map_io() ^^use create_mapping() to mapping
^^SFR: 0xe8000000->0x48000000 (0x17000000)
-->iotable_init(smdk_io_desc) ^^use create_mapping() to mapping
^^CS8900a,nGCS3: 0xd0000000->0x19000000 (0x00100000)
^^PCMCIA_M, nGCS2: 0xd1000000->0x10000000 (0x01000000)
^^PCMCIA_IO, nGCS2: 0xd2000000->0x11000000 (0x01000000)
-->s3c2410_register_uart(0, 0);^^register_uart in kernel,fill uart_port struct.
-->s3c2410_register_uart(1, 1);
-->set_gpio_ctrl(GPIO_IR_TXD);
-->set_gpio_ctrl(GPIO_IR_RXD);
-->s3c2410_register_uart(2, 2);
<--
-->setup_arch()
-->paging_init() //paging_init() sets up the page tables, initialises the zone memory maps, and sets up the zero page, bad page and bad page tables.
-->zero_page = alloc_bootmem_low_pages(PAGE_SIZE); //allocate the zero page. ^^allocated(adr:0xc0000000 size:0x1000)
//Note that we count on this going ok.
-->memtable_init(mi) //Setup initial mappings.
//We use the page we allocated for zero page to hold the mappings,
//which will get overwritten by the vectors in traps_init().
//The mappings must be in virtual address order.
^^allocate (adr:0xc0000000 size:0x1000) for saving mappings information in it
^^use create_mapping() to mapping
^^SFR: 0xc0000000->0x30000000 (0x4000000)
^^FLUSH_BASE: 0xdf000000->0xe0000000 (0x100000)
^^FLUSH_BASE_MINICACHE: 0xde000000->0xe0100000 (0x100000)
^^machine vectors: 0xffff0000->0x30001000 (0x1000)because the size<0x100000
^^ we need allocate (adr:0xc0002000 size:0x1000) to make a level 2 page table
-->mdesc->map_io() //function pointer to smdk_map_io();
-->s3c2410_map_io() ^^use create_mapping() to mapping
^^SFR: 0xe8000000->0x48000000 (0x17000000)
-->iotable_init(smdk_io_desc) ^^use create_mapping() to mapping
^^CS8900a,nGCS3: 0xd0000000->0x19000000 (0x00100000)
^^PCMCIA_M, nGCS2: 0xd1000000->0x10000000 (0x01000000)
^^PCMCIA_IO, nGCS2: 0xd2000000->0x11000000 (0x01000000)
-->s3c2410_register_uart(0, 0);^^register_uart in kernel,fill uart_port struct.
-->s3c2410_register_uart(1, 1);
-->set_gpio_ctrl(GPIO_IR_TXD);
-->set_gpio_ctrl(GPIO_IR_RXD);
-->s3c2410_register_uart(2, 2);
<--
-->free_area_init_node() ^^ physical memories organized by 3 levels node zone page .a kernel can control several nodes .
^^a node has three zones :NORMAL DMA HIGHMEM
^^a zone has some pages .in our architecture there is only an node 0 and only has NORMAL zone
^^which contain 16384 page.
-->free_area_init_core() //Set up the zone data structures:
//- mark all pages reserved
//- mark all memory queues empty
//- clear the memory bitmaps
-->lmem_map = (struct page *) alloc_bootmem_node(pgdat, map_size) ^^we need 64byte page struct to control a page
^^here allocate (adr:0xc00b9000 size:1048640((16384+1)page*64))
^^to save the page struct list
^^+1 is to keep the aligned area in the allocated area
--> for (p = lmem_map; p < lmem_map + totalpages; p++) { // Initially all pages are reserved - free ones are freed
// up by free_all_bootmem() once the early boot process is done.
......
}
-->for (i = 0; ; i++) { ^^linux use a page buddy system .free_area[i].map i(0,9)
^^a bit in map refer is buddy between 2^i page
^^so free_area[0].map nead alloc 16384 pages /8/2 =1024 byte
^^ free_area[8].map nead alloc 16384 pages /8/2^7/2=4 byte
^^ free_area[8].map=null.
......
zone->free_area[i].map =
(unsigned long *) alloc_bootmem_node(pgdat, bitmap_size);
}
<--
<--
<--
-->request_standard_resources()^^call request_resource() to construct the address space allocated a resource struct save "PCI_Mem" resource
--> request_resource(&iomem_resource, res); ^^resource struct: "PCI_mem"(0x00000000~0xffffffff)
^^a node has three zones :NORMAL DMA HIGHMEM
^^a zone has some pages .in our architecture there is only an node 0 and only has NORMAL zone
^^which contain 16384 page.
-->free_area_init_core() //Set up the zone data structures:
//- mark all pages reserved
//- mark all memory queues empty
//- clear the memory bitmaps
-->lmem_map = (struct page *) alloc_bootmem_node(pgdat, map_size) ^^we need 64byte page struct to control a page
^^here allocate (adr:0xc00b9000 size:1048640((16384+1)page*64))
^^to save the page struct list
^^+1 is to keep the aligned area in the allocated area
--> for (p = lmem_map; p < lmem_map + totalpages; p++) { // Initially all pages are reserved - free ones are freed
// up by free_all_bootmem() once the early boot process is done.
......
}
-->for (i = 0; ; i++) { ^^linux use a page buddy system .free_area[i].map i(0,9)
^^a bit in map refer is buddy between 2^i page
^^so free_area[0].map nead alloc 16384 pages /8/2 =1024 byte
^^ free_area[8].map nead alloc 16384 pages /8/2^7/2=4 byte
^^ free_area[8].map=null.
......
zone->free_area[i].map =
(unsigned long *) alloc_bootmem_node(pgdat, bitmap_size);
}
<--
<--
<--
-->request_standard_resources()^^call request_resource() to construct the address space allocated a resource struct save "PCI_Mem" resource
--> request_resource(&iomem_resource, res); ^^resource struct: "PCI_mem"(0x00000000~0xffffffff)
剩余5页未读,继续阅读
资源评论
- 徐凡华2013-11-19怎么说呢,我看不明白
- a2002002014-06-12写的有点简单
widezhang
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功