dmonMain.c 965 Bytes
#include <os.h>

double mainThreadStack[0x200], rmonThreadStack[0x200];

OSMesgQueue mq1, mq2;
OSMesg msgs1[1], msgs2[1];

/*
 * The sole purpose of this is to kick off an rmon thread, which can service
 * debugger read/write requests on the diagnostic's behalf.
 */

void mainproc( void * dummy )
{
    OSMesg m;
    OSThread rmonThread;
    extern void rmonMain( void * );

    printf( "Mainproc\n" );
    osCreateThread( &rmonThread, rmonMain, (void *)0,
	&rmonThreadStack[0x200],
	OS_IM_CART, (OSPri) 250 );
    osStartThread( &rmonThread );
    printf( "diagnostic server entering idle thread...\n" );

    /* become the idle thread */

    osSetIntMask( OS_IM_CART );
    osSetThreadPri( 0, 0 );
    for ( ; ; )
	;
}

void bootproc( void )
{
    OSThread mainThread;

    osInitialize();
    printf( "Bootproc\n" );
    osCreateThread( &mainThread, mainproc, (void *)0,
	&mainThreadStack[0x200], OS_IM_NONE, (OSPri) 127 );
    osStartThread( &mainThread );
}