Driver Implemention

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
Tyler
Member
Member
Posts: 514
Joined: Tue Nov 07, 2006 7:37 am
Location: York, England

Driver Implemention

Post by Tyler »

When implementing drivers/specifications (ACPI/ATA/Serial UART etc), would it be best to create a single driver for each version of the specification or create one driver that supports common code and then has seperate portions for all the extras?
Tyler
Member
Member
Posts: 514
Joined: Tue Nov 07, 2006 7:37 am
Location: York, England

Post by Tyler »

I really hate to bring up my own topic again, and i apologise if it was simply read and thought too stupid to respond to. Yet, as it is pertenent to this very moment in my development it would be useful to know, before i go developing a single driver for every version of eery specification, if writing a signle driver to cover them all is easy without having to have lots of specialied ares of code in each driver.
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post by Dex »

I myself, i always try and keep drivers self contained, even if this means rewriting similar code, but then as i code 100% in asm, size is not a problem.
This to me makes them easier to understand and debug, + makes mod just one part easier etc.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Post by Candy »

I would judge it on a per-driver basis, preferring the code to be tailored toward the newest version. I would group revisions that didn't change much and make a split when the interface changed substantially or when the code doesn't end up being portable (or has a design flaw).

In general, group them unless there's a fairly clear reason why the code bases should be separate.

I vouch for designing stuff up front and keeping code bases shared as far as is reasonably possible to do so. When you then do figure out a flaw, you only need to fix it once, instead of in all the code bases. You also strongly reduce the chance that you forget some change.
Post Reply