2004-10-22 04:10 AM
2004-10-20 05:35 AM
I need to use two different codes.. one for the boot (sector 0) and one for the main (sector 2) so.. i dont know how to set the vector interrupt for both sector.. becouse i need some interrupt for each code....
i was thinking to put the interrupt vector in ram, but how??2004-10-21 12:56 AM
2004-10-21 03:15 AM
One way of doing this is- in sector1/2 program, keep a jump table which resembles the vector table. In this jump table, write the addresses of the interrupts in sec1/2.Write a dummy address if a particular interrupt function is not used in sec1/2. But, please maintain the full table without missing the sequence.
In sector0 program, define all the interrupts. When an interrupt occurs, it will go to the ISR defined in sector0. Now, Jump to the address in sector1/2 jump table where you have placed the particular ISR address located in sec1/2. The two programs in sec0 and sec1/2 are completely independant. Use a variable say PROG_Status. Assign this variable a particular value when you enter the sector0 main program, say 2. When you jump to sector1/2 main, update this variable, say 4. This variable can be used for interrupts which are used in sector0 and also in sector1/2. Say a Timer interrupt is being used in sec0 and also in sec1/2. Now, when the interrupt occurs, it goes to sec0 Timer ISR. There if the variable's value is 2, process the function in sec0 and return. If the variable's value is 4, jump to sec1/2 ISR through the jump table located at the end of sec1/2. I hope this helps you. Rgds, Venky2004-10-22 04:10 AM
Thanks you.. for your help..