Changes

Jump to navigation Jump to search
437 bytes removed ,  12:53, 29 March 2013
m
Test Translation Done
|-
| 0x08000000
| For applications: FCRAM + GSP heap size用于应用程序的FCRAM和GSP的堆大小
| 0x08000000
| Heap mapped by [[SVC|ControlMemory内存控制]]映射的堆
|-
| 0x10000000-StackSize栈大小| .bss physical address bss物理地址- total stack pages总栈页面| StackSize from process exheader从进程exheader获得的栈大小| Stack for the main-thread, initialized by the ARM11 kernel. The StackSize from the exheader is usually 0x4000, therefore the stack-bottom is usually 0x0FFFC000. The stack for the other threads is normally located in the process .data section however this can be arbitrary主线程的栈,被ARM11内核初始化。exheader中的栈大小一般是0x4000,而栈底常是0x0FFFC000。其他线程的栈一般定位到进程的.data位置,不过可以随意。
|-
| 0x10000000
|
| 0x04000000
| [[SVC|Shared共享]] memory内存
|-
| 0x14000000
| FCRAM+0
| 0x08000000
| Can be mapped by 可以用[[SVC|ControlMemory内存控制]], this is used for the application's GSP heap.映射,这是用于应用程序的GSP的堆。
|-
| 0x1EC00000
| 0x10100000
| 0x01000000
| [[IO]] registers, the mapped IO pages which each process can access is specified in the 寄存器,是每个进程都可以在[[NCCH#CXI|CXI]] exheader.中指定访问的IO映射页面。(Applications normally don't have access to registers in this range应用程序一般没有在此范围寄存器的访问权限)
|-
| 0x1F000000
| 0x18000000
| 0x00600000
| VRAM, access to this is specified by the exheader.VRAM,用exheader指定访问权限。
|-
| 0x1FF00000
| 0x1FF00000
| 0x00080000
| DSP memory, access to this is specified by the exheader.DSP内存,用exheader指定访问权限。
|-
| 0x1FF80000
|
| 0x1000
| [[Configuration Memory|设置信息内存]], all processes have access to this however write-permission to this page is specified by the exheader ,任何进程都对这里有访问权限,但是需要在exheader "Shared page writing" kernel flag.标记指定页面的写权限。
|-
| 0x1FF81000
|
| 0x1000
| Shared page, access to this is the same as 0x1FF80000.共享页面,访问方式和0x1FF80000相同。
|}
All executable pages are read-only, and data pages have the execute-never permission set. Normally .text from the loaded ExeFS所有的可执行页面都是只读的,数据页面则有不可许可执行的标记。一般的,ExeFS:/.code is the only mapped executable memorycode里面的. Executable text只能映射到可执行内存。可执行文件的[[RO Services|CROs]] can be loaded into memory, once loaded the CRO 可以被装载到内存,一旦装载完CRO的.text section memory page permissions are changed via text区域,内存页面的权限就被[[SVC|ControlProcessMemory控制进程内存]] from RW从RW- to R改到R-X. The address and size of each ExeFSX。每个ExeFS:/.code section is stored in the exheader, the permissions for each section is: code区域的地址和大小都在exheader里面,对应各个区域的权限是:.text R-X, .rodata R--, .data RW-, and .bss RW-。装载过的. The loaded .code is mapped to the addresses specified in the exheader by the ARM11 kernel. The stack permissions is initialized by the ARM11 kernel: RWcode会被ARM11内核根据exheader中指定的地址映射。栈的权限被ARM11内核初始化为RW-. The heap permissions is normally RW。堆的权限一般是RW-.
All userland memory is mapped with RW permissions for privileged-mode. However, normally the ARM11 kernel only uses userland read/write instructions(or checks that the memory can be written from userland first) for accessing memory specified by 所有用户空间的内存都在特权模式下映射为RW权限。不过一般ARM11内核访问内存根据[[SVC|SVCs]].的指定,只用用户空间读写指令(或者检查内存可以先从用户空间写入)。
The virtual memory located below 0x20000000 is process-unique, processes can't directly access memory for other processes. The virtual memory starting at 0x20000000 is only accessible in privileged-mode. When service 低于0x20000000的虚拟内存是进程独立的,进程不能直接访问其他进程的内存。从0x20000000开始的内存只有在特权模式下才能访问。当调用服务[[Services API|commands命令]] are used, the kernel maps memory in the destination process for input/output buffers, where the addresses in the command received by the process is replaced by this mapped memory. When this is an input buffer, the buffer data is copied to the mapped memory. When this is an output buffer, the data stored in the mapped memory is copied to the destination buffer specified in the command.时,内核会映射目标进程的内存作为IO缓冲区,将进程接到的命令地址替换为这个映射内存。如果是一块输入缓冲,缓冲数据会复制到映射内存。如果是输出缓冲,在映射内存中存储的数据会复制到命令指定的目标缓冲区。
The physical address which memory for the application memory-type is mapped to begins at FCRAM应用程序内存类型的内存物理地址会映射到FCRAM+0, the total memory allocated for this memory-type is stored in 0,总共为此内存类型分配的内存会存储到[[Configuration_Memory|设置信息内存]]. Applications' exefs。低于应用程序内存类的应用程序的exefs:/.code under the application memory-type is mapped at FCRAM 会映射到FCRAM + APPMEMALLOC - exefs:/.code size aligned to the page sizecode大小,根据页面大小向上对齐。应用程序的. The application .bss is mapped at CODEADDR bss会映射到CODEADDR - .bss size aligned down to the page size. Once the application exefsbss大小, 根据页面大小向下对齐。当应用程序的exefs:/.code, code,.bss, and stack are mapped, APPMEMALLOC is set to APPMEMALLOC bss和栈都被映射后,APPMEMALLOC会设置为APPMEMALLOC - (stacksize 栈大小 + bss_size bss大小 + codesizecode大小), where stacksize, bss_size, and code_size are aligned to the page size.,将栈大小,bss大小,code大小都对齐到页面大小。
== 系统内存细节 ==
句柄0xFFFF8001是到当前KProcess的引用。
== VRAM Map While Running Webbrowser 运行网络浏览器时候的VRAM映射 ==*0x1e6000-0x22C500 -- top screen framebuffer 0上屏幕帧缓冲0(240x400x3)*0x22C800-0x272D00 -- top screen framebuffer 1上屏幕帧缓冲1(240x400x3)*0x273000-0x2B9500 -- top screen framebuffer 2上屏幕帧缓冲2(240x400x3)*0x2B9800-0x2FFD00 -- top screen framebuffer 3上屏幕帧缓冲3(240x400x3)*0x48F000-0x4C7400 -- bottom screen framebuffer 0下屏幕帧缓冲0(240x320x3)*0x4C7800-0x4FF800 -- bottom screen framebuffer 1下屏幕帧缓冲1(240x320x3)
174

edits

Navigation menu