From jhawk:

I wrote up a set of gdb scripts that you can use to
patch the devices in an existing kernel image. This makes it MUCH
faster and less painful to do a kernel build for someone.

I need to go back digging to find instructions on how to use it (in
our environment), but you could look at
/mit/netbsd/arch/i386_nbsd1/bin/kerntweak -- it is merely:

#!/bin/sh
gdb -nx --write --command=/afs/sipb/project/netbsd/share/kerntweak/kerntweak.gdb "$@"

As far as I know it doesn't do any i386-dependant so you should be able
to use it to change IRQs and port numbers and suchlike under NetBSD/mac68k.
