Displaying posts tagged: kernel

memcmp broken in the FreeBSD kernel

No Comments
I've spent a day tracking down a bug in a FreeBSD kernel module I'm developing, and to my surprise the bug was due to memcmp being broken! For those that don't know, memcmp is used to compare two byte strings and returns 0 if they are identical, a negative number of the first string is less ...

Autoload symbols for FreeBSD kernel module

No Comments
When debugging FreeBSD kernel modules with GDB, you have to tell GDB the correct symbols for the module, and the location the module is loaded in RAM. This is helpfully explained in the FreeBSD Developers' Handbook. First you must load the module, then run kldstat, note down the address the module is loaded at, and finally ...