|
|
1.1 root 1: ppaattcchh -- Command
2:
3: /ccoonnff/ppaattcchh [-kkKKppvv] _i_m_a_g_e _s_y_m_b_o_l=_v_a_l_u_e ...
4:
5: The command ppaattcchh alters the value of datum _s_y_m_b_o_l to _v_a_l_u_e in executable
6: _i_m_a_g_e. In general, you should use ppaattcchh to alter configuration data
7: (constants) in programs, in device drivers, and in the COHERENT kernel.
8: For ppaattcchh to work with a symbolic constant, _i_m_a_g_e must have a symbol table
9: that includes information about _s_y_m_b_o_l. Therefore, executables that have
10: been processed by the command ssttrriipp cannot be ppaattcchhed.
11:
12: ppaattcchh recognizes the following _o_p_t_i_o_n_s:
13:
14: -kk Patch the kernel memory of the running COHERENT system via device
15: /ddeevv/kkmmeemm, as well as the _i_m_a_g_e.
16:
17: -KK Patch only the kernel's data memory of the running system via device
18: /ddeevv/kkmmeemm.
19:
20: -pp Display (peek at) the current values of the specified variables, but
21: do not change them.
22:
23: -vv Verbose. Display the values of the specified variables before and
24: after patching.
25:
26: Only the superuser rroooott can access kernel memory from the ppaattcchh command.
27:
28: Both _s_y_m_b_o_l and _v_a_l_u_e may consist of numeric constants or a symbol from the
29: symbol table of _i_m_a_g_e.
30:
31: Please note that the COHERENT 286 kernel references variables with a
32: trailing underscore character; for example, aattppaarrmm_. The COHERENT 386
33: kernel, however, does _n_o_t use a trailing underscore; for example, aattppaarrmm.
34: The following descriptions apply to both COHERENT 286 and COHERENT 386, but
35: the notation will be in the COHERENT-386 form.
36:
37: _s_y_m_b_o_l and _v_a_l_u_e expressions may include an optional numeric offset. In
38: addition, the _v_a_l_u_e field may optionally be composed of the construct
39: 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''
40: device numbers, respectively, resulting in a ddeevv_tt-sized device type.
41:
42: Numeric constants default to decimal, but may be specifyed with a leading 00
43: prefix to specify an octal number or a 00xx prefix to specify a hexadecimal
44: number.
45:
46: The size of the altered _s_y_m_b_o_l field is, by default, ssiizzeeooff(iinntt). ppaattcchh
47: recognizes the following explicit size overrides:
48:
49: :cc The size of the altered field is ssiizzeeooff(cchhaarr).
50:
51: :ii The size of the altered field is ssiizzeeooff(iinntt).
52:
53: :ll The size of the altered field is ssiizzeeooff(lloonngg).
54:
55: :ss The size of the altered field is ssiizzeeooff(sshhoorrtt).
56:
57: _E_x_a_m_p_l_e_s
58: The following example patches the value of kernel variable KKBBBBOOOOTT in the
59: nnkkbb keyboard device driver to disallow rebooting of the system via the
60: traditional <ccttrrll><aalltt><ddeell> key sequence. See Lexicon article nnkkbb for
61: details. Note that this command changes /ccoohheerreenntt on the boot device, not
62: the copy of /ccoohheerreenntt that is now running in memory.
63:
64: /conf/patch /coherent KBBOOT=0
65:
66: The second example patches the value of character variable mmyyvvaarr in user-
67: supplied program mmyypprroogg to hexadecimal value 12:
68:
69: /conf/patch myprog myvar=0x12:c
70:
71: The final example modifies the default ``root'' and ``pipe'' devices for
72: COHERENT-386 kernel /tteessttccoohh to be AT/IDE hard-disk partition /ddeevv/aatt00bb.
73:
74: /conf/patch /testcoh 'rootdev=makedev(11,1)' 'pipedev=makedev(11,1)'
75:
76: Note that in this last example, the arguments to ppaattcchh must be quoted to
77: avoid interpretation by the shell.
78:
79: _S_e_e _A_l_s_o
80: ccoommmmaannddss, ddeevviiccee ddrriivveerrss
81:
82: _N_o_t_e_s
83: No spaces can appear around the equal sign in the ssyymmbbooll=_c_o_n_s_t_a_n_t
84: construct.
85:
86: Using ppaattcchh to modify the kernal data area of a running system is extremely
87: dangerous. It should only be done by experienced writers of device
88: 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.