Virtual Address Space

The MIPS32® 4GB virtual address space is partitioned into five fixed-size segments with traditional names; different things happen according to the virtual memory area an address lies in, as follows:

KUSEG: 0x00000000-0x7FFFFFFF (low 2GB) :

These are the addresses permitted in User mode (see Modes of Operation). In machines with a memory management unit (MMU), they will always be mapped. You should not attempt to use these addresses unless the MMU is set up. On PIC32MX, this region is also cacheable.

KSEG0: 0x80000000-0x9FFFFFFF (512MB) :

These addresses are translated directly into physical addresses by stripping off the MSB and mapping them contiguously into the low 512MB of physical memory (0x00000000 - 0x1FFFFFFF). Since this is a "trivial" translation, these addresses are often called "unmapped". On PIC32MX, this region is also cacheable, and is the default space for application code.

KSEG1: 0xA0000000-0xBFFFFFFF (512MB):

These addresses are mapped into physical addresses by stripping off the leading 3-bits, giving a duplicate mapping into the low 512MB of physical memory (0x00000000 - 0x1FFFFFFF). But this time, access will not use the cache.

KSEG1 is the only memory region that can be used at reset because the prefetch cache must be configured by the boot code before it can be used. Therefore your boot code must be placed in KSEG1.

KSEG2: 0xC0000000-0xDFFFFFFF (512MB) & KSEG3: 0xE0000000-0xFFFFFFFF (512MB) :

These areas are only accessible in Kernel mode. On PIC32MX devices, these regions are not translated to any physical memory resources. Segment KSEG3 contains the debug segment (DSEG), which is available to the EJTAG probe debugger or monitor.

20th Annual
Microchip MASTERs Conference 2016
Register now - Deadline: July 29

JW Marriott Desert Ridge Resort-Phoenix, AZ

© 2016 Microchip Technology, Inc.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.