简体   繁体   中英

Can I change CPU mode to read memory?

Can I programmatically change the CPU modes? (For example, from protected mode to real mode.)

I want to read tmemory in Visual Studio but I get an access error. (Because the processor is in protected mode?)

How can I do this?

To switch to real mode, your code must:

  • have high enough privilege ("CPL = 0"). This mostly restricts it to "kernel only" for most operating systems (eg Windows).

  • be running in memory that can be accessed in real mode (in the first 1 MiB of the physical address space). Otherwise as soon as you enter real mode you will crash because the CPU can't access your code.

For all cases where it is possible to switch to real mode to access memory (and possible to access the memory from real mode); it's also possible to access memory without switching to real mode (eg alter segments and/or page tables) with less hassle and higher performance.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM