Xref: news-dnh.mv.net comp.os.msdos.djgpp:2027 Path: news-dnh.mv.net!mv!news.sprintlink.net!in1.uu.net!comp.vuw.ac.nz!tao.sans.vuw.ac.nz!empty From: empty AT sans DOT vuw DOT ac DOT nz (Malcolm Taylor) Newsgroups: comp.os.msdos.djgpp Subject: Re: interrupt stops being invoked Date: 13 Sep 1995 21:03:42 GMT Organization: SANS, Student Access Network System Lines: 37 References: <199509120623 DOT QAA22743 AT tinny DOT eis DOT net DOT au> Nntp-Posting-Host: tao.sans.vuw.ac.nz To: djgpp AT sun DOT soe DOT clarkson DOT edu Dj-Gateway: from newsgroup comp.os.msdos.djgpp Mat Hostetter (mat AT ardi DOT com) wrote: : ---------------------------------------------------------------------- : void interrupt_memory_start (void) { } : void my_interrupt_handler (void) : { : ... : } : void interrupt_memory_end (void) { } : ---------------------------------------------------------------------- : and then lock: : (char *) interrupt_memory_end - (char *) interrupt_memory_start : bytes, starting at: : (char *) interrupt_memory_start : Of course, there's no guarantee that this will work (I think even : casting a function pointer to a char * is forbidden) but it happens to : be the case that this works with the latest djgpp (just make sure all : of your functions are non-static). It will work, casting a function pointer is allowed (just another type of pointer, nothing special). There are a few other things to watch for. Make sure you do not compile with optimizations (esp. not -O3) as these can shift code about. If your interrupt routine uses any static variables (ie in the data seg) then lock these as well. And a question. Is the stack locked? (It seems like a funny question to ask, but I can't think of an answer) Malcolm : -Mat