Overview Features Coding ApolloOS Performance Forum Downloads Products Order Contact

Welcome to the Apollo Forum

This forum is for people interested in the APOLLO CPU.
Please read the forum usage manual.
Please visit our Apollo-Discord Server for support.



All TopicsNewsPerformanceGamesDemosApolloVampireAROSWorkbenchATARIReleases
The team will post updates and news about our project here

Testing the MPU

Philippe Flype
(Apollo Team Member)
Posts 299
03 Sep 2016 18:11


We are currentely testing stuff for the next coming core.
 
  Between other stuff, there is a new "Unit" in the 68080.
 
  It is a 'Memory Protection' Unit, that allows to detects and protects from Illegal Memory Access.
 
  Gunnar wrote the unit in the core, then i tested it writing a MPU logger tool in ASM. The logger installs an exception handler in which i can dump registers status and / or memory areas when a IMA is encountered. And then if i want i can easily disasm a memory block of the last PC for example.
 
  I must say that it is cool stuff for coders, or even testers to check if something goes wrong in the system (my current amigaos install/libs/devs/...) or eventually to approbe the core.
 
  The MPU focus on Memory Protection from illegal Executions (PC in a bad mem area), Reads, or Writes.
 
  First tests shows me that it is cool stuff, that yet works well, and it deserves to develops a good tool.
 
  More explanations to come.


Philippe Flype
(Apollo Team Member)
Posts 299
03 Sep 2016 18:18


Actually, this tool immediately shows me a issue in my system.
  This will help to tracks bad stuff.
 
  The work in progress logger currentely is able to output such dumps :
 

  --------------------------------------------------
  D0  0000FFFF  D1  00000000  D2  00000000  D3  00000021
  D4  00000000  D5  00000024  D6  00000000  D7  082BBD04
  A0  082BC152  A1  00000000  A2  082BBF08  A3  082A3BDC
  A4  0829B330  A5  082BBD04  A6  08000BBC  A7  0800262C
  PC  082BBE80  SR  00000000  USP 00000000  SSP 00000000
  --------------------------------------------------
  D0  0000FFFF  D1  00000000  D2  00000000  D3  00000021
  D4  00000000  D5  00000024  D6  00000000  D7  082BA79C
  A0  082BABEA  A1  00000000  A2  082BA9A0  A3  082A2674
  A4  08299DA0  A5  082BA79C  A6  08000BBC  A7  0800262C
  PC  082BA914  SR  00000000  USP 00000000  SSP 00000000
  --------------------------------------------------
  D0  0000FFFF  D1  00000000  D2  00000000  D3  00000021
  D4  00000000  D5  00000024  D6  00000000  D7  082D549C
  A0  082D58EA  A1  00000000  A2  082D56A0  A3  082BD7A4
  A4  08279B80  A5  082D549C  A6  08000BBC  A7  0800262C
  PC  082D5614  SR  00000000  USP 00000000  SSP 00000000
  --------------------------------------------------
  D0  0000FFFF  D1  00000000  D2  00000000  D3  00000021
  D4  00000000  D5  00000024  D6  00000000  D7  082BAC2C
  A0  082BB07A  A1  00000000  A2  082BAE30  A3  082A270C
  A4  08299BF8  A5  082BAC2C  A6  08000BBC  A7  0800262C
  PC  082BADA4  SR  00000000  USP 00000000  SSP 00000000
 

  --
 
  Then i can use a disassembler to check what's in PC :
 

  PC  082BADA4
 
  Instructions list is :
 
  082bad80 :  41fa 02e4                  lea.l $82bb066(pc),a0
  082bad84 :  20c7                      move.l d7,(a0)+
  082bad86 :  20c6                      move.l d6,(a0)+
  082bad88 :  2246                      movea.l d6,a1
  082bad8a :  2169 ff6c 0002            move.l -$94(a1),$2(a0)
  082bad90 :  45fa 009e                  lea.l $82bae30(pc),a2
  082bad94 :  234a ff6c                  move.l a2,-$94(a1)
  082bad98 :  2c78 0004                  movea.l $4.w,a6
  082bad9c :  41fa 02dc                  lea.l $82bb07a(pc),a0
  082bada0 :  20ae fedc                  move.l -$124(a6),(a0)
  082bada4 :  41fa 0058                  lea.l $82badfe(pc),a0
  082bada8 :  2d48 fedc                  move.l a0,-$124(a6)
  082badac :  41fa 02d2                  lea.l $82bb080(pc),a0
  082badb0 :  20ae fe10                  move.l -$1f0(a6),(a0)
  082badb4 :  41fa 0066                  lea.l $82bae1c(pc),a0
  082badb8 :  2d48 fe10                  move.l a0,-$1f0(a6)
 

  --
 
  So what i can see here ?
 
  move.l a2,-$94(a1) use a1 which is equal to 00000000.
  this of course is bad. the MPU catched it ! then the logger informed me from this bad execution code.


Mr-Z EdgeOfPanic

Posts 189
04 Sep 2016 15:22


Wauw this is a very nice feature!


Marcus Gerards

Posts 58
04 Sep 2016 18:28


You now only have to look up, which task occupies the PC where the fault happened and display it. Please make it a bit more verbose as well (Nullpointer accesses, etc.) and we have a great Enforcer-like tool for the Vampire.

I won't complain anymore about a missing 68k-compatible MMU, then. :)


Philippe Flype
(Apollo Team Member)
Posts 299
05 Sep 2016 14:34


Re,
 
  I continued some work on the tool,
 
  It can display the registers state
 
  - D0 to D7
  - A0 to A7/USP
  - B0 to B7 (yes this is new to 68K, these are the B-Regs)
  - SSP, SR, PC
 
  It displays a memory dump of the first 32 bytes of the memory registers and PC block of code :
 
  - A0 to A7/USP
  - B0 to B7 (todo)
  - SSP, PC
 
  It also displays the disassembly of PC area using the great disassembly.library from THOR. By the way, an update of this library for the 68080 would be very very nice (for example MOVEB.L #Immediate,Bn).
 
  Screenshot of the logger in action :
 

  EXTERNAL LINK 
 
  - On the left window => the logger that listen for unexpected IMA (here it catched a IMA form my testcase program at right).
 
  - On the right window => the faulty program that makes a IMA (poking $aabbccdd at a read-only address $00FF0000).
 


Marcus Gerards

Posts 58
26 Sep 2016 13:23


Hi Philippe,

would it be possible to get a beta version of your tool? I'm a regular user of MuForce/MuGuardianAngel(+Mungwall) and would like to test it.

Best regards,

Marcus



Roman S.

Posts 149
26 Sep 2016 16:16


How is this unit related to the MMU? Is this a subset of the MMU, or maybe provides something no current 68k MMU does?

posts 7