Basic System Problem Analysis - August 2003

31
Dispatcher Structures
These are not the only dispatcher structures but they are worth mentioning in this context.
The TCB, or task control block rates a special mention because it is the structure use to
save process state when a process looses the CPU.
It is kept in real memory but is “equivalently mapped” meaning that it is given an address
in space 0 at the same offset it occupies in real memory.
The TCB function will return the real memory address of a TCB for a given PIN. You
cannot format real memory using the FV command. Since the TCB is equivalently
mapped into space 0 you can supply that creating a virtual address from the real address
returned by the TCB function, for example:
$217 ($70) nmdat > wl TCB(pin)
$8c01d00
$218 ($70) nmdat > fv 0.TCB(pin) 'TCB_TYPE'
RECORD
STACK_BASE : 41854000
STACK_LIMIT : 418b4000
STK_ADDR_NOT_IN_CACHE : 418aa000
Another useful thing to note about the TCB is that since it stores state information about a
process it can use used in a dump to restore that state. That is, you can try to rewind a
process to the state it was in the last time it lost the CPU. For example:
$219 ($70) nmdat > tr,d,i
PC=a.0019fe78 system_abort
NM* 0) SP=418562e0 RP=a.00a51bc8 sm_quarantine_gufd+$1fc
NM 1) SP=418562e0 RP=a.00ee5a5c
tm_close_common.tm_unlink_plfd_and_gdpd+$184
NM 2) SP=418558e0 RP=a.00ee75cc tm_close_common+$1a98
NM 3) SP=41855860 RP=a.0158a8e4 tm_ord_fix_buf_disc+$1e4
NM 5) SP=418547e0 RP=a.01163d68 ?fclose_nm+$8
$21a ($70) nmdat > initnm tcb
$21b ($70) nmdat > tr,d,i
PC=a.00394f78 $$lr_wa_14_long
NM* 0) SP=418565a0 RP=a.010722c0 sd_log_data+$504
NM 1) SP=418565a0 RP=a.01072ca8 sdump_data+$108
NM 2) SP=418564a0 RP=a.009d6140 sdump_dump_navigation_structure+$328c
NM 3) SP=418563e0 RP=a.00a51b98 sm_quarantine_gufd+$1cc