GP32 What Can Be Done With The Mmu?


MojoJojo

Member
Joined
Jun 19, 2003
Messages
165
Partly because of all the talk about the GBA emulator, I've been scouring through the documentation looking at how the MMU stuff works. I have a few questions which hopefully someone can answer.

1)What, precisely, does the BIOS call _swi_mmu_change allow you to do? Does it replace an entry in the level 1 table or the level 2 table or both?
2) Can you change the translation tables in normal code? Can you write to those addresses, and can you do the necessary things to the MMU so changing them doesn't mess everything up?
3) Can you get into supervisor mode? What mode are you in, in an interrupt handler set up through a BIOS call? Does it switch you into user mode before calling your interrrupt handler?
4) What is the Modified Virtual Address (MVA)? The ARM docs say it generated from the VA address by the ProcID. What is the ProcID?

Sorry if these are covered in the docs but I've missed them, the Samsung Doc is around 600 pages long...

I might have a go at making some sort of virtual memory manager... Probably pretty useless, but you don't get many opportunities to write memory managers these days :p

Thanks for any help that may be forthcoming...
 
1) _swi_mmu_change() allows you to change caching of memory regions (4K page granularity). This is well documented in www.deadcoderssociety.tk

2) yes you can. GP32 boots into privileged mode. Current MMU table locations are documented in www.deadcoderssociety.tk and there in the BIOS dump.

3) see 2)

4) ProcID (or PID actually) allows you to do fast context switching. So if your Virtual Address bits 31-25 == 0 then the Modified Virtual Address is (Virtual Address) | (PID << 25).. Then you could have 128 processes, each having 32M memory map and switch between those just changing the PID. No need to modify translation tables as it normally would require.

Cheers. <_<
 
Back
Top