James Kimble

Linux 2.6.10, MCF5475/85EVB, Getting "Illegal instruction" message...

Discussion created by James Kimble on Feb 4, 2008
Latest reply on Feb 8, 2008 by James Kimble

I've had Linux running on this platform (MCF5484 on a custom board based on the MCF5485EVB) for several months now but though I can compile and run programs on it I always get the message "Illegal instruction" upon program completion. For example the following program:

===============================================================
#include <stdio.h>

int main ()
{
    struct S1D_REGS
    {
        unsigned char INDEX;
        unsigned long VALUE;
    } aS1d_reg;

    printf ("sizeof(aS1d_reg): %d bits\n", sizeof(aS1d_reg)*8);
    printf ("sizeof(unsigned short): %d bits\n", sizeof(unsigned short)*8);
    printf ("sizeof(unsigned int): %d bits\n", sizeof(unsigned int)*8);
    printf ("sizeof(unsigned long): %d bits\n", sizeof(unsigned long)*8);
    printf ("sizeof(unsigned char): %d bits\n", sizeof(unsigned char)*8);

    exit (0);
}
================================================================
Output:
sizeof(aS1d_reg): 48 bits
sizeof(unsigned short): 16 bits
sizeof(unsigned int): 32 bits
sizeof(unsigned long): 32 bits
sizeof(unsigned char): 8 bits
Illegal instruction
===============================================================

Real simple program, seems to run to completion without error but before the program exits it gives that message. What gives?  Every program I run does this. Any ideas....?

Outcomes