Thread: interrupts

  1. #1
    Registered User
    Join Date
    Nov 2009
    Posts
    2

    Cool interrupts

    friends..currently working on designing a scheduler in Borland C. I don't have idea how to preempt a function using interrupt with out the function's cooperation.

  2. #2
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    What you can and can not do with an interrupt, depends on the OS you have. In DOS days, you had complete access to the interrupts, but you can't do with a multi-tasking OS, it would be chaos and crash city.

    It's not a problem for C - C doesn't care what the OS will or won't do with an interrupt request. It just will make it that request, if you add that line of code.

    So check with your OS experts for the OS you want to use this on.

  3. #3
    Registered User
    Join Date
    Oct 2008
    Location
    TX
    Posts
    2,059
    As noted by Adak, it all depends on the OS and if you don't have one then you need to DIY by figuring out how to interrupt the micro during the function call.
    This would involve saving the current process data on the system stack, servicing the interrupt, and returning to process the function call ie re-entrant.

  4. #4
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    usually task switching in DOS or roll your own OS's is done using int 15h the timer interrupt.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 6
    Last Post: 11-30-2009, 03:32 AM
  2. Hardware interrupts
    By Sentral in forum Tech Board
    Replies: 5
    Last Post: 02-23-2009, 06:46 PM
  3. Interrupts in PM?
    By VirtualAce in forum C Programming
    Replies: 0
    Last Post: 07-29-2003, 12:20 PM
  4. Using Software Interrupts in C++
    By Unregistered in forum C++ Programming
    Replies: 3
    Last Post: 02-16-2002, 01:03 AM
  5. Mouse Interrupts
    By linuxman132 in forum C Programming
    Replies: 9
    Last Post: 12-26-2001, 11:19 AM