[NTLK] eMate diagnostics card, k diags image

Matthias Melcher m.melcher at robowerk.de
Fri May 11 12:08:00 EDT 2018


0xEA...... is the ARM machine code for unconditional relative jumps. The first eight words are jump vectors for reset and interrupts. The Newton ROM starts with 0xEA0061A0, which corresponds to "b ROMBoot" (branch to the label ROMBott at address 0x00018688.

You calculate the target address like this:

unsigned int branch_address(unsigned int addr, unsigned int cmd)
{
  if (cmd&0x00800000) { // jump backwards
    return (((cmd&0x00ffffff)|0xff000000)<<2)+addr+8;
  } else { // jump forward
    return ((cmd&0x007fffff)<<2)+addr+8;
  }
}

Or in non-programming words:

Take the command, 0xEA0061A0, subtract 0xEA000000 in a hex calculator.

If the new value is greater than or equal to 0x00800000, it's a backwards branch. Add 0xff000000. If the resulting value is not negative, flip the sign. 

Multiply the value by four, add the address of the branch command, add 8.

This should be the target address of your branch instruction.


> On May 10, 2018, at 03:34, Randy Glenn <randy.glenn at gmail.com> wrote:
> 
> My guess is that a diagnostic card would bypass the ROM altogether,
> otherwise you can't test for a bad ROM.
> 
> The first 32 bytes of the .BIN file look a lot like an ARM vector table to
> me. All of the vectors map to memory starting at 0xEA000000 - kind of
> weird, since the N2 docs say the PCMCIA cards are mapped to
> 0x30000000-0x3FFFFFFF or 0x40000000-0x4FFFFFFF. Maybe 0xEA000000 is RAM,
> and the digital controller copies the card data into that location on boot?
> How it would detect a test card, I'm not sure - really hoping it's not
> using the CIS for that.
> 
> The image is 1048576 bytes (what we used to call a megabyte) exactly, and
> the last chunk of the image is the pattern 0x6DB repeating (two bits on,
> one bit off, repeating). The magic hex number 0xFEEDFACE appears in a few
> various places in the image.
> 
> I think this is a bare-metal ARM program for testing, and I think it
> overrides the normal boot process. That last part is a guess, though. It'd
> be interesting to load this up on a 1MB flash card, and see if it works.
> 
> On Wed, May 9, 2018 at 5:36 PM, Victor Rehorst <victor at chuma.org> wrote:
> 
>> For various reasons I stumbled across this 2013 post from Steve White,
>> "Historical and Technical end of year treats":
>> http://lists.newtontalk.net/pipermail/newtontalk/2013-December/011047.html
>> 
>> I hadn't read it before because I wasn't reading the list at the time.  (I
>> call this time of my life "the dark ages")
>> 
>> In this, Steve White describes that he obtained what appears to be a
>> developers' edition of the "K Diagnostics Card" aka the eMate Diagnostics
>> card.  Not knowing how else to do so, he dumped it out through the
>> diagnostics software's own ROM Monitor and posted it to UNNA.
>> 
>> First of all, that's great, and neat, so I downloaded it to tinker.
>> 
>> Second of all, I can't find reference to anyone having done anything neat
>> with it, like, say, attempt to boot its code in an emulator.  Has anyone?
>> I made a few very crude attempts but got nowhere.  I would suspect that I
>> would need to execute the Newton OS ROM code to at least do some basic
>> hardware init before jumping into this code.  Perhaps it's a REx on a card?
>> 
>> It appears to be a copy of all of the entire raw flash *data* portion of
>> the card, that is, not including the CIS information. It's not a ROM
>> image.  It's definitely *something*.  Running "strings" on the binary blob
>> gives a lot of interesting output though.  My favourites are:
>> 
>> C Library vsn 4.01 [Sep  5 1996]
>> Q Romulator Detected
>> Q Romulator: Hammer Initialized
>> Booting a Q
>> Booting a K
>> Booting a K Prime
>> 
>> ... wait, what?  I know a "Q" is a MessagePad 2000, and a "K" is an eMate,
>> but what the heck is a "K Prime"?
>> 
>> 
>> 
>> ----------------------------------------------------------------------
>> 
>> http://newtontalk.net/
>> http://twitter.com/newtontalk
> ----------------------------------------------------------------------
> 
> http://newtontalk.net/
> http://twitter.com/newtontalk




More information about the NewtonTalk mailing list