Beispiel #1
0
void SaveOrigVectors( void )
{
    rm_data             *p;
    unsigned            i;
    unsigned            old;

#ifdef FULL_SAVE
    for( i = 0; i < INT_VECT_COUNT; ++i ) PMVectSaveList[i]=i;
    for( i = 0; i < EXCEPT_COUNT; ++i ) PMExceptSaveList[i]=i;
#endif
    old = D32NullPtrCheck( 0 );
    /* haven't moved things yet, so PMData isn't set up */
    p = (rm_data *)RMDataStart;
    for( i = 0; i < NUM_VECTS; ++i ) {
        p->orig_vects[i].a = MyGetRMVector( i );
    }
    D32NullPtrCheck( old );
    for( i = 0; i < NUM_PM_SAVE_VECTS; ++i ) {
        OrigPMVects[i] = DPMIGetPMInterruptVector( PMVectSaveList[i] );
    }
    for( i = 0; i < NUM_PM_SAVE_EXCEPTS; ++i ) {
        OrigPMExcepts[i] = DPMIGetPMExceptionVector( PMExceptSaveList[i] );
    }
    memcpy( p->vecttable1, p->orig_vects, sizeof( p->vecttable1 ) );
    memcpy( p->vecttable2, p->orig_vects, sizeof( p->vecttable2 ) );
    memcpy( SavePMVects, OrigPMVects, sizeof( SavePMVects ) );
    memcpy( SavePMExcepts, OrigPMExcepts, sizeof( SavePMExcepts ) );
}
Beispiel #2
0
void RestoreOrigVectors(void)
{
    unsigned            i;
    unsigned            old;

    for( i = 0; i < NUM_PM_SAVE_EXCEPTS; ++i ) {
        DPMISetPMExceptionVector( PMExceptSaveList[i], OrigPMExcepts[i] );
    }
    for( i = 0; i < NUM_PM_SAVE_VECTS; ++i ) {
        DPMISetPMInterruptVector( PMVectSaveList[i], OrigPMVects[i] );
    }
    old = D32NullPtrCheck( 0 );
    for( i = 0; i < NUM_VECTS; ++i ) {
        MySetRMVector( i, PMData->orig_vects[i].s.segment, PMData->orig_vects[i].s.offset );
    }
    D32NullPtrCheck( old );
}
Beispiel #3
0
/* Returns 0 if successful
*/
static int hook_debug_interrupts( void )
{
    int         i;
    PACKAGE FarPtr package = NULL;

    if( my_package_bind( DOS4G_KERNEL_PACKAGE_NAME, DOS4G_DEBUG_HOOK_ENTRY, &package, (ACTION **)&debug_hook ) )
        return( 1 );

    if( my_package_bind( DOS4G_KERNEL_PACKAGE_NAME, DOS4G_INTCHAIN_ENTRY, &package, (ACTION **)&chain_interrupt ) )
        return( 2 );

    /* OK to not find this entry point
    */
    my_package_bind( DOS4G_KERNEL_PACKAGE_NAME, DOS4G_NULLP_ENTRY, &package, (ACTION **)&D32NullPtrCheck );

    if( D32NullPtrCheck != NULL_PTR )           /* Disable NULLP checking for now */
        nullp_checks = D32NullPtrCheck( 0 );

    for( i = 0; i < sizeof( hook_exceptions ) / sizeof( hook_exceptions[0] ); i++ )
        debug_hook( hook_exceptions[i], 1, debug_handler );
    for( i = 0; i < sizeof( hook_interrupts ) / sizeof( hook_interrupts[0] ); i++ )
        debug_hook( hook_interrupts[i], 0, debug_handler );

    /*  Hook the hot key interrupt in protected mode and make it pass up.
    */
    if( _d16info.miscellaneous & D16misc_AT_compat ) {
        debug_hook( hotkey_int, 1, debug_handler );
        debug_hook( hotkey_int, 0, debug_handler );
        rsi_int_passup( hotkey_int );
    }

#ifdef TIMER
    if( timer_mult != 0 ) {
        debug_hook( INT_TIMER, 0, debug_handler );          /* Hook as interrupt only */
        outp( TIMER0, ( 65536 / timer_mult ) & 0xff );
        outp( TIMER0, ( 65536 / timer_mult ) >> 8 );
    }