Page 1 of 1
Network/Monitor/Scanner/Printer/General annoyance
Posted: Thu Jul 27, 2006 3:54 pm
by ComputerPsi
Greetings to all OS developers reading this post. I have been writing operating systems for years from the boot sector and file system management, to the floppy drivers and protected mode management, going though thousands of manuals, documentations, and tutorials.
However, I am quite amazed by how many drivers I still can't find how to make.. For example, I have a "Broadcom 440x 10/100 Integrated Controller" eithernet network card. No matter how many ways I try to put it on google, I never get anything that actually gives specific information about how to inference with it. The most I normally get is a manual on how to install the Windows driver for it... Same thing with the video. Without using VESA SVGA, I have no idea how you can get into a 1024x768x16M resolution, no matter what card. Every time I search for something, I either get redirected to some website for downloading drivers, or a tutorial on how to make drivers for some operating system. Hardly ever do I get some good information on something unless it's very known to beginners - e.g. keyboard control, mouse control, etc.
I am sure many of you had this problem.. Did you ever solve it? Many have suggested looking at other operating systems, like linux, to see how it works. I don't do that for three reasons:
1. They have that "copyleft" thing.. and in general, I don't like just coping code.. I don't learn anything from it.
2. I would like to look at the completely specification, as I may be able to use something that the other OS doesn't.
3. I have went through thousands of lines of my own code, just to find a simple bug.. not fun. I don't want to try to look through thousands of lines of somebody else's code to try to figure it out - especially when I program in a different language.
Yet, somehow, people are able to come up with different drivers to support different operating systems. For example, on my linux, in order to use my logitech webcam, I had to download an experimental driver that some guy made. How did he make it? I don't know. Does anybody? Somehow, some people magically have the ability to write up a whole driver for something that is normally not written on the internet. How is this possible?? Am I looking in the wrong places? Does anybody have a solution?
Posted: Thu Jul 27, 2006 4:41 pm
by carbonBased
I can definitly sympathize with you. I despise the lack of freely available hardware documentation. I don't think that we, as open source developers (at least most of us are), should be required to pay large ammounts of money in order to develop (read: make use of!) someone's hardware. That's disappointing.
I really can't say how people get the information for writting these drivers unless they're actively prodding companies for specs. Or perhaps they have inside knowledge (ie, he/she may work for broadcom, or logitech... I, personally, work for a company associated with broadcom, and am privy to some of their inside documentation. Unfortunately, not the docs you require... and, of course, I can't legally give the docs, even if I had them).
I suspect a lot of these people reverse engineer windows drivers. I don't know how legal this is, either, but I know a lot of people do it. A lot of Linux drivers wouldn't exist without these techniques.
Myself, most, if not all, of the hardware I have in my system is (thankfully) documented fairly well on the 'net, so I haven't run into this so much (although I did once try to write a BeOS driver for a largely undocumented ATI card and was cursing just like you!)
--Jeff
Posted: Thu Jul 27, 2006 9:29 pm
by chase
For the most part it's all reverse engineering which may or may not be legal depending on where you live. Linux has the same problem too, in fact there was an article recently about it
http://kerneltrap.org/node/6692. There have been some attempts to gather all available docs and make lists of hardware with specs, the biggest was probably the
Cottontail library but it hasn't been updated in years. You used to be able to join a companies developer communty and download specs, I still have some 3dfx and Matrox 2d video card specs on a cd somewhere.
Now you have a few companies that release specs, a couple that if you contact you can beg to sign a NDA, and most that don't give you anything. I think most companies don't give out anything now because they've made such a huge IP investment that they don't want to risk anything(ati, nvidia) or lots of companies that are just pumping out someone elses reference design with a slightly different pcb layout to make things cheaper.
As far as your logitech webcam goes, he probably sniffed the USB traffic under Windows and developed a driver that mimics the Windows one. Read his code, I'd be super surprised if he has comments that describe what all the bits do that his driver is sending to the camera because her probably doesn't know. You aren't the first to be frustrated by all of this. Some people have gone as far a designing their own hardware (
http://www.opencores.org).
Posted: Fri Jul 28, 2006 2:09 pm
by Dex
I have written many drivers and they get simpler as they are basically the same.
Next i think OS dev's sometime work the wrong way, went you buy your hardware check for the doc first, then buy your hardware.
Buy cheap is best, as they use well doc technology, like rtl8139, ac97 etc.
Here a simple driver does,
First write a pci device and vendor detection function for your OS, all it needs to do is you give it a vendor and device ID number and it returns the address or error if not found, it is a place you can get ID from
http://www.pcidatabase.com.
Next you need the pdf spec manual like this:
http://www.alldatasheet.com/datasheet-p ... L8139.html
If you go to page 10 of that manual you will see address 0 as the first address
This will be the offset from that address your PCI find function returns, by reading and writing to these offset you do differant things.
PS: Here a good site for voodoo card programing
http://homepage.swissonline.ch/tinyasm/v3.htm
Posted: Fri Jul 28, 2006 3:18 pm
by carbonBased
Dex wrote:I have written many drivers and they get simpler as they are basically the same.
Next i think OS dev's sometime work the wrong way, went you buy your hardware check for the doc first, then buy your hardware.
Buy cheap is best, as they use well doc technology, like rtl8139, ac97 etc.
That's all well and good if you're designing a computer to run your OS... but if you're designing on OS to run on an existing computer (or for that matter, many computers -- a lot of us would like to run on everything we can find), then you'll still run into this problem.
Dex wrote:Next you need the pdf spec manual like this:
http://www.alldatasheet.com/datasheet-p ... L8139.html
If you go to page 10 of that manual you will see address 0 as the first address
This will be the offset from the address your PCI find function returns, by reading and writing to these offset you do differant things.
This is exactly the problem, of course... not all hardware has such documents. Worse yet, not all hardware buses are as nicely defined as PCI.
--Jeff
Posted: Fri Jul 28, 2006 3:59 pm
by Dex
No, i disagree, your OS will only run on the hardware you have drivers for (other than by using vesa etc), just because you have that hardware does not mean anyone else will.
You can not write drivers for all hardware, so it is your job as a OS Dev, to only use well doc hardware.
If you can not do that simple thing, then tough your OS is in the darkage.
I am planing on not only designing my own case for my OS, but also a esay available hardware spec, this spec will be cheap, but good like rtl8139, ac97, rtl8180 wireless wifi, and a basic graphic card etc.
If all OS dev did this and others who wanted to use them, would get the same spec and so on.
I mean hardware is cheap than ever, take advantage of it, i payed £8 each for soundcard and ethernet card, even M$ is doing it with the xbox and apple, and i know they are big co, but in a small way you can do the same.
If linux could only run one hardware spec, but it run supper fast, people would get that spec and hardware makers would make there hardware compatable, that how SB sound cards came about, you would then make your OS run on it and i would mine and so on.
Game makers would love it too as they could know the hardware like they do for xbox, ps2.
Posted: Fri Jul 28, 2006 4:32 pm
by Legend
Dex wrote:No, i disagree, your OS will only run on the hardware you have drivers for (other than by using vesa etc), just because you have that hardware does not mean anyone else will.
You can not write drivers for all hardware, so it is your job as a OS Dev, to only use well doc hardware.
If you can not do that simple thing, then tough your OS is in the darkage.
As the top gear hardware especially in the graphic world is not world document, your OS is in the dark age if you only use well documented hardware.
I am planing on not only designing my own case for my OS, but also a esay available hardware spec, this spec will be cheap, but good like rtl8139, ac97, rtl8180 wireless wifi, and a basic graphic card etc.
If all OS dev did this and others who wanted to use them, would get the same spec and so on.
Why should OS developers release hardware specs? Hardware vendors should, but they don't, for business reasons. Or do you want to be an OS developer and a hardware vendor?
If linux could only run one hardware spec, but it run supper fast, people would get that spec and hardware makers would make there hardware compatable, that how SB sound cards came about, you would then make your OS run on it and i would mine and so on.
Game makers would love it too as they could know the hardware like they do for xbox, ps2.
Well, Linux is a bad example. If Linux would have run on only one hardware configuration, it would never have been popular anyway and you wouldn't know about it today. The main reason with Linux being far from perfect in every other area then hardware support, and even there, support for the latest high end hardware. People don't even get hardware compatible with what Linux actually covers only to be compatible with Linux.
Short conclusion: Provide drivers for what you can. If you think about supporting all hardware however, you need to put the job of writing driver onto the hardware vendors - and this is a problem.
Linux does this even for vendors which are willing to provide open source drivers!
Posted: Sat Jul 29, 2006 9:00 pm
by chase
There is a discussion on slashdot right now where someone basically asked why isn't there a 3d version of a VESA BIOS on video cards.
http://ask.slashdot.org/article.pl?sid=06/07/30/0013241
One of the interesting links is for a group trying to design a fully open spec video card.
http://wiki.duskglow.com/tiki-index.php ... n-Graphics
Posted: Sun Jul 30, 2006 2:44 am
by Legend
Is this is a little problem, as in this area every single cycle counts. At least some chips might need a big redesign to fit a different API.