| Pages | Size (bytes) | Size (MB) | Address |
Physical RAM | 13924 | 57032704 | 54.39 |
|
Kernel Prealloc. | 71 | 290816 | 0.28 | 0x 8057c 000 - 0x 805c 2fff |
Paging Pool | 1285 | 5263360 | 5.02 | 0x 805c 3000 - 0x 80ac 7fff |
Kernel RAM Map | 1 | 4096 | 0.00 | 0x 80ac 8000 - 0x 80ac 8fff |
Watson Size | 75 | 307200 | 0.29 | 0x83b95000 - 0x83bdffff |
Overhead | 4 | 16384 | 0.02 |
|
Object Store | 8 | 32768 | 0.03 |
|
Program Memory | 12480 | 51118080 | 48.75 |
|
我们用Windows Mobile自带memory去查看系统的内存大小,以我的机器为例,我会看见48.75MB。可以看出这个数值就是Program Memory。可是实际上我有DRAM 64MB。
计算一下上表,发现:
Physical RAM= Kernel Prealloc+ Paging Pool+ Kernel RAM Map+ Watson Size+ Overhead+ Object Store+ Program Memory
值得注意的是Paging Pool是一个大头,在配置它的大小时要特别注意。
另外,上表中中间一列Size的大小都是Pages x 4096,所以它是页对齐的。
可是64MB-54.39MB=9.61MB,它跑到哪里去了?
打开BSP中的config.bib,我的DRAM从0x8000,0000开始64MB,其中内核基地址是0x8020,0000。
0x8000,0000-0x8020,0000的2MB是reserved区域,NK之后还有4MB的reserved区域。这样就有2+4=6MB保留。再看NK中,0x8020,0000-0x 8057c 000大概还有3点多MB,它是NK的程序和代码段。一次这就是9.61MB跑掉的原因。
综上,这就是DRAM的空间分配。