- 论坛徽章:
- 0
|
版本:2.4.20-8
arch/i386/kernel/setup.c中关于处理bios中提供的内存区的处理函数sanitize_e820_map,注释里面在解释的时候提供了下面的图:
/*
511 Visually we're performing the following (1,2,3,4 = memory types)...
512
513 Sample memory map (w/overlaps):
514 ____22__________________
515 ______________________4_
516 ____1111________________
517 _44_____________________
518 11111111________________
519 ____________________33__
520 ___________44___________
521 __________33333_________
522 ______________22________
523 ___________________2222_
524 _________111111111______
525 _____________________11_
526 _________________4______
527
528 Sanitized equivalent (no overlap):
529 1_______________________
530 _44_____________________
531 ___1____________________
532 ____22__________________
533 ______11________________
534 _________1______________
535 __________3_____________
536 ___________44___________
537 _____________33_________
538 _______________2________
539 ________________1_______
540 _________________4______
541 ___________________2____
542 ____________________33__
543 ______________________4_
544 */
从代码的阅读中我理解函数的作用是将Bios提供的内存区进行重新排列,比如bios说0x00000000-0x00010000是RAM,然后又说0x0000A0000-0x00010000是Reserved,这明显有重叠。毕竟RAM的一部分可以被保留嘛,也可以用作ACPI。整理之后就变成0x00000000-0x0000A0000为第一个RAM区,0x0000A0000-0x00010000为Reserved。代码的阅读到没什么难的,可上面这个图怎么也对不上号,看不懂,请高手不吝赐教,谢了先! |
|