I remember when the first 286 Window support first came out. The big complaint was not a true multi-tasking OS but interrupt driven. The full blown capacity of the processor is it's ability to jump to one task after another. If you look at the tasks in the GDT:

00000000 00 00 00 00 00 00 00 00-FF FF 00 00 00 9B CF 00 ................
00000010 FF FF 00 00 00 93 FF 00-FF FF 00 00 00 FB CF 00 ................
00000020 FF FF 00 00 00 F3 CF 00-AB 20 00 20 04 8B 00 80 ......... . ....
00000030 01 00 00 F0 DF 93 C0 FF-FF 0F 00 00 00 F3 40 00 ..............@.
00000040 FF FF 00 04 00 F2 00 00-00 00 00 00 00 00 00 00 ................
00000050 68 00 40 00 54 89 00 80-68 00 A8 00 54 89 00 80 h.@.T...h...T...
00000060 FF FF 20 2F 02 93 00 00-FF 3F 00 80 0B 92 00 00 .. /.....?......
00000070 FF 03 00 70 FF 92 00 FF-FF FF 00 00 40 9A 00 80 ...p........@...
00000080 FF FF 00 00 40 92 00 80-00 00 00 00 00 92 00 00 ....@...........
00000090 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
000000A0 68 00 88 E4 08 89 00 82-00 00 00 00 00 00 00 00 h...............

(89 type feild or 8B for "busy" TSS.)

We see only 4 TSS's at all times. If you open a new program you never see any change to the GDT. That means we ask Windows to run our program as an extension of windows and is not true multi-tasking but rather a timed jump table of a sorts. In an effort to keep everything in secrecy untead of taking advatage of true compitition this system is clumsy and awkward and has severely short changed Intel in their phenomineal work into micro-processor architecture. Oh well what do expect from a world that would pay 350 dollars for say W2K prof. when you can download Linux for free.
Posted on 2003-12-29 19:59:42 by mrgone
Yes only Linux and Menuet AFAIK use the Hardware TSS based task switching implemented by INTEL CPU, however what windows does is done for speed.

Aka Windows use a Stack based task switching that is much faster than TSS based one (ironically isnt it?)

Their Multi tasking is just as real as Linux on a single CPU.
Do not praise Linux/Unix too much .

Windows did copied Unix design pretty much and have just made it faster/niceier ... when Linux will become as nice as Windows it will be just as unstable and much slower.

The unstable OS comes from the movement of critical code into ring3 area and not using segmentation, and alowing drivers to load into ring0 at runtime... not from the method used to make prremptive multitasking.

Of course preemptive multitasking, OOP, event driven programming ==> all this add to slowing down and making OS unstable but that is a general issue.

All prremptive multitasking on a single CPU is slow and is a joke,
but i agree a nice one :)

On 2+CPU it is just more and more slow :grin: but no joke anymore... hmm unles the 2+CPU's have to share access to the same RAM :badgrin:
Posted on 2003-12-29 21:15:14 by BogdanOntanu
Yeah I forgot about it being slower. You are right. But isn't the isolation so much better and with processor speeds being what they are today it should be undetectable. To the user that is. Who would have thought that digital signals would be capable of performing at UHF. The best strip line analysis that I have ever seen was in the appendex of the IAP386 manual. Intel has some very sharp engineers.
Posted on 2003-12-29 21:46:12 by mrgone
Well the isolation is not better with or without TSS based task switch. The task switch should have been done in ring0 code (and usually is) so no matter how it is done (software or TSS) it is always safe.

Programming unde prremptive multitasking environments is not safe :tongue:

The ironical part is that TSS that is hadware implemented into CPU is actually slower that the software based solution, great engineers there :grin:

To be perfectly unbreakable safe everybody should have used segmentation :grin:

This way NOBODY could have EVER corupted another address space whatsoever ... but again UNIX and Windows use paging that again has some security pitfalls ...ease of use for programmers comes here into account ,

BTW in using paging versus segmentation they did treat us all like we are all using ASM :grin: and not VC advanced compilers that could easyly keep trach of segments for us :tongue: again inteligent way to go,

I am sure they wanted to give us ASM a boost....or...wait... didnt they learned in some University that still used 60's Unix machines that ONLY have paging :o

