To: djgpp AT delorie DOT com Subject: Re: My interrupt handler References: <7fcm2k$31g$2 AT news DOT luth DOT se> From: Michael Bukin Date: 18 Apr 1999 23:43:40 +0700 In-Reply-To: ams@ludd.luth.se's message of "18 Apr 1999 13:18:12 GMT" Message-ID: <20iuatubeq.fsf@Sky.inp.nsk.su> Lines: 29 X-Mailer: Gnus v5.5/Emacs 19.34 Reply-To: djgpp AT delorie DOT com ams AT ludd DOT luth DOT se (Martin Str|mberg) writes: > Now I'm back to the basics. Here follows a minimal interrupt handler > that only chains to the previous one. After that one is installed I > issue an interrupt just to make sure it's working. Alas it isn't; the > program stops after inserting the interrupt handler. The last thing it > prints is "Now.". > > popl %ds > ljmp %fs:_old_isr IMHO, it should be %cs:_old_isr. And you don't need to clobber %fs. > new_isr.offset32 = (unsigned long)&handler; > asm("movw %%cs, %0": "=g" (new_isr.selector) ); It can be written as new_isr.selector = _my_cs (); > address_of_old_isr = old_isr.offset32; > selector_of_old_isr = old_isr.selector; This is not necessary when using ljmp %cs:_old_isr and lcall %cs:_old_isr. -- Michael Bukin