Contributed by jose on from the /dev/my_stuff dept.
"Are their any primers to start hacking out device drivers in OpenBSD like their is for linux? Having been told, 'Just go through the code', I have concluded I just wont pick it up that way. Ideally, I want to hack out a sound driver for a laptop so I can go BSD on the road too. Any help, or links are greatly appreciated.Every time I start down this path I quickly run away, as I'm just not skilled enough. Anyone care to share some resources for Josh?-Josh-"
(Comments are closed)
By Anonymous Coward () on
(http://www.netbsd.org/Documentation/kernel/programming.html)
Comments
By Pedro Bastos () on
Nice book - should help you out.
By Anonymous Coward () on
going through the code is basically just what you do. its how many, many people have learnt. it is quite logical really. just dont be afraid of trying, edit an existing driver, add a few printfs here and there and see what happens, then start making more serious changes unitll you understand how it all works together.
find a driver that is a) documented (ie proper vendor documentation (i think 3com relases its specs)) b) for actual hardware you have (so you can play with it) then just mess with it, tweak it, watch it break, fix it. your kernel will panic, you will spend a lot of time looking at fsck running, and (more or less) no-one will help you. but dont worry about, enjoy it, fsck time is a good time to look over the documentation you have and try and work out what happened. if you panic the kernel, who cares? it doesnt matter, just work out what happened and keep going. no-one will say its an easy thing to learn, but many people have and i honestly believe with patience and hard work nearly anyone could learn it (after all, this is real-world science :P).
if i were starting again i would've gotten a sparc to learn on as its architecture is much easier to understand than i386 (imho of course). understanding how your architecture really works is crucial (most bigger libraries have vendor manuals).
i will say, dont ask for help on the openbsd lists, they are there for problems with openbsd not to help you to learn how to program.