Page 1 of 2

Question for Experts !

Posted: Mon Jun 02, 2008 12:13 pm
by mohitbs
I was wondering that when a new chip is introduced (16bit/32bit/64bit…) (single core/dual core/quad core), what fraction of an operating system has to be rewritten ?

Doesn’t the core functionality, and user interface remain pretty much the same ?

(addition of an additional feature is of course logical).


Theoretically, can a well written os have longevity ?

From what I understand, Win98, Me, 2000, XP are all NT based.

What (other than profits) drives a company to ‘create’ another os that is so drastically different, that huge man-hours are required (to produce it), and the user is forced to migrate ?


Let us keep the device drivers out of this. A third party is responsible for that. (that doesn’t mean that the third parties don’t experience pressure to create compatible drivers).

Re: Question for Experts !

Posted: Mon Jun 02, 2008 1:01 pm
by suthers
To change from 16/32/64 bit you need to change re-assemble the instructions to the new length. Though there are differences between memory managements etc... (mainly between 16 and 32), though most processors should be backwards compatible. For multiple procs/cores you need to implement SMP. Though again you a dual core processor can run a non SMP OS, though it would only run on one core...
And yes an OS can be built with inbuilt SMP, that detects the number of cores and scales the number of threads it uses to spread the work between all the cores/procs.
This is possible for new instruction sets/instruction lengths by building in multiple kernels with different instruction lengths and code with inbuilt future instruction inbuilt, witch directs program flow to jmp over it to alternative code if the proc doesn't support it.
Jules

Re: Question for Experts !

Posted: Mon Jun 02, 2008 3:55 pm
by Fusion
mohitbs wrote:From what I understand, Win98, Me, 2000, XP are all NT based.
Windows 98/Me are DOS/9x based not NT based, Windows NT/2000/XP/Vista are NT based.

Re: Question for Experts !

Posted: Mon Jun 02, 2008 4:04 pm
by suthers
Fusion wrote:
mohitbs wrote:From what I understand, Win98, Me, 2000, XP are all NT based.
Windows 98/Me are DOS/9x based not NT based, Windows NT/2000/XP/Vista are NT based.
Didn't know that...
Jules

Posted: Mon Jun 02, 2008 5:53 pm
by bewing
There are only a few designs out there for PCs, currently. Let's say there are three. Single Processor, SMP, and NUMA.
You can write your OS to support one, two, or all 3 designs.
If you limit your OS to just one design, it will probably become obsolete.
Single Processor systems are much easier to program for -- but they will almost certainly become obsolete very soon.
If you put enough effort into creating your OS, so that it supports SMP and NUMA also -- then you probably will not have to rewrite anything in your OS for at least a decade.

Re: Question for Experts !

Posted: Mon Jun 02, 2008 6:42 pm
by Brendan
Hi,
mohitbs wrote:I was wondering that when a new chip is introduced (16bit/32bit/64bit…) (single core/dual core/quad core), what fraction of an operating system has to be rewritten ?
Mostly, backward compatibility means the OS never needs to be changed when a new CPU is released (e.g. a new computer will still run "prehistoric" DOS) - it's just a matter of being able to take advantage of new features and/or optimizing.

For example, when the original Pentium 4 was released it wasn't very different (from the OS's perspective) from the Pentium III. It had different performance characteristics (instruction latencies, etc) and had SSE2, but it didn't really matter - the OS developer can wait for compilers to optimize for Pentium 4 before worrying about the different performance characteristics (if they bothered) and SSE2 doesn't need any changes to support if you already support SSE.

The next thing was hyper-threading which could be ignored too, but an OS developer could also optimize schedulers, spinlocks, etc to get better performance from hyper-threading. There wasn't any real rush as it wasn't too different from plain SMP. The same can be said for multi-core and NUMA (they're also close enough to SMP that any changes are for optimization/performance reasons only).

In contrast, long mode was a major change - new/updated toolchain, different paging structures, different protection rules, no v86, etc. I'd assume the compilers took care of most of it, except for the new paging structures and lack of v86 (as most OSs don't use segmentation anyway). The differences in paging structures wouldn't have been too hard to adapt to, but "no v86" can be complicated (e.g. build a full "16-bit emulator" if you want backward compatibility done right). Another thing to consider is some sort of compatibility mode so that existing 32-bit applications still work (including libraries and APIs).

