From: "Gerald Hilderink" Newsgroups: comp.os.msdos.djgpp Subject: Re: returning from interrupt with iret? Date: Sat, 18 Dec 1999 19:47:28 +0100 Organization: University of Twente, Enschede, The Netherlands Lines: 39 Message-ID: <83glet$2sf$1@dinkel.civ.utwente.nl> References: NNTP-Posting-Host: ut196164.inbel.utwente.nl X-Server-Date: 18 Dec 1999 18:57:33 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com I am writing a special embedded kernel that runs on micro-controllers, DSPs and also the i386 processor. For the i386 processor I use the _go32_dpmi_* functions in C for registering ISRs. This works fine. The kernel allows nested interrupts and for the last interrupt it may need to do a context switch (by swapping stack pointers) within an ISR and when its IRET is executed it should load the new Instruction Pointer for the new context. This does not work with DPMI, because the *_iret_wrapper mechanism or so is using the stack as well. Therefore I want to add my own inline assembler IRET code. Unfortunately, I can not find the information I need to do this. Maybe other techniques can help me? Eli Zaretskii wrote in message news:Pine DOT SUN DOT 3 DOT 91 DOT 991213103453 DOT 29470M-100000 AT is... > > On Sun, 12 Dec 1999, Gerald Hilderink wrote: > > > How can I program an inline "iret" assembly instruction in an interrupt > > service routine (isr) that is registered by the dpmi protected mode > > interface? > > If the ISR is coded in assembly, simply use IRET ;-). > > If it is coded in C, you should be using one of the _go32_dpmi_* > functions to install it as an ISR, and the _go32_dpmi_* functions do > an IRET for you. > > > I need to enforce an iret to perform a context switch in the isr. > > I don't understand what that means, in particular, what kind of > ``context switch'' are you talking about. Some kinds of ``context > switch'' are impossible in the DPMI environment (prohibited by the > DPMI spec). > > > Is there technical information available about the _go32_dpmi functions? > > The docs in libc.info, and the source code in djlsr202.zip. If > something is still unclear, please ask here.