Leveling the Playing Field
Posted: Mon Dec 14, 2009 10:16 pm
As of November 2009:
91.26% internet clients use Windows.
5.66% internet clients use Macintosh.
1% use Linux.
And only 1% use something else. This may be BSD, and other *nix OSes.
Thus pretty much all computer users either use Windows, Macintosh, or Linux.
But the question is - why? With such a large community here, what is wrong? Why isn't Windows getting much competition? It's more expensive and slower than alternatives, right?
The problem is that Windows, Macintosh, AND Linux are all using anti-competitive strategy.
All modern books have copyrights on them. Just because you have one book doesn't mean you can make copies and distribute it to your friends.
Operating Systems also have copyrights on them. Just because you have a CD of Windows doesn't mean you can copy it and give it to your friends.
However, in the literature world, one book does not rule them all. New books are published all the time by different authors and may sometimes sell well for some period of time.
In the computer world, extremely few OSs dominate over everyone. New usable OSs are not published and sold.
So, what happened? Why are books easily written and OSs aren't?
The reason is lack of information. OS writers don't know how to write some parts of their code!
In particular, hardware data sheets are not free to come by. Either you have to agree to some non-disclosure statement, or you have to pay a huge sum of money, or the hardware company bluntly says "No"...
These hardware companies signed a contract with Microsoft stating that they will not give out the specifications to anyone but Microsoft.
The fundamental parts of an operating system are denied to independent operating system developers. Hence most of us are usually near the "Stage 1" of the OS development, even after years of learning and practicing the art.
This scheme that Microsoft and Apple have up is called "Exclusive dealing" ..a type of "Barrier to entry". Monopolies strive on this kind of stuff because it stops people like you from reaching up to their level.
Believe it or not, Microsoft and Apple are not the only ones being anticompetitive. Although Linux is free and open source, the details inner workings of Linux are rather obscure, even for people working on it.
Ever try to read through the source code of Linux? It reminds me of trying to fix a bug in Windows by calling up and chatting for hours on the phone with Microsoft's offshored customer service, only to end up having to reinstall the whole operating system.
Linux is a real beast - without good directions and useful information, one can easily be lost in its code.
When trying to read the assembly code of a C++ compiled "Hello World" problem, most people get lost. The program is not encrypted or hidden.. it just becomes very complicated to understand.
The same applies with Linux ASM/C/C++ code. Even with all of the code visible in full sight, having no encryption or hiding schemes, Linux is just way too complicated to understand.
Because of its code complexity, understanding how Linux handles hardware is very similar to understanding how Windows or Macintosh handles hardware - It's easier to reverse engineer the hardware than to read the code.
Because of this lack of useful information for operating system development, OS programmers simply get lost or stay near the beginner level of their development.
Hence Windows, Macintosh, and Linux dominate.
In order to get around this anticompetitive system, OS developers have to be granted easy access to the fundamentals. OS developers must have a predefined structure where all hardware is accessible as an API from stage 1 of development.
This includes the simple - switching to 32 and 64 bits, communication with mouse and keyboard, printing pictures in color, reading from and writing to a DVD.
But it also includes the hard - Interfacing a broadcom BCM4312 wireless card, using any 3d acceleration parallel processing GPU tricks available on a modern video card, and interfacing with a wireless USB webcam.
Basically, all chip specific hardware control must be abstracted from the OS programmer.
Allowing for a plug and play usb joystick should be extremely trivial for the OS programmer.
These are fundamentals that should be present in every Operating System without question.
There should also be libraries that handle the basic protocols and file formats - Interfacing TCP/UDP, the file format of a JPEG, the file format of a TTF.
The OS programmer should have easy access to file formats and protocols - no thinking should be involved here.
By having such a template system from stage 1 of operating system development, the OS programmer has a level playing field. No longer does one have to spend months trying reading through old partial manuals about interfacing the USB. No longer will one have to spend days attempting to experiment with some piece of hardware to figure out how it works.
Instead the programmer will focus on that which makes operating systems stand out:
Will it be graphics or console based?
What level of internet/user security do you want to place?
What will your API be?
How user friendly will your OS be?
Should some programs be hard coded into the kernel?
How fancy should the graphics be?
What programs should come with the OS?
etc.
By not having to think about the hardware, protocols, or file formats OS programmers will easily be able to compete with Windows, Macintosh, and Linux.
Ordinary users will have a much better selection of high speed, low cost OSs. High performance independent OSs will be ranging from completely home based graphical eye candy user friendly, to high security industry standard database servers.
Probably most of these diverse operating systems will be written by people like you.
So, how to implement such an idea? It's actually not as hard as it seems.
An organization of well minded individuals should form together and work as a team to achieve the following steps:
1. Copy the Minix3 code from here.
Minix3 in particular is nice because of how it handles hardware. The amount of hardware it has is rather limited (it has drivers for all companies that show their data sheets!), however Minix3 has a whole powerful system for handling the drivers. If something goes wrong with the driver, the OS doesn't freeze.. the driver just gets reset, and you're back in business. This is really good for us because we don't care about the drivers - as long as they work.
Minix has been one of the main pioneers of Operating System development. It has pretty much everything you need in the most basic operating system - Multitasking, transferring to 32-bits. It works on a PC. It is not portable because its lack of hardware implementation of other systems. This can be added later.
Minix3 is written with a BSD license, meaning anybody can copy the code without being forced into making their code open source.
Most important: Because of how Minix is built (small kernel) it is much more easy to understand and thus modify it than any other advanced Operating System.
The goal is to make a template system for any operating system. The smaller the original kernel, the easier it will be to make it into a template.
2. Figure out how to compile it from the code and run it in QEmu or Bochs.
Make sure you can compile it from your system. You will probably have to rename some of the commands in the Makefiles to get it to work.
3. Get rid of everything *nix!
To transform this code into a usable template structure, one must first remove everything having to do with *nix from it.
A good way to start this is by removing any code that has to do with touching the directories. There should be no such thing as "/root/" or "/tmp/" or even "/"
Using the new template one should be able to write up an advanced DOS with the usual "C:\" in it.
Remove any command line things that Minix has ("ls", "mkdir", "cd", etc) ..completely get rid of the shell - remember, an OS developer can choose not to have any console interaction at all.
Note that for all this time, you must keep Minix's ability to run applications, and use any drivers. Make sure to keep any protocols or file formats as libraries. If possible, the multitasking ability should be shoved into a library that can be turned on and off. (One may want to implement a limited form of non-preemptive multitasking).
4. Reflection, documentation.
Now if everything has been done properly, there should be about three things - the kernel, the hardware drivers, and extra useful protocol libraries.
In the kernel, there should be some driver initialization present... and afterwards, nothing. (Just freeze). It is fuzzy there how much control the programmer should have over the driver initialization. It seems that all of it should be controlled.
All controls that the user has should be extremely well documented in HTML or PDF form. (Regular text is boring to read.)
In some cases, extra functions should be added as a form of an API, so that there was an abstraction of the hardware.
All of these functions should be well explained in the HTML documentation. It is assumed that the APIs can be called from the "main area" within the kernel, however this idea can be modified so that the APIs can be called elsewhere.
5. Build a proof-of-concept example operating system
Using as much of the API as possible, build a small project OS. Preferably something opposite of Linux, but not something that takes too much time - Make an extremely simple Windows. Have it be able to run simple programs that use an extremely simple system API set. (createwindow, printmessage, waitkeypress, closewindow for example) Here one would realize what parts of the API are missing in order to accommodate any type of operating system.
Please note that here "API" was used in two different forms. One is where the OS programmer uses an API, the other is when the OS programmer supplies an API for applications. Do not confuse the two.
To continue on with the project, you are free to continue developing this sister project and thus enhancing the OS API even further.
6. Acquire new hardware drivers
Minix3 starts out with a nice supply of "open" drivers. It basically has all the capabilities of the bochs and qemu emulators, including monitor and networking. However after a while, that is not going to be enough. Luckily, Minix3's driver structure is relatively similar to Linux. Linux has most of the hardware needed. If you can figure out how to convert Linux drivers into Minix3 drivers, you will solve the dreams of many programmers. So, how to do it? Look through manuals about Linux and Minix3 drivers. Bug the developers of Minix3 and Linux a LOT, so that they can explain to you exactly what is the difference between the two drivers. You may get some help from FreeBSD, as they have some experience "emulating" Linux drivers.
7. 32 and 64-bit compatibility
Recompile the code and try and get it to work in both 32 bits and 64 bits. This shouldn't be too hard since mostly everything here is written in C.
8. 16-bit compatibility, and other system portability.
Using other compiler settings, or other compilers in general, compile the C code for other systems. 16-bit would be nice because some programmers consider the 32-bits to be extra useless bloat of memory. Some hardware however would not work. It would be best not to go crazy here by switching between real and protected mode. Portability to other systems will probably require hardware support on the other systems. Again, this is where the new hardware drivers (step 6) comes into play.
It would be a very good idea to separate this OS template into separate platform codes instead of having one big code that can handle everything.
If you can accomplish these eight goals, you will have completed the task of creating an equal playing field for OS programmers. Additional APIs may be added, but must always be described in detail in HTML, accessible to everyone. You may possibly develop this future into a monolithic kernel instead of a micro kernel, however it seems considerable amount of effort would be needed for that, with little benefit - The OS template should be relatively fast on its own.
Now any OS programmer would be able to use this OS template to create the OS of their dreams without thinking to hard about the hardware. Most important is to make the API very user-friendly and well documented in HTML form. Preferably in the format of functions in php.net.
I hope this post will influence enough people to finally bring OS developers out of Stage 1 of operating system development.
Veniamin Ilmer
91.26% internet clients use Windows.
5.66% internet clients use Macintosh.
1% use Linux.
And only 1% use something else. This may be BSD, and other *nix OSes.
Thus pretty much all computer users either use Windows, Macintosh, or Linux.
But the question is - why? With such a large community here, what is wrong? Why isn't Windows getting much competition? It's more expensive and slower than alternatives, right?
The problem is that Windows, Macintosh, AND Linux are all using anti-competitive strategy.
All modern books have copyrights on them. Just because you have one book doesn't mean you can make copies and distribute it to your friends.
Operating Systems also have copyrights on them. Just because you have a CD of Windows doesn't mean you can copy it and give it to your friends.
However, in the literature world, one book does not rule them all. New books are published all the time by different authors and may sometimes sell well for some period of time.
In the computer world, extremely few OSs dominate over everyone. New usable OSs are not published and sold.
So, what happened? Why are books easily written and OSs aren't?
The reason is lack of information. OS writers don't know how to write some parts of their code!
In particular, hardware data sheets are not free to come by. Either you have to agree to some non-disclosure statement, or you have to pay a huge sum of money, or the hardware company bluntly says "No"...
These hardware companies signed a contract with Microsoft stating that they will not give out the specifications to anyone but Microsoft.
The fundamental parts of an operating system are denied to independent operating system developers. Hence most of us are usually near the "Stage 1" of the OS development, even after years of learning and practicing the art.
This scheme that Microsoft and Apple have up is called "Exclusive dealing" ..a type of "Barrier to entry". Monopolies strive on this kind of stuff because it stops people like you from reaching up to their level.
Believe it or not, Microsoft and Apple are not the only ones being anticompetitive. Although Linux is free and open source, the details inner workings of Linux are rather obscure, even for people working on it.
Ever try to read through the source code of Linux? It reminds me of trying to fix a bug in Windows by calling up and chatting for hours on the phone with Microsoft's offshored customer service, only to end up having to reinstall the whole operating system.
Linux is a real beast - without good directions and useful information, one can easily be lost in its code.
When trying to read the assembly code of a C++ compiled "Hello World" problem, most people get lost. The program is not encrypted or hidden.. it just becomes very complicated to understand.
The same applies with Linux ASM/C/C++ code. Even with all of the code visible in full sight, having no encryption or hiding schemes, Linux is just way too complicated to understand.
Because of its code complexity, understanding how Linux handles hardware is very similar to understanding how Windows or Macintosh handles hardware - It's easier to reverse engineer the hardware than to read the code.
Because of this lack of useful information for operating system development, OS programmers simply get lost or stay near the beginner level of their development.
Hence Windows, Macintosh, and Linux dominate.
In order to get around this anticompetitive system, OS developers have to be granted easy access to the fundamentals. OS developers must have a predefined structure where all hardware is accessible as an API from stage 1 of development.
This includes the simple - switching to 32 and 64 bits, communication with mouse and keyboard, printing pictures in color, reading from and writing to a DVD.
But it also includes the hard - Interfacing a broadcom BCM4312 wireless card, using any 3d acceleration parallel processing GPU tricks available on a modern video card, and interfacing with a wireless USB webcam.
Basically, all chip specific hardware control must be abstracted from the OS programmer.
Allowing for a plug and play usb joystick should be extremely trivial for the OS programmer.
These are fundamentals that should be present in every Operating System without question.
There should also be libraries that handle the basic protocols and file formats - Interfacing TCP/UDP, the file format of a JPEG, the file format of a TTF.
The OS programmer should have easy access to file formats and protocols - no thinking should be involved here.
By having such a template system from stage 1 of operating system development, the OS programmer has a level playing field. No longer does one have to spend months trying reading through old partial manuals about interfacing the USB. No longer will one have to spend days attempting to experiment with some piece of hardware to figure out how it works.
Instead the programmer will focus on that which makes operating systems stand out:
Will it be graphics or console based?
What level of internet/user security do you want to place?
What will your API be?
How user friendly will your OS be?
Should some programs be hard coded into the kernel?
How fancy should the graphics be?
What programs should come with the OS?
etc.
By not having to think about the hardware, protocols, or file formats OS programmers will easily be able to compete with Windows, Macintosh, and Linux.
Ordinary users will have a much better selection of high speed, low cost OSs. High performance independent OSs will be ranging from completely home based graphical eye candy user friendly, to high security industry standard database servers.
Probably most of these diverse operating systems will be written by people like you.
So, how to implement such an idea? It's actually not as hard as it seems.
An organization of well minded individuals should form together and work as a team to achieve the following steps:
1. Copy the Minix3 code from here.
Minix3 in particular is nice because of how it handles hardware. The amount of hardware it has is rather limited (it has drivers for all companies that show their data sheets!), however Minix3 has a whole powerful system for handling the drivers. If something goes wrong with the driver, the OS doesn't freeze.. the driver just gets reset, and you're back in business. This is really good for us because we don't care about the drivers - as long as they work.
Minix has been one of the main pioneers of Operating System development. It has pretty much everything you need in the most basic operating system - Multitasking, transferring to 32-bits. It works on a PC. It is not portable because its lack of hardware implementation of other systems. This can be added later.
Minix3 is written with a BSD license, meaning anybody can copy the code without being forced into making their code open source.
Most important: Because of how Minix is built (small kernel) it is much more easy to understand and thus modify it than any other advanced Operating System.
The goal is to make a template system for any operating system. The smaller the original kernel, the easier it will be to make it into a template.
2. Figure out how to compile it from the code and run it in QEmu or Bochs.
Make sure you can compile it from your system. You will probably have to rename some of the commands in the Makefiles to get it to work.
3. Get rid of everything *nix!
To transform this code into a usable template structure, one must first remove everything having to do with *nix from it.
A good way to start this is by removing any code that has to do with touching the directories. There should be no such thing as "/root/" or "/tmp/" or even "/"
Using the new template one should be able to write up an advanced DOS with the usual "C:\" in it.
Remove any command line things that Minix has ("ls", "mkdir", "cd", etc) ..completely get rid of the shell - remember, an OS developer can choose not to have any console interaction at all.
Note that for all this time, you must keep Minix's ability to run applications, and use any drivers. Make sure to keep any protocols or file formats as libraries. If possible, the multitasking ability should be shoved into a library that can be turned on and off. (One may want to implement a limited form of non-preemptive multitasking).
4. Reflection, documentation.
Now if everything has been done properly, there should be about three things - the kernel, the hardware drivers, and extra useful protocol libraries.
In the kernel, there should be some driver initialization present... and afterwards, nothing. (Just freeze). It is fuzzy there how much control the programmer should have over the driver initialization. It seems that all of it should be controlled.
All controls that the user has should be extremely well documented in HTML or PDF form. (Regular text is boring to read.)
In some cases, extra functions should be added as a form of an API, so that there was an abstraction of the hardware.
All of these functions should be well explained in the HTML documentation. It is assumed that the APIs can be called from the "main area" within the kernel, however this idea can be modified so that the APIs can be called elsewhere.
5. Build a proof-of-concept example operating system
Using as much of the API as possible, build a small project OS. Preferably something opposite of Linux, but not something that takes too much time - Make an extremely simple Windows. Have it be able to run simple programs that use an extremely simple system API set. (createwindow, printmessage, waitkeypress, closewindow for example) Here one would realize what parts of the API are missing in order to accommodate any type of operating system.
Please note that here "API" was used in two different forms. One is where the OS programmer uses an API, the other is when the OS programmer supplies an API for applications. Do not confuse the two.
To continue on with the project, you are free to continue developing this sister project and thus enhancing the OS API even further.
6. Acquire new hardware drivers
Minix3 starts out with a nice supply of "open" drivers. It basically has all the capabilities of the bochs and qemu emulators, including monitor and networking. However after a while, that is not going to be enough. Luckily, Minix3's driver structure is relatively similar to Linux. Linux has most of the hardware needed. If you can figure out how to convert Linux drivers into Minix3 drivers, you will solve the dreams of many programmers. So, how to do it? Look through manuals about Linux and Minix3 drivers. Bug the developers of Minix3 and Linux a LOT, so that they can explain to you exactly what is the difference between the two drivers. You may get some help from FreeBSD, as they have some experience "emulating" Linux drivers.
7. 32 and 64-bit compatibility
Recompile the code and try and get it to work in both 32 bits and 64 bits. This shouldn't be too hard since mostly everything here is written in C.
8. 16-bit compatibility, and other system portability.
Using other compiler settings, or other compilers in general, compile the C code for other systems. 16-bit would be nice because some programmers consider the 32-bits to be extra useless bloat of memory. Some hardware however would not work. It would be best not to go crazy here by switching between real and protected mode. Portability to other systems will probably require hardware support on the other systems. Again, this is where the new hardware drivers (step 6) comes into play.
It would be a very good idea to separate this OS template into separate platform codes instead of having one big code that can handle everything.
If you can accomplish these eight goals, you will have completed the task of creating an equal playing field for OS programmers. Additional APIs may be added, but must always be described in detail in HTML, accessible to everyone. You may possibly develop this future into a monolithic kernel instead of a micro kernel, however it seems considerable amount of effort would be needed for that, with little benefit - The OS template should be relatively fast on its own.
Now any OS programmer would be able to use this OS template to create the OS of their dreams without thinking to hard about the hardware. Most important is to make the API very user-friendly and well documented in HTML form. Preferably in the format of functions in php.net.
I hope this post will influence enough people to finally bring OS developers out of Stage 1 of operating system development.
Veniamin Ilmer