|
|
coherent
ppaattcchh -- Command
/ccoonnff/ppaattcchh [-kkKKppvv] _i_m_a_g_e _s_y_m_b_o_l=_v_a_l_u_e ...
The command ppaattcchh alters the value of datum _s_y_m_b_o_l to _v_a_l_u_e in executable
_i_m_a_g_e. In general, you should use ppaattcchh to alter configuration data
(constants) in programs, in device drivers, and in the COHERENT kernel.
For ppaattcchh to work with a symbolic constant, _i_m_a_g_e must have a symbol table
that includes information about _s_y_m_b_o_l. Therefore, executables that have
been processed by the command ssttrriipp cannot be ppaattcchhed.
ppaattcchh recognizes the following _o_p_t_i_o_n_s:
-kk Patch the kernel memory of the running COHERENT system via device
/ddeevv/kkmmeemm, as well as the _i_m_a_g_e.
-KK Patch only the kernel's data memory of the running system via device
/ddeevv/kkmmeemm.
-pp Display (peek at) the current values of the specified variables, but
do not change them.
-vv Verbose. Display the values of the specified variables before and
after patching.
Only the superuser rroooott can access kernel memory from the ppaattcchh command.
Both _s_y_m_b_o_l and _v_a_l_u_e may consist of numeric constants or a symbol from the
symbol table of _i_m_a_g_e.
Please note that the COHERENT 286 kernel references variables with a
trailing underscore character; for example, aattppaarrmm_. The COHERENT 386
kernel, however, does _n_o_t use a trailing underscore; for example, aattppaarrmm.
The following descriptions apply to both COHERENT 286 and COHERENT 386, but
the notation will be in the COHERENT-386 form.
_s_y_m_b_o_l and _v_a_l_u_e expressions may include an optional numeric offset. In
addition, the _v_a_l_u_e field may optionally be composed of the construct
mmaakkeeddeevv(_m_a_j_o_r,_m_i_n_o_r), where _m_a_j_o_r and _m_i_n_o_r are the ``major'' and ``minor''
device numbers, respectively, resulting in a ddeevv_tt-sized device type.
Numeric constants default to decimal, but may be specifyed with a leading 00
prefix to specify an octal number or a 00xx prefix to specify a hexadecimal
number.
The size of the altered _s_y_m_b_o_l field is, by default, ssiizzeeooff(iinntt). ppaattcchh
recognizes the following explicit size overrides:
:cc The size of the altered field is ssiizzeeooff(cchhaarr).
:ii The size of the altered field is ssiizzeeooff(iinntt).
:ll The size of the altered field is ssiizzeeooff(lloonngg).
:ss The size of the altered field is ssiizzeeooff(sshhoorrtt).
_E_x_a_m_p_l_e_s
The following example patches the value of kernel variable KKBBBBOOOOTT in the
nnkkbb keyboard device driver to disallow rebooting of the system via the
traditional <ccttrrll><aalltt><ddeell> key sequence. See Lexicon article nnkkbb for
details. Note that this command changes /ccoohheerreenntt on the boot device, not
the copy of /ccoohheerreenntt that is now running in memory.
/conf/patch /coherent KBBOOT=0
The second example patches the value of character variable mmyyvvaarr in user-
supplied program mmyypprroogg to hexadecimal value 12:
/conf/patch myprog myvar=0x12:c
The final example modifies the default ``root'' and ``pipe'' devices for
COHERENT-386 kernel /tteessttccoohh to be AT/IDE hard-disk partition /ddeevv/aatt00bb.
/conf/patch /testcoh 'rootdev=makedev(11,1)' 'pipedev=makedev(11,1)'
Note that in this last example, the arguments to ppaattcchh must be quoted to
avoid interpretation by the shell.
_S_e_e _A_l_s_o
ccoommmmaannddss, ddeevviiccee ddrriivveerrss
_N_o_t_e_s
No spaces can appear around the equal sign in the ssyymmbbooll=_c_o_n_s_t_a_n_t
construct.
Using ppaattcchh to modify the kernal data area of a running system is extremely
dangerous. It should only be done by experienced writers of device
drivers. _C_a_v_e_a_t _u_t_i_l_i_t_o_r!
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.