Article View: comp.os.msdos.programmer
Article #2874Re: Porting UNIX apps. to MS-DOS
From: lsalomo
Date: Wed, 31 Oct 1990 17:30
Date: Wed, 31 Oct 1990 17:30
36 lines
1924 bytes
1924 bytes
If you extend the switching stacks idea a little further, you can implement a multi-tasking OS kernal rather easily. Do not try this at home: ;) Intercept the timer interrupt to count the number of time clicks the current process has been running for. When it reaches a terminal count, generate an interrupt to call the dispatcher. The dispatcher's job is to remove the process in the run queue and place it in ascending order (by priority) in the ready queue. It then takes the first item from the ready queue (==the highest priority) and places it in the run queue. THEN (here's the tricky part) it switches stack segments from the one which belonged to the last running process to the stack segment of the next process to run. When all of the interrupts unwind, the point in the new process where it was interrupt gets popped off into the registers, and the new process starts executing where it left off. = = = = = = = = Off course, the only tricky part is loading the .EXE's from disk and initializing the stacks to point to their entry point. = = = = = = = = If you'd like to discuss this further, contact me offline... Cheers, Q - the "Q"uestor for knowledge (, a degree, etc.) lsalomo@hubcap.clemson.edu ibmman@prism.clemson.edu ibmman@clemson.clemson.edu ============================================================================= "Gee Wally, I think there's something wrong with the Beaver." =============================================================================
Technical Details
Message-ID:
<11281@hubcap.clemson.edu>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!hubcap!lsalomoReferences:
<9449@jarthur.Claremont.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!hubcap!lsalomo From: lsalomo@hubcap.clemson.edu (lsalomo) Newsgroups: comp.os.msdos.programmer Subject: Re: Porting UNIX apps. to MS-DOS Message-ID: <11281@hubcap.clemson.edu> Date: 31 Oct 90 17:30:27 GMT References: <9449@jarthur.Claremont.EDU> Organization: Clemson University, Clemson, SC Lines: 36