Initial bsd support
Merge pull request #40 from Freeaqingme/bsd

Initial bsd support