Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

iret from dpmi interrupt handler (Developers)

posted by RayeR(R) Homepage, CZ, 20.03.2018, 00:59

You don't need to care about ret/iret in djgpp.
just define your ISR as simple C function:

void covox_playback_isr(void)

and here is sample code how to install your new ISR:

//***************** install Covox playback ISR at timer interrupt ***********
void covox_playback_install(void)
  printf("Installing new timer ISR for Covox playback...n");
  // lock the functions and variables
  _go32_dpmi_lock_data((void *)&sound_buffer_cnt,(DWord)sizeof(sound_buffer_cnt));
  _go32_dpmi_lock_data((void *)&sound_data_request,(DWord)sizeof(sound_data_request));
  // load the address of the old timer ISR into the OldISR structure
  // point NewISR to the proper selector:offset for handler function
  // chain the new ISR onto the old one so that first the old INT_TIMER ISR will be called, then the new timer ISR
//  _go32_dpmi_set_protected_mode_interrupt_vector(INT_TIMER,&timer_isr_new);

//***************** remove Covox playback ISR from timer interrupt chain ****
void covox_playback_uninstall(void)
  printf("nRemoving new timer ISR for Covox playback...n");
  // load the old timer ISR back without the new ISR chained on
  covox_playback_setup_fs(0);          // set default timer speed

As I told, under DPMI host you cannot manipulate IVT on your own will but ratther use DPMI function wrappers to do things correctly. Read DJGPP FAQ documnt for more...

DOS gives me freedom to unlimited HW access.


Complete thread:

Back to the forum
Board view  Mix view
15869 Postings in 1464 Threads, 268 registered users, 92 users online (0 registered, 92 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum