Larry Osterman's WebLog

Confessions of an Old Fogey
Blog - Title

The purpose of an operating system, redux

The purpose of an operating system, redux

  • Comments 46
Something changed in the stress mix last week, and I've been swamped with stress failures, that's what caused the lack of posts last week.  But I've spent a fair amount of time while driving into work thinking about my last post (on the purpose of an operating system).  I've not actually read most of the comments (I've really been busy), so if I'm echoing comments made on the other post, forgive me for poaching your ideas, it really is a coincidence.  I'm a little surprised it's taken me this long to have this idea gel in it's current form - it's blindingly obvious, but I never put the pieces together in this way before.

I still stand by my original premise.  The purpose of an operating system is to shield the application from the hardware.

But the thing that you purchase in the store (or buy with your new computer, or download from RedHat) ISN'T an operating system.  It's a platform.  

And a platform does more than just isolate the user from the hardware, a platform is something on which you build applications.  This is a key distinction that it seems many people have a really hard time making.

Let me take Linux as an example, even though I'm far from a Linux expert.  The Linux operating system exists to isolate the user from the hardware.  It hosts drivers and presents a fundamental API layer on which to build systems.  But someone who receiving a machine with just copy of Linux would be rather upset, because it's not really very useful.  What makes Linux useful is that it's a platform on which to build applications.  In the FOSS community, the "platform" is called a "distribution", it contains a set of tools (Apache, Perl, etc).  Those tools make up the platform on which you write applications.  Btw, RMS has been saying this for years now in insisting that people call the "OS" known as Linux "GNU/Linux" - he's explicitly making the differentiation between Linux the operating system and GNU/Linux the platform.

 

Similarly, Windows isn't an operating system.  Windows is a platform.  Nowadays, the Windows platform runs on the NT operating system, in previous years, the Windows platform ran on the Windows VXD operating system, and before that it ran on the MS-DOS operating system.  OSX is also a platform, it runs on an operating system that is (I believe) a derivative of the Mach OS, running with a BSD personality layer (I may be wrong on this, I'm not enough of an OSX expert to know the subtleties of its implementation).

For convenience sake, we refer to the Windows platform as an operating system, just like people refer to OSX or Linux as operating systems, it's simply easier to present it that way to users. 

If you make the paradigm shift to considering the "operating system" as an operating system plus a development platform, it makes a heck of a lot more sense why the platform contains things like an HTML renderer, a sockets layer, a TCP/IP stack, an HTTP server, a directory service, a network filesystem, etc.  These aren't things that shield an application from the hardware, but they ARE things that provide value to applications that want to run on that platform. 

As an easy example, consider an application like the game Neverwinter Nights.  Because the developers of Neverwinter Knights knew that there was an HTML renderer built-into the platform, it meant that they could leverage that renderer in their launcher application (or their update application, I forget which of them used the MSHTML control).  Because they knew that the platform contained a multimedia stack with WAV file rendering, they didn't have to build in a WAV renderer into the game.  Because they knew the platform had support built-in for video rendering, they didn't have to include a video renderer.  They might have had to include a video codec along with their application, because the platform didn't necessarily include that, but it's orders of magnitude easier to write (or license) a video codec than it is to write or license an entire multimedia pipeline.

