19

Intel IA-32 architecture a.k.a. x86 offers hardware task switching capabilities since 80386. It includes TR (task register), memory segmentation features such as Task State Segment, task gates, call gates etc. However, this capability is not used in modern OSes which perform context management differently (for numerous reasons). Largely, the hardware task switching is not favored by any modern CPU architecture, not just x86. Within modern x86 OSes, only rudimentary TSS usage (that could not be avoided) can be found.

I am looking for information about which historical or maybe modern operating systems, both small and large, niche or general purpose, use hardware task switching. I am aware that Linux kernel up to 1.3 used it. I could not found reliable information about the MS DOS and Windows families, but I suspect some early versions of them are bound to use TSS at its fullest.

6
  • 4
    Actually, there was task switching support in the 80286, which was partially developed with input from software vendors for early iterations of OS/2.
    – user12
    Commented Feb 13, 2019 at 19:13
  • Hw task switch was removed in IA-32e (x64). It faults now if you try to call/jmp a task gate/TSS descriptor while in IA-32e. Commented Feb 13, 2019 at 21:04
  • 1
    Even OS/2 2.0 eschewed the 386’s TSS as far as possible and only used one. Commented Feb 13, 2019 at 21:12
  • 1
    ... and DOS didn’t use the TSS at all (what with it being single-tasking and designed for the 8086). Commented Feb 13, 2019 at 21:18
  • 3
    Also relevant: Evolution of the x86 context switch in Linux, covering Linux’s use of multiple TSSs and hardware task switching up to 2.2, then software task switching still with multiple TSSs, then software task switching with a single TSS. Commented Feb 28, 2019 at 17:42

2 Answers 2

10

iRMX III is a real-time operating system for Intel 80386 and later processors, originally developed by Intel and now maintained by tenAsys. A quick look at the System Call Reference manual reveals that it uses call gates.

4
  • 2
    I haven't looked at the reference but what has a call gate to do with the task switch? You can use a TSS in a call gate descriptor, sure, but that's not mandatory. Does the document say you have to call a TSS? Commented Feb 13, 2019 at 20:50
  • A call gate is part of the family of functionality being asked about. I'm not familiar with iRMX beyond skimming manuals today, but the same manual mentions Task State Segments in object files. Intel would expect their own OSes to use their own hardware features. Commented Feb 13, 2019 at 23:07
  • @JohnDallman "Intel would expect their own OSes to use their own hardware features." - good point! Commented Feb 14, 2019 at 7:10
  • 1
    The OP is asking about the hardware task switching, it mentioned call gates just to give a bit of context. Call gates are orthogonal to task switching, an answer based on call gates presence is therefore not meaningful. The presence of TSS in object files (whatever that actually means) is potentially a stronger evidence than the presence of call gates. Your last point, while suggestive, is also meaningless. ICC (Intel's compiler) don't use FP or XMM, yet both are Intel's own hardware features. It's likely that iRMX is using hw TS anyway, I think you should quote the right section of the docs Commented Feb 14, 2019 at 9:23
6

MMURTL by Richard Burgess, was the subject of a book that Sams published as: Developing your own 32-bit Operating System.

MMURTL makes no attempt at portability, instead making direct (and heavy) use of the 386's hardware support for tasks, task switching, and pretty much everything else. The licensing conditions for either/both the book and code are fairly liberal:

As you may know, the source code to MMURTL itself if in the public domain. I did this to allow you to do anything you desire with it. Even build the "Son of MMURTL" - or daughter of MMURTL - that's OK, too. The rights to the book are mine and no longer belong to the original (or any) publisher. You are welcome to a free copy (on me) and you may also post whole copies where you like (when needed) and give them away. Please don't post sections of the book with providing a reference back to the book itself (here) mainly because I hate finding things where the source is not identified or available. That is all I ask of you (and it isn't much). Use it all in good heath and most of all, enjoy yourself. And don't forget to spend time with your family! It is important that you do.(or at least communicate if away from them).

If you're looking for examples of commercial use, this probably isn't very interesting (though it has apparently seen some commercial use). It's probably a lot more interesting for somebody who wants to write code making use of that part of the hardware.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .