• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Rewriting Drivers

Unee0x

New Member

Thanks: 1
Messages: 7

#1
Suppose I want to rewrite a driver that was already written for Linux / Windows. What parts (if any) could I use ? And what parts essentially must change in order to make a whole BSD driver free and clear of any blow back?

thanks in advance
 

Crivens

Moderator
Staff member
Moderator

Thanks: 537
Messages: 1,465

#2
You will need:
  1. The book "FreeBSD device drivers".
  2. The book "Design and Implementation ..."
  3. A good memory because c&p is out of question.
  4. Skills in async programming.
  5. Knowledge of the hardware in question.
  6. Errata sheets.
  7. Coffee.
  8. Knowledge of kernel debugging.
  9. Highspeed camera (don't laugh. That one actually came in quite handy!)
  10. More coffee.
  11. If available, logic analyzer with tracer.
  12. A test system with LAN connection and SSD for fast booting (no testing on your development system).
  13. Backups
The list may not be complete, but those items are what I found handy or absolute neccessary.
 

Crivens

Moderator
Staff member
Moderator

Thanks: 537
Messages: 1,465

#3
Oh, and depending on the origin of your original driver, you may well need some legal counsel.

What hardware would that be, by the way, if I might ask?
 

lebarondemerde

Daemon

Thanks: 593
Messages: 1,365

#5
Unee0x drivers often born BSD/MIT licensed (by the device manufacturer) and later Linux people manage somehow to stamp a GPLx license on it later. You may want to look for an eventual original code from the manufacturer.
 

_martin

Aspiring Daemon

Thanks: 129
Messages: 691

#6
Don't know, it's just maybe me ... I'd first attempt to write the driver and worry about legal things later ..
 

sidetone

Aspiring Daemon

Thanks: 308
Messages: 895

#7
Don't know, it's just maybe me ... I'd first attempt to write the driver and worry about legal things later ..
If going that route, it's better to publish it first as the undisputed author or organization before publicly plugging it into GPL code.

But it's better to sort things out first.
 

DriverBuilder

New Member

Thanks: 1
Messages: 3

#8
Take a look in /usr/src/sys/compat/linuxkpi/common/include/linux , it helps to identify correct alternative for linux functions.
Ex: gfp.h contains FreeBSD equivalents for gfp_* flags.
 
Top