NetBSD says init FATAL error- console- Interrupted system call NetBSD will not boot into multi-user-mode Frequently Asked Questions and their answers Top

6.40. How do I use binpatch?

binpatch is a small utility to patch the kernel. It uses the bugging information to locate the variables. So, for example, if your drive is not able to be run in sync-mode, you can disable the sync-mode by using binpatch as follows:

Assuming the hd is on ID5 :

# binpatch -s _inhibit_sync vmunix (get address of _inhibit_sync) _inhibit_sync(0x12345): 0 (0x0) (replace 0x12345 by real value from now on) {Addr=0x12345+Unit (==5)==0x1234a} # binpatch -b -a 0x1234a -r 1 (replace 0x1234a with calculated value)

This inhibits sync-handshake on unit 5.

The options of binpatch are:

-s search for an address of a variable

-a <address> specify the address you want to patch

-b patch only a byte value

-w patch a word value (2 bytes)

-l patch a long word value (4 bytes)

-r the value to replace the old value

Another example from mtk:

Remark to Retina-owners with monitors that don't grok the default video-mode opened by BSD, you're now able to binpatch this to an inferior mode:

binpatch -s _retina_default_mon -r 1 will give you 640x512 with 31.5kHz and binpatch -s _retina_default_mon -r 2 will give you 768x600 with 38kHz

-r 3 is the default at 64kHz.


Matthias Kirschnick 04/15/94