Operating System - HP-UX
1754822 Members
3658 Online
108825 Solutions
New Discussion юеВ

how to use adb to perform hp-ux kernel modification

 
amit mehta_2
Regular Advisor

how to use adb to perform hp-ux kernel modification

Hi All,

How can i perform hp-ux kernel modification using adb ?
i have a kernel module for which i have access to source file and corrosponding header files.I need to change the value of one of the macro defined in one of the header file.so instead of re-building entire kernel,can this be done by adb ? if yes then how ?

Thanks,
~amit
4 REPLIES 4
Court Campbell
Honored Contributor

Re: how to use adb to perform hp-ux kernel modification

> How can i perform hp-ux kernel modification using adb ?

You don't.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
A. Clay Stephenson
Acclaimed Contributor

Re: how to use adb to perform hp-ux kernel modification

While in principle it might be possible, in practice, it would be very difficult. There are also cases where it would be impossible. For example, suppose that the macro controlled the size of an array. There is no way using adb to allocate a larger array "on the fly". Typically adb reads the symbol table in /stand/vmunix and uses that to find the offset into the kernel memory image (/dev/kmem) and then writes or reads values to make changes "on the fly". Using adb makes sense in the case where all you are doing is changing a value but that doesn't seem to be the case here. It's also possible that this macro affects many kernel data structures at once so the consequences could be disastrous unless several values were changed simultaneously. If you have the source code then using adb doesn't make sense; you need to recompile the module. If this is a dynamically loaded module then it could be changed "on the fly".

Meaning no insult, this is one of those areas that if you have to ask then you are almost certainly not the person to be doing this.

If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: how to use adb to perform hp-ux kernel modification

Here's the general method for modifying a kernel value "on the fly":

echo 'some_kernel_value/W 0ff' | adb -w -k /stand/vmunix /dev/kmem

which would modify "some_kernel_value" to the value 0xFF. /W tells adb the type of variable.
If it ain't broke, I can fix that.
Dennis Handly
Acclaimed Contributor

Re: how to use adb to perform hp-ux kernel modification

As Clay mentioned you can only do certain changes with adb. You can only modify values and instructions. While the former isn't hard, the latter would take an expert.

Better to rebuild your module.

(It would be helpful if you had some spaces after your commas and periods.)