Page 1 of 1
Linux drivers
Posted: Mon Mar 19, 2007 12:42 pm
by salil_bhagurkar
I think porting linux device drivers to my os would be a nice solution and would probably reduce the process of understanding each and every hardware.
So, is it possible to port the linux driver code? I know i would need to understand the different functions provided by the driver interface of linux. I have read linux device drivers. But what i need is a brief list of all functions called by linux drivers and how each function behaves. Could anyone suggest of such a resource?
Posted: Mon Mar 19, 2007 2:18 pm
by Candy
You could try Linux Device Drivers from O'Reilly, which is available fully online IIRC. On the other hand, think about it for a minute. If you supported all the drivers Linux did, what would make your attempt different from a new Linux kernel?
Posted: Tue Mar 20, 2007 11:55 am
by salil_bhagurkar
According to me drivers are there just to support the hardware... What matters is how well your kernel manages itself and the drivers and how efficiently it does it.
I wouldnt be writing a driver interface linke that of linux... But to reboot your pc it's always outb(0x64, 0xfe) no matter which operating system it is. I guess managing the same functions and facilities that the hardware provides in a different way than any other existing os does is what writing a new os is all about...
Posted: Tue Mar 20, 2007 12:31 pm
by Solar
The catch with the Linux driver model is that there isn't any. They don't define any clear kernel - driver interface, and they do so on purpose.
They claim that this is done so they can "adapt". (Read /usr/src/linux/Documentation/stable_api_nonsense.txt.)
I claim they do it so that anyone with a plan similar to yours has to aim at a constantly moving target, ensuring that the OS duopoly stays the way it is. As a "nice" side effect, any driver not GPL'ed and merged into the main kernel source suffers from incompatibility whenever the kernel maintainers feel like it.
Posted: Tue Mar 20, 2007 12:48 pm
by salil_bhagurkar
So if that is what linux people aim at then there is no alternative to understanding each and every hardware of a pc...
But i really think it's a useless thing to do. Writing drivers is a very time consuming part. With that you leave aside the main part of writing a kernel that will manage the drivers and userspace in a nice way...
It's really hard to keep up with the changing hardware in pcs. But once you think of a kernel design and work hard on the implementation it's eternal. The same design can be implemented on all machines...
Posted: Wed Mar 21, 2007 3:50 am
by AJ
@Candy- Thanks for the book info which is also useful for my current development stage. The link for anyone else who's interested is
http://www.xml.com/ldd/chapter/book/ - seems useful at first impressions.
My aim is to read all about the linux drivers and any others I can get my hands on just to see how others do it - not for binary compatibility.
Cheers,
Adam