The unsafe stuff in both Windows and Linux is from the sad fact that much critical code like painting on screen and or dealing with keyboard/mouse input is done in the ring3 code ... again for speed....because the transition from ring3 to ring0 at each system call is way too slow.... again well thinking :P

I mean it is not much that you can do with a CPU if you do not see anything on screen and / or can not use mouse/keyboard isn't it?

Also loading code at startup and or later (drivers) into the ring0 kernel address space make room for unforgetable errors :p

Nobody can live with rebuilding kernel for a new drives for safety can they?
At least Linux abondoned this sfatey in favour of speed/ease of use lately didnt they?

IMHO they will abandon more an more as the walk the way of capitalismus... the only thing that might survive -- i hope-- will be freeware :grin:
Posted on 2003-12-29 22:05:17 by BogdanOntanu
Recompiling kernel to add new drivers? - yuck.

sad fact that much critical code like painting on screen and or dealing with keyboard/mouse input is done in the ring3 code

Why run something in ring0 if it can run ring3? R3 is safer and somewhat easier to debug, plus you can avoid ring switching...

You're saying dynamic driver loading is bad and gives problems? Heh.
Posted on 2003-12-29 22:59:17 by f0dder
You hate low level don't you? Yeah BogDan I thought they should have taken advantage of segmentation for full blown protection mechanism. Pretty slick coding in XP page directory though. Looks like encryption. Deceiptfully well done.
Posted on 2003-12-30 19:17:19 by mrgone
no I don't mrgone, I just think it's damn silly when not necessary, and especially when people advocating it are doing it for totally wrong reasons and don't have a clue. I've done my share of systems programming, but these days I don't do it without reason.
Posted on 2003-12-31 12:26:21 by f0dder
I guess it's individual preference. The miriad of API fuctions and structs tend to drop off into a deep hole the way I see it. I'm an old electronic designer and builder. Ham radio licensed over 30 years. I understand hardware and just could never be satisfied to hand shake with Windows all the time. If they spoke more of a hardware language than I might. It seems that "C" was the big deal during it's developement which is just to me a high faluten form of PC street talk. In other words "Speak English". You now , memory,I/O... after all that's all a computer is with a processor(brain) to manage everything. I'm a KISS (keep it simple stupid) kind of guy. The world of electronics is complex enough without Microsoft making us learn there own unique laguage. So happens I would only be interested in hooking up new devices when a good idea comes to me. I don't want to study the MS thesaurus.
Posted on 2003-12-31 22:32:03 by mrgone
My mouth always gets me in trouble. May need to make a partial retraction here. I noticed that when I got a processId and fed it to PsLookupProcessByProcessID then assigned the user mode program Ke386IoSetAccessProcess Windows loaded a new TSS in same slot in GDT. This TSS had alot more parameters:

00000000 ED 42 00 A5 E0 2D AE BE-10 00 58 83 60 34 00 A1 .B...-....X.`4..
00000010 A4 31 46 00 8B 40 58 83-60 38 00 A1 00 90 03 00 .1F..@X.`8......
00000020 8B 40 58 8D 48 38 51 83-C0 34 50 6A 13 8D 45 EC .@X.H8Q..4Pj..E.
00000030 50 8D 85 CC FE FF FF 50-FF 75 0C FF 75 08 E8 32 P......P.u..u..2
00000040 63 FF FF 83 7D F8 00 74-06 8B 45 18 80 20 00 8B c...}..t..E.. ..
00000050 45 F8 5F 5E 5B C9 C2 1C-00 55 8B EC 51 56 8D 45 E._^[....U..QV.E
00000060 00 00 A1 70 00 00 AC 20-04 00 00 18 18 00 00 00 ...p... ........
00000070 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................
00000080 00 00 00 00 00 00 00 00-FF FF FF FF FF FF FF FF ................
00000090 FF FF FF FF FF FF FC FF-FF FF FF FF FF FF FF FF ................

Interesting thing is offset 66h still points outside of TSS unstead of pointing to I/O bitmap at offset 88h but the user mode still does have I/O access. Go figure. Anyway if any is wondering how to do this, the complete write up is in Four-F's KMD tutorial. An absolutely stunning peice of work!
Posted on 2004-01-02 19:43:29 by mrgone