Linux drivers

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
salil_bhagurkar
Member
Member
Posts: 261
Joined: Mon Feb 19, 2007 10:40 am
Location: India

Linux drivers

Post 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?
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Post 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?
User avatar
salil_bhagurkar
Member
Member
Posts: 261
Joined: Mon Feb 19, 2007 10:40 am
Location: India

Post 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...
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post 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.
Every good solution is obvious once you've found it.
User avatar
salil_bhagurkar
Member
Member
Posts: 261
Joined: Mon Feb 19, 2007 10:40 am
Location: India

Post 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...
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post 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
Post Reply