A rich platform means that applications can depend on that platform, which, in turn makes the platform more attractive to the applications.  Everything that the platform does that an application doesn't have to do is one less thing an application needs to worry about.  Of course, the challenge when enhancing the platform is to ensure that the platform provides the right level of capabilities, and the right ease of use for those capabilities, otherwise applications won't use the platform's implementation, but will chose to roll their own.

  • IMHO what you call an operating system is the kernel. I.e. the kernel is responsible for shielding the hardware from the userland applications. The operating system is the kernel + all the tools needed to make the system usable.
    So Linux is a kernel and GNU/Linux is an operating system which uses the Linux kernel and the GNU tools.
  • >>I still stand by my original premise.  The purpose of an operating system is to shield the application from the hardware.<<

    I don't think that tells the whole story at all. I would say something more like "the purpose of an operating system is to provide abstract models of the hardware that are as useful as and general as possible."

    For example, to access a sector on disk without and OS, I would need to know the details of the disk controller, do INs and OUTs to the controller out the gazoo, and so on. By your description, what an OS should then do is, for example, provide a simple call by which I could access sector N on the disk. That is really all that is required to shield the application from the hardware.

    But the OS should, and does, do something better. It invents an abstraction called "files" and another abstraction called "(sub)directories,"   which is quite different from accessing sectors. The abstraction is a good one in that, with this abstraction, but with the ability to directly access sectors not provided, the abstraction is good enough that it is really all I need for virtually anything I might want to do, and the inability to access sectors directly is no significant loss.

    For each peice of hardware, there is not only the job of isolating the apps from the "details" of how it is controlled and accessed, there is also the job of inventing the abstract model by which the device will be seen by applications. Inventing the abstract model is quite difficult, because a major job in inventing the abstract model is to "predict the future" to some extent, so the the abstract model not only handles todays devices, but, if well done, the model will be able to serve without change in handling future devices.

    Doing all of this, I submit, is the job of any basic OS, not the job of some larger entity we call a platform.
  • Larry,

    Your comparison with Linux (indeed any *ix) has one issue; the fact that in Windows, unlike its open-source counterpart, you can't seperate, replace, improve or otherwise completly remove ANY part of it.

    It's not only a technical issue, remember the DOJ anti-trust case... this was a big deal, and still is. It's called CHOICE.

    Everything you said is true, only it's true in the sense of marketing, not in terms of flexibility, extensibility or choice.

    So while you (and if you haven't noticed, ALL of MS management AND, coincidentialy, the legal team too) sound like making a logical statement to the user's benefit, it really is an advertisment for why Windows needs all that, and what MS is doing for the customers.

    Granted, it's useful in (possibly) many cases, but not admitting its drawbacks, is an ommision that can't be easly overlooked, especially if the statement is made by someone as knowledgable as you. You know better!

    -Ash
  • Ashod, I'm talking about the terminology.  Nothing more, nothing less.  FOSS is irrelevant to the discussion, the terms I use apply to FOSS and CSS, so any discussion about replacing/improving/whatever is out of scope IMHO.
  • Wow, everyone's disagreeing with me. :)

    Let me restate my point slightly.

    Every developer-hour Microsoft spends on the development platform (HTML renderer, video renderer, etc.) is a developer-hour taken away from the core OS (WinFS, anyone?)

    Development platforms are a fundamental need and I don't dispute that.  But is licensing another HTML renderer such a bad thing?
  • I would agree, that Windows is a platform, not just an OS. But the problem is that platform is not a word from user's dictionary. Platform is something, what developer needs. Why should I, as a user, pay for a platform? Maybe I like Firefox. Why should I invest into IE development? Why should I pay out huge investment into platform, if I just want OS to make my favorite apps running? We can say that platform is free, included into OS price, but it is a some sort of commercial lie, which everyone is used to understand.

    So here we have a conflict, which is quite visible now. There are obviously two target groups, but MS do not have an interest to target them separately.
  • Maurits, but now you're assuming that a developer who works on the developement platform (HTML renderer, video renderer, etc) is completely replaceable with one who works on the core OS, which is patently false. Someone who is able to write a great HTML renderer isn't nessecarily going to be able to write a great thread scheduling algorithm or file system driver (or vice versa).

    So just because there are people at Microsoft working on IE7 doesn't mean those same people could instead be making the release of WinFS any quicker.
  • Larry,

    I agree with the terminology point you are making. I think few people would disagree. In fact, I'm saying that what you are saying is something that has been advertised many times in many forms and shapes.

    What I disagree with (and what I wrote to voice out) is the reasoning you give for the need to have a platform.

    "These aren't things that shield an application from the hardware, but they ARE things that provide value to applications that want to run on that platform."

    And...

    "Everything that the platform does that an application doesn't have to do is one less thing an application needs to worry about."

    These are marketing statements more than anything. And the value of something is ONLY in the eye of the beholder. As others have noted on this post, sometimes we have to roll our own exactly because the existing OS-based one has some issue. In fact, your last statement also means that everything that the platfrom does, takes away some flexibility from the application.

    And no, I'm not taking issue because you compared FOSS with MS Windows, but because you argued that a platform is a must-have and can't do without. While doing that you ignored other factors, such as flexibility and user choice, which I think passes for stepping into marketing turf.

    Keep up the thought-provoking posts though!
    -Ash
  • "While doing that you ignored other factors, such as flexibility and user choice, which I think passes for stepping into marketing turf." -Ash

    How do they ignore flexibility and user choice. A platform enables flexibility and choice. Without it a developer would have to recreate everything over and over and over again. Why reinvent the wheel?

    If a developer needs to write their own code to do what they want, they will and it will run great. Most of the time they don't need to do that so they save alot of time by using existing APIs and/or extending them.

    User choice has never been a problem. Just about every component in Windows has a alternate application I can use and Windows runs it just fine.
  • << Every developer-hour Microsoft spends on the development platform (HTML renderer, video renderer, etc.) is a developer-hour taken away from the core OS (WinFS, anyone?) >>

    While I agree that Windows often provides components that don't necessarily meet a developer's needs, you bring up a video renderer as a deviation from the core OS.

    I happen to know for a fact that writing a video renderer from scratch is damn hard.  I know this because we've partially done it by implementing a custom allocator-presentor for the VMR7 (a core "platform" component of Windows XP), and it is definitely not for the faint of heart.  Writing an entire renderer, from scratch, would probably entail man-years of development time.  Writing a video renderer as flexible as the VMR9, which has built-in hardware acceleration with many graphics cards and completely masks all of the idiosyncracies of their media support is, quite frankly, not even a possibility for the majority of companies out there.

    I could spend two years writing a video renderer that contains a subset of features that the VMR9 contains and dealing with hardware woes galore, or I could spend two years actually making a product.  I know people who have spent the better part of a year writing their own video renderer, and even then, they generally base it on GDI or DD7--again, two "platform" components offered by MSFT.

    Likewise, one minor error on Larry's part is marginalizing the amount of effort required to write a video codec.  Creating a modern block-based temporal codec like MPEG4 or WMV9 is a very, very substantial undertaking.  I see people requesting how to write their own codec on win32.programmer.directx.video all the time, and the stock response is "forget about it--you'll write something that doesn't work as well as WMV9/MPEG4/H.264, and by the time you're done, you'll be out of business anyways."  It is not practical for the vast majority of developers to consider writing their own "video codec" (e.g. WMV9), let alone their own video processing sub-system (e.g. DirectShow) because the development effort required is ridiculously prohibitive.

    So while I agree with you that "every developer-hour Microsoft spends on the development platform is a developer-hour taken away from the core OS", you also have to conceed the fact that every developer-hour I spend writing a component that MSFT has a pre-canned solution for is an hour taken from *my* end product.  And, in the instance of components like the VMRs or the WM codecs, it generally isn't even a possibility.
  • Monday, April 24, 2006 2:10 AM by Troy Campbell
    > Why reinvent the wheel?

    Hey!  That used to be one of my Usenet signatures!

    More precisely:
    Why are programmers criticised for reinventing the wheel,
    when car manufacturers are praised for it?
  • PingBack from http://www.imbrandon.com/2007.10.13/why-all-the-name-calling.html

  • PingBack from http://www.linuxindex.com/2007/10/13/brandon-holtsclaw-why-all-the-name-calling/

  • PingBack from http://www.linuxindex.com/2007/10/14/brandon-holtsclaw-why-all-the-name-calling-2/

  • PingBack from http://besteyecreamsite.info/story.php?id=1156

Page 3 of 4 (46 items) 1234