README for Mini Kernel Dump
Support kernel version and architechture
----------------------------------------
- kernel 2.6.9
- i386, x86_64
Make mini dump kernel
---------------------
1) apply the patch "minik-2.6.9-1.0.patch" to the kernel 2.6.9
# cd /usr/src/linux-2.6.9-minik
# patch -p1 < minik-2.6.9-1.0.patch
note: to construct a mini kernel, use 2.6.9
note: ignore arch/x86_64/kernel/head.S, setup.c, setup64.c, and
arch/x86_64/boot/compressed/head.S reject. it is a cvs "Id"
related problem.
2) configration
# make menuconfig
to make small kernel:
- must not SMP
- must not SWAP
- not NETWORK
- no filesystem need
- select block device driver at your system statically
note: if your machine does not support PAE (ex. Pentium M),
config as follows.
General setup -->
[*] Make dump mini kernel
[ ] --- Run the mini kernel on PAE mode (default) (i386)
^ not check this box.
3) make
# make bzImage
note: not use bzImage with mkexec, but use arch/i386/boot/compressed/vmlinux.bin
4) to run the mini kernel stand alone (only for test)
It is available to run the mini kernel stand alone. In this case use bzImage.
Specify "mem=" and "dump_dev=" options. For example of grub/menu.lst,
------------
title Linux-2.6.9minik
kernel (hd0,7)/boot/vmlinuz-2.6.6minik mem=8M dump_dev=0x300007
-----------
The load address of the mini kernel (and so on) is hard coded in
arch/[i386|x86_64]/boot/compressed/head.S. Please check before do test.
caution: for x86_64, the value of "mem=" must be specified the real value
minus 1. For example, you want to use 8MB of memory, specify as "mem=7M".
Make mkexec
-----------
1) expand "mkexec-2.6.9-1.0.taz"
# tar xvzf mkexec-2.6.9-1.0.taz
2) apply a patch to the kernel 2.6.9
# cd /usr/src/linux-2.6.9
# patch -p1 < ~/mkexec/PATCH/mkexec-v1.patch
# make menuconfig
apply same configration as the usual system
# make; make modules_install; make install
note: ignore arch/x86_64/kernel/head.S reject. it is a cvs "Id"
related problem.
3) make mkexec kernel module
# cd ~/mkexec
# vi kernel/Makefile.base
edit "KVER", "KDIR" and "KMODDIR" to your system
# ln -s asm-i386 include/asm
("ln -s asm-x86_64 include/asm" for x86_64)
# make ARCH=i386
("make ARCH=x86_64" for x86_64)
note: use kernel/mkexec.ko
Run Mini Kernel Dump
--------------------
1) load mkexec.ko
# insmod ~/mkexec/kernel/mkexec.ko
2) load mini dump kernel
# echo 4 > /proc/mkexec/mem
specify memory size of mini dump kernel. must be multiple of 4. 4 or 8 is enough.
caution: for x86_64, specify the real value minus 1. For example, you want to use
8MB of memory, type "echo 7 > /proc/mkexec/mem".
# echo "0x800012" > /proc/mkexec/dumpdev
specify the device number of the dump device. higher 12 bit is major, lower 20 bit
is minor. check device number of your device to use "ls -l".
# echo "..." > /proc/mkexec/parameter
specify kernel parameter to the mini dump kernel. this is an option.
# echo ".../vmlinux.bin" > /proc/mkexec/path
specify the mini dump kernel's birary path
# echo 1 > /proc/mkexec/stats
this causes loading the mini dump kernel's binary to the memory.
3) start the mini dump kernel
If BUG(), panic() or nmi_watchdog occurs the mini dump kernel will be initiated.
(note: for x86_64, the mini kernel is initiated at panic() only. set "panic_on_oops"
to initiate the mini kernel with BUG() and nmi_watchdog.)
To take dump manually, "echo 2 > /proc/mkexec/stats".
To do
-----
* do dump successfully when kernel stack overflow condition
* code cleanup
* support IA-64, ppc64
* follow up new kernel version
Update from the beta release 1
------------------------------
* support x86_64
* support the cpu not support PAE (ex. Pentium M)
Update from the beta release 2
------------------------------
* we check the code from crash (panic(), BUG() etc) occur to the mini kernel start
carefully, and make no deadlock or hang condition occur completely.
Update from the beta release 3
------------------------------
* Even if CONFIG_ACPI=y is specified with x86_64 architecture, mini-kernel doesn't
hang.
---
Portions Copyright 2004 NTT DATA CORPORATION.
Portions Copyright 2004 VA Linux Systems Japan K.K.