Rev 143 | Rev 150 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 143 | Rev 144 | ||
|---|---|---|---|
| Line 11... | Line 11... | ||
| 11 | for applications, console 12 is reserved for kernel console. Pressing |
11 | for applications, console 12 is reserved for kernel console. Pressing |
| 12 | function keys F1-F12 switches between the consoles. |
12 | function keys F1-F12 switches between the consoles. |
| 13 | 13 | ||
| 14 | \section{KConsole} |
14 | \section{KConsole} |
| 15 | KConsole is a kernel thread operating completely in priviledged mode. |
15 | KConsole is a kernel thread operating completely in priviledged mode. |
| 16 | It allows user to interact directly with kernel and even start directly |
16 | It allows user to interact directly with the kernel and even start directly |
| 17 | functions inside the kernel. |
17 | functions inside the kernel. |
| 18 | 18 | ||
| 19 | The KConsole is shown by switching to console number 12. On some platforms |
19 | The KConsole is shown by switching to console number 12. On some platforms |
| 20 | the kconsole screen is not restored to its previous contents. Press |
20 | the kconsole screen is not restored to its previous contents. Press |
| 21 | enter to see a KConsole prompt. The function keys for switching terminals |
21 | enter to see a KConsole prompt. The function keys for switching terminals |
| 22 | do not work in KConsole, if you want to switch back to other console, use |
22 | do not work in KConsole, to switch back to other console, use |
| 23 | the {\em continue} command. After executing the command, press a function key |
23 | the {\em continue} command. After executing the command, press a function key |
| 24 | to switch to other consoles. |
24 | to switch to other consoles. |
| 25 | 25 | ||
| 26 | The basic editing facilities are very similar to {\em readline} conventions. |
26 | The basic editing facilities are very similar to {\em readline} conventions. |
| 27 | The left and right arrows, backspace and delete keys allow for convenient |
27 | The left and right arrows, backspace and delete keys allow for convenient |
| Line 29... | Line 29... | ||
| 29 | using up and down arrows. KConsole supports tab completion, double tab |
29 | using up and down arrows. KConsole supports tab completion, double tab |
| 30 | shows a list of available commands. |
30 | shows a list of available commands. |
| 31 | 31 | ||
| 32 | The first class of commands prints useful statistics from the running |
32 | The first class of commands prints useful statistics from the running |
| 33 | operating systems. The commands are: |
33 | operating systems. The commands are: |
| - | 34 | \begin{description} |
|
| 34 | - zones - Prints a list of memory zones. |
35 | \item[zones] --- Prints a list of memory zones. |
| 35 | - zone <zone number> - Prints a detailed statistics about frame allocator. |
36 | \item[zone $<$zone number$>$] --- Prints a detailed statistics about frame allocator. |
| 36 | - slabs - Prints a details statistics about slab allocator. |
37 | \item[slabs] --- Prints a details statistics about slab allocator. |
| 37 | - scheduler - Prints scheduler queues on all cpus. |
38 | \item[scheduler] --- Prints scheduler queues on all cpus. |
| 38 | - threads - Prints list of existing threads, including information about |
39 | \item[threads] --- Prints list of existing threads, including information about |
| 39 | the thread state/ |
40 | the thread state |
| 40 | - tasks - Prints list of tasks along with some basic IPC informations. |
41 | \item[tasks] --- Prints list of tasks along with some basic IPC informations. |
| 41 | - ipc_tasks - Prints detailed information about IPC queues of a particular task. |
42 | \item[ipc\_task $<$taskid$>$] --- Prints detailed information about IPC queues of a particular task. |
| 42 | - tlb - Prints contents of the Translation Lookaside Buffer on a processor (supported only on some platforms) |
43 | \item[tlb] --- Prints contents of the Translation Lookaside Buffer on a processor (supported only on some platforms) |
| 43 | - exc - Prints table of registered exception handlers |
44 | \item[exc] --- Prints table of registered exception handlers |
| - | 45 | \end{description} |
|
| 44 | 46 | ||
| 45 | Kernel contains a searchable version of its symbol table. This is used |
47 | Kernel contains a searchable version of its symbol table. This is used |
| 46 | in error processing as well as for extending functionality of KConsole. |
48 | in error processing as well as for extending functionality of KConsole. |
| 47 | The following commands are supported: |
49 | The following commands are supported: |
| - | 50 | \begin{description} |
|
| 48 | - symaddr <address> - Finds an address in symbol table and prints appropriate |
51 | \item[symaddr $<$address$>$] --- Finds an address in symbol table and prints appropriate |
| 49 | symbol name. |
52 | symbol name. |
| 50 | - call0, call1... <function> <args...> - Calls a C function function(args...). |
53 | \item[call0, call1... $<$function$>$ $<$args...$>$] --- Calls a C function function(args...). |
| 51 | Note that the tab-completion works for the function names. Because |
54 | Note that the tab-completion works for the function names. Because |
| 52 | of architecture calling convention, this command does not work correctly |
55 | of architecture calling convention, this command does not work correctly |
| 53 | on the ia64 platform. The arguments can be specified |
56 | on the ia64 platform. The arguments can be specified |
| - | 57 | \begin{itemize} |
|
| 54 | - as a number or hexadecimal number: call1 task_kill 8 |
58 | \item as a number or hexadecimal number: call1 task\_kill 8 |
| 55 | - as a string: call1 printf "Hello world" |
59 | \item as a string: call1 printf "Hello world" |
| 56 | - as a hexadecimal number preceded by '*'. The argument is then read from |
60 | \item as a hexadecimal number preceded by '*'. The argument is then read from |
| 57 | the given address: call2 printf "%X" *0x8000000 |
61 | the given address: call2 printf "%X" *0x8000000 |
| 58 | - as a symbol name. In such case the value located in the memory |
62 | \item as a symbol name. In such case the value located in the memory |
| 59 | in the symbols address is used: call2 printf "%d" task_counter |
63 | in the symbols address is used: call2 printf "%d" task_counter |
| 60 | - as a symbol name preceded by '&'. The address is used. |
64 | \item as a symbol name preceded by '\&'. The address is used. |
| 61 | - as a symbol name preceded by '*'. In such a case the symbol is dereferenced. |
65 | \item as a symbol name preceded by '*'. In such a case the symbol is dereferenced. |
| - | 66 | \end{itemize} |
|
| 62 | - set4 <address|symbol name> - Saves 4-byte value on a given address. |
67 | \item[set4 <address|symbol name>] --- Saves 4-byte value on a given address. |
| - | 68 | \end{description} |
|
| 63 | 69 | ||
| 64 | The mips, ia32 and amd64 platforms provide additional commands regarding |
70 | The mips, ia32 and amd64 platforms provide additional commands regarding |
| 65 | debugging facility - set and clear hardware breakpoints and watchpoints. |
71 | debugging facility - set and clear hardware breakpoints and watchpoints. |
| 66 | 72 | ||
| 67 | \section{Emergency Functions} |
73 | \section{Emergency Functions} |
| Line 74... | Line 80... | ||
| 74 | 80 | ||
| 75 | If a kernel panic occurs, the error handling automatially switches control |
81 | If a kernel panic occurs, the error handling automatially switches control |
| 76 | to the KConsole and allows users to inspect the failed kernel online. |
82 | to the KConsole and allows users to inspect the failed kernel online. |
| 77 | On the SMP system the other processors are halted immediately. The kernel |
83 | On the SMP system the other processors are halted immediately. The kernel |
| 78 | contains its symbol table, so you can probably read some useful information |
84 | contains its symbol table, so you can probably read some useful information |
| 79 | about the exact place where the panic occured. |
- | |
| 80 | 85 | about the exact place where the panic occured. |
|
| - | 86 | ||