DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 31st May 2008
WeakSauceIII WeakSauceIII is offline
Port Guard
 
Join Date: May 2008
Posts: 36
Default Driver development

Can someone please post complete instructions on how to write a driver from scratch?

kidding...

I have done some development in windows on this topic and am researching the BSD way. I have the book "the design and implementation of the FreeBSD operating system" and it has a lot of good detailed info on the hardware setup and seems to be mostly relatable to OpenBSD. I also have the book "Writing Unix device drivers" by george pajari. It's dated (around 1991) and specific to UNIX system V but gives detailed walkthroughs and source code for all drivers types explaining the code line by line. It also seems to be at least 70% relatable to BSD. The combination of these two gets me real close. My question is this, where can i get the hardware specs for a device? I mean the low level control registers and such. I know that most of that is proprietary and not available which is what makes it hard to make OBSD compatible drivers but for the hardware that is open does anyone know a good site or resource? I'm not even sure what to call it. I searched for technical specs, driver specs ect... on intel and other sites but i can't find what I'm looking for. Of course the source code for OBSD drivers is a great resource as well.

Last edited by WeakSauceIII; 31st May 2008 at 02:11 AM.
Reply With Quote
  #2   (View Single Post)  
Old 31st May 2008
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

There is no global index of "hardware specifications", you can find datasheets online from various sites but the best place is the hardware manufactures website.

Again, not every vendor releases datasheets.. and when they do, sometimes they're not very informative.

I'm not aware of any books related to writing drivers for OpenBSD, familiarity with the kernel would likely help, even though the BSD's are similar, kernel-level API's have changed (Which is why porting drivers between BSD's is not always easy..).

Take things on a case by case basis, if you're working on a driver for a.. USB sound card, find out as much as you can, docs, resources (previous implementations), and perhaps contact a developer and ask for advice.

It's assumed you know a great deal about the C programming language, and perhaps about the bus the device is connected to, PCI/USB/i2c etc.

Have fun, search the mailing lists... cvs commits.. etc.. Google is nice.

Last edited by BSDfan666; 31st May 2008 at 03:25 AM.
Reply With Quote
  #3   (View Single Post)  
Old 31st May 2008
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,319
Default

Quote:
Originally Posted by WeakSauceIII View Post
I have the book "the design and implementation of the FreeBSD operating system" and it has...
Although there is some overlap between the "4.4" & "FreeBSD" books, be aware that the older volume may be of greater use to OpenBSD:

http://marc.info/?l=openbsd-misc&m=114616081523335&w=2

FWIW.
Reply With Quote
  #4   (View Single Post)  
Old 31st May 2008
WeakSauceIII WeakSauceIII is offline
Port Guard
 
Join Date: May 2008
Posts: 36
Default

bought it, 8$ on amazon.

thanks
Reply With Quote
  #5   (View Single Post)  
Old 31st May 2008
robbak's Avatar
robbak robbak is offline
Real Name: Robert Backhaus
VPN Cryptographer
 
Join Date: May 2008
Location: North Queensland, Australia
Posts: 366
Default

Generally speaking, if the manufacturer provided such low-level specs, the drivers would have been written long ago. The big problem with hardware support is that they are unavailable.
Occasionally, they make them available under Non-Disclosure Agreements, which allows someone who agreed to them to write drivers. If they are able under that agreement to release the source, then others can study the source and reconstruct some of the information, to implement a driver in anther OS. The licensing of that source code is often another impediment. Arg, it's a mess.

Generally, getting low-level info on hardware is like pulling teeth. It's like they don't want customers.
__________________
The only dumb question is a question not asked.
The only dumb answer is an answer not given.
Reply With Quote
  #6   (View Single Post)  
Old 31st May 2008
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,319
Default

Quote:
Originally Posted by robbak View Post
Occasionally, they make them available under Non-Disclosure Agreements...
...which the OpenBSD project will not tolerate. Specifications are either freely available without encumbrance, or the hardware has to be reverse-engineered which can take a longer period of time. This is the principal reason that OpenBSD offers a smaller number of drivers in comparison to other projects.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
msk(4) Driver indienick FreeBSD General 4 4th May 2009 04:51 PM
FreeBSD 7.0 and the nfe driver map7 FreeBSD General 2 17th October 2008 04:44 AM
X Radeon driver sum FreeBSD Installation and Upgrading 5 28th September 2008 03:49 PM
NetBSD USB Driver jmarc007 NetBSD Installation and Upgrading 1 13th May 2008 04:45 AM
Mono development On FreeBSD roddierod Programming 5 8th May 2008 09:13 PM


All times are GMT. The time now is 03:37 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick