How to service an interrupt using a timer at the end of task

Status
Not open for further replies.

fanghl

Newbie level 4
Joined
Jul 8, 2006
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Seattle
Activity points
1,319
Need help on interrupt

I'm working on a class project that we are building a simple kernel on Tern TD40 board. That thing has two internal clocks. We are required to use one of them to schedule task control block. we need to service an interrupt using the timer at the end of each task cycle and I don't know how to do that.

any help would be greatly appreciated.
 

Re: Need help on interrupt

Is this board based on Intel 188/186?
 

Need help on interrupt

It's based on AM186.
 

Re: Need help on interrupt

Do you have any RTOS running on that board? If you do, you will need to find out how to plug in yout interrupt handler into that RTOS. If you don't than, find any book about x86 real mode programming, and all description on interrupt handling is there. You may want to search this board, to see if there were previous posts regardng those books.
 

Re: Need help on interrupt

from what u have writen i understand that u want to switch tasks with the help of timer interrupt.
1. configure one of the timer say timer1 to interval mode with 1 ms time. So after
every i ms time it will raise an interrupt.
2. place your scheduler at this interrupt address. The job of scheduler is if more than
one task are present move the running task to "ready" state and move the other
but higher priority task to "runnung" state.
3. your scheduler internaly need to call dispatcher which will take care for saving and
restoring task contest.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…