@Bewing: The next change I'm expecting is new paging structures for long mode, so we can have true 64-bit virtual address spaces (currently they're limited to 48-bit). Not because it's needed, but because it'd be good for CPU manufacturer's marketing hype (although it'd be good to reduce the number of levels in the paging structures at the same time - too much indirection isn't so good for performance and RAM footprint/overhead isn't such a big factor anymore). Note: Previously I was expecting changes to 8-bit APIC IDs so we can have more than 255 CPUs in a computer, but that's happened already... ;)


Cheers,

Brendan

Posted: Mon Jun 02, 2008 7:47 pm
by piranha
IIRC, XP was a failed branch of windows, as they tried to build off of it, but they gave up and used 2000 as a base (or something).

-JL

Win98 is not NT based

Posted: Tue Jun 03, 2008 1:35 am
by DeletedAccount
Slight correction Win98 is not NT based :lol: .

Posted: Tue Jun 03, 2008 4:28 am
by jal
piranha wrote:IIRC, XP was a failed branch of windows, as they tried to build off of it, but they gave up and used 2000 as a base (or something).
YDNRC. XP is based on 2000, and Vista on XP. And guess what? Win7 is based on Vista.


JAL

Re: Question for Experts !

Posted: Tue Jun 03, 2008 4:29 am
by jal
Brendan wrote:but "no v86" can be complicated (e.g. build a full "16-bit emulator" if you want backward compatibility done right).
Or use virtualization, but that's hardly less complicated :).


JAL

Posted: Tue Jun 03, 2008 9:12 am
by piranha
YDNRC. XP is based on 2000, and Vista on XP. And guess what? Win7 is based on Vista.
Well, our sources seem to disagree :wink:

-JL

Posted: Tue Jun 03, 2008 9:15 am
by Colonel Kernel
piranha wrote:IIRC, XP was a failed branch of windows, as they tried to build off of it, but they gave up and used 2000 as a base (or something).

-JL
I think you mean that Vista started out as a branch of XP, but when they did the "Longhorn reset" (removing WinFS etc.) they moved over to a branch based off Windows Server 2003 instead. It's all the NT kernel though. The internal details of MS' change management system really don't matter to the end users anyway...

Posted: Tue Jun 03, 2008 10:14 am
by piranha
Yah, I think thats it. It's been a while since I really cared much.

-JL

Posted: Tue Jun 03, 2008 11:06 am
by einsteinjunior
Actually that depends on the systems programming architecture.
For example,protected mode does not really exist on 64 bit intel processor architecture.That means a lot has to be changed in the operating system architecture.
Apart from that some very few modifications are done such as choosing
a compiler to generate code for the target machine.
Thats all what is needed.

Posted: Thu Jun 12, 2008 7:42 am
by mystran
Colonel Kernel wrote:
piranha wrote:IIRC, XP was a failed branch of windows, as they tried to build off of it, but they gave up and used 2000 as a base (or something).

-JL
I think you mean that Vista started out as a branch of XP, but when they did the "Longhorn reset" (removing WinFS etc.) they moved over to a branch based off Windows Server 2003 instead. It's all the NT kernel though. The internal details of MS' change management system really don't matter to the end users anyway...
Well isn't WS2k3 essentially XP? Just like WS2k8 is essentially Vista (or well, below Microsoft naming hype I've got Windows 6.0.6000 desktop and Windows 6.0.6001 server in here).

The so called "Windows 2000" was "5.0" and XP was "5.1" and I don't have a W2k3 box right now to check but I think it also said "5.1"? Maybe I remember wrong and W2k3 actually had something that XP didn't but it's really just a naming mess and I bet the desktop and server versions actually come from mostly the same code tree anyway.

There was desktop and server versions of the good old 4.0 as well. For 5.0 they decided calling it 2000 by year would be better and then they got crazy and decided that the desktop versions had to be given some more fancy names?!?

I got a Vista desktop and a W2k8 server here, and while the Vista desktop got accelerated Aero windows and the W2k8 server has Windows classic theme only, they essentially work the same. Prepackaged software and default config is slightly different with Vista having desktop stuff and the server having all sorts of server components.