Learning the storage and address ing technology of Windows CE
Source: Internet
Author: User
Windows CE adopts a four-layer memory management structure, which is from bottom to top: physical memory, virtual memory, logical memory and C/C ++ Runtime Library. the physical memory includes: RAM (for OS and Program Provides running and buffer space), Rom (storage program, including OS and some files), flash (Erasable). Ce supports a maximum of 512 MB physical memory.
All processes share 4 GB of virtual storage space, which is managed by page. Different processors support different page sizes (arm supports 1 K, 4 K, 64 K, and 1 m; x86 supports 4 K and 4 m ). the application for virtual memory is divided into two processes: Reserve and commit ). virtual Memory requires MMU support on the hardware. MMU maps virtual addresses to physical addresses and provides memory protection. ce divides 4G virtual memory into two parts: 2G for user space, used by applications; 2G for kernel space, used by OS.
The so-called logical memory is divided into heap (64 K) and stack (60 k). The C/C ++ Runtime Library provides a series of memory management functions, such as malloc, new, and delete.
In PB's help, it is pointed out that wince has two types of addresses: physical address and virtual address. the concept varies with the CPU of different architectures. MIPS and shx processors operate on 1 GB of storage (M cache, m non-Cache), while x86 and arm divide physical storage in oemaddresstable. the corresponding address ing methods are also divided into two types: MIPS and shx processors, which are directly defined in the CPU and kernel without MMU; x86 and arm define ing relationships in oemaddresstable or call createstaticmapping and nkcreatestaticmapping after the OS is started to map from virtual address to physical address.
Another classification is to map virtual addresses into static virtual address ing and dynamic virtual address ing. the so-called static state is to define the ing relationship in oemaddresstable or call createstaticmapping and nkcreatestaticmapping after the OS is started to map the virtual address to the physical address; dynamic is through virtualalloc and virtualcopy (or call the mmmapiospace function ). the difference between the two ing virtual addresses is that static virtual addresses can only be used by the kernel for ISR access to peripheral storage. dynamic virtual addresses can access physical addresses in applications (such as operating registers in the driver ).
In the x86 and arm CPUs, there is a data structure that is particularly important for address ing technology: oemaddresstable. this array defines the ing relationships between peripherals from 4G virtual addresses to M physical addresses. it is located in oeminit under the Public/common/oak/CSP/x86/oal directory. in ASM, the format is virtual address, physical address, size
In x86, the size must be a multiple of 4 m, and in arm, it must be a multiple of 1 m. the kernel has established two virtual addresses: From 0x80000000 to 0x9fffffff, It is a physical address ing with cache, while 0xa0000000 to 0 xbfffffff is a physical address ing without cache. when the driver accesses peripherals, it should use a virtual address without a cache segment. note that if oemaddresstable is changed, the config. bib.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service