From a71fd1b78f6e2ead46f374ca19f0f8eaf7de99d2 Mon Sep 17 00:00:00 2001 From: John Hansen Date: Mon, 29 Nov 2010 13:26:57 +0100 Subject: add support for native executable Enable the use of native compiled program from standard firmware interface. See http://www.tau.ac.il/~stoledo/lego/nxt-native/ for more details. Imported from NXT Enhanced Firmware. --- AT91SAM7S256/Source/c_cmd.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/AT91SAM7S256/Source/c_cmd.c b/AT91SAM7S256/Source/c_cmd.c index 4ce9829..7483846 100644 --- a/AT91SAM7S256/Source/c_cmd.c +++ b/AT91SAM7S256/Source/c_cmd.c @@ -1425,6 +1425,16 @@ NXT_STATUS cCmdReadFileHeader(UBYTE* pData, ULONG DataSize, NXT_ASSERT(pData != NULL); + if (strncmp((PSZ)pData, "NXTBINARY", VM_FORMAT_STRING_SIZE) == 0) + { + ULONG NativeOffset; + pCursor = (pData + 12); + NativeOffset = (ULONG)(*pCursor); + void (*native)(ULONG, ULONG) = (void (*)())(pData + NativeOffset); + (*native)((ULONG)pData, DataSize); + NXT_BREAK; + return (ERR_VER); + } //Assign pCursor to point to version word inside file header pCursor = (pData + VM_FORMAT_STRING_SIZE - 2); -- cgit v1.2.3