UNIX V6 dump analysis
There are two kinds of dump analysis on UNIX V6, with some overlap between the two.
The first is of the 'core dump' of an individual process into a file, created either by a user's request (typing '^\' in standard V6), or by any of the error conditions (odd address, etc) which cause a process abort and core dump.
The second is of a dump of the complete main memory of a PDP-11 running Unix; the system as distributed only supports doing such dumps to magnetic tape. This can be done either after the OS does a 'panic', which it does when something happens it can't recover from; or after halting the CPU.
Unix stores almost all of the writeable data of a process - both the swappable data 'belonging' to the kernel (consisting of per-process data, kept in a 'user' structure, and the per-process kernel stack), as well as the user's data (both the data area, and the user stack) in a single contiguous block in main memory, and they are all always moved in and out (by swapping, or in a process core dump) as a unit.
The order of the layout within that is:
- 'user' structure
- kernel stack
- user data
- user stack
Note that although the user data and stack are contiguous in physical memory (and thus in a core dump, of either kind), they are not contiguous in the process virtual address space; the PDP-11 Memory Management separates them there.
For information about the memory layout of the kernel itself, see Unix V6 kernel memory layout.
Kernel stack top
|14||Index (trap type, or device number)|
|16||Return PC from call to trap() (value depends on contents of l.s)|
The offset is from the top of the karnel stack, and is negative from there. In a process core dump, this starts at 01776 in the core dump file; in a dump of main memory, it is necessary to know the contents of kernel segment 6's address register, and the kernel stack top is 01776 above the location pointed to by that.
Swappable per-process data
The per-process data kept in the 'user' structure are included in both a process core dump (where they are found at the start of the 'core' file), as well as a system dump (where runnable processes loaded into main memory can be located via their entries in the process table); the data in this structure may be of relevance and interest.
The offsets of the various fields in the structure are:
(See the file 'user.h' for the meanings/contents of the various fields.)