🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #5525

Re: Info on Changing Stacks in protected mode

#5525
From: Kevin Johnson
Date: Fri, 29 Mar 1991 18:38
24 lines
1555 bytes
resnicks@netcom.COM (Steve Resnick) writes:


>I saw this article in C User's Journal about multi-threaded C using 
>setjmp/longjmp. This was something proposed to me a while ago, and thought
>I'd try and work up my own code. After looking at the code I realized that
>each thread is going to need a new stack. Assembler in hand, I write this
>fairly generic assembler routine which launches the new thread with a new
>stack. Everything works great until I run this under OS/2 rather than MS DOS.
>OS/2 will not let me clear interrupts while changing SS:SP.  My question:
>Is it necessary to disable interrupts while switching stacks in protected 
>mode? 

I always thought it was necessary, and that's how I do it.  Of course, I'm
not an expert on the issue.

>If so, what is the appropriate meathod under OS/2? Is there a call
>to prevent task switching/interrupt processing? Or, should it be implemented
>as part of an IOPL segment? 

Under OS/2, you will want the stack switching code to be in its own segment,
then make that segment have IOPL privileges. 

				--Kevin
Technical Details
Message-ID: <1991Mar29.183850.27619@unicorn.cc.wwu.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!ogicse!unicorn!kevinj
References: <1991Mar29.155840.2626@netcom.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!ogicse!unicorn!kevinj
From: kevinj@unicorn.cc.wwu.edu (Kevin Johnson)
Newsgroups: comp.os.msdos.programmer,comp.os.os2.programmer
Subject: Re: Info on Changing Stacks in protected mode
Message-ID: <1991Mar29.183850.27619@unicorn.cc.wwu.edu>
Date: 29 Mar 91 18:38:50 GMT
References: <1991Mar29.155840.2626@netcom.COM>
Organization: Western Washington University, Bellingham WA.
Lines: 24