For problems or questions, please e-mail lkst-develop@lists.sourceforge.net
For bugs, please submit a bug via the project page:

https://sourceforge.net/projects/lkst/


Prerequisites 
=============

1. Linux Kernel State Tracer software:
   lkst-1.3.tar.gz can be downloaded from the project page.

2. Linux kernel version 2.4.17 -
   linux-2.4.17.tar.gz can be downloaded from  
     ftp.kernel.org/pub/linux/kernel/v2.4 

Installation
============

0) Prepare archives
------------------------------------------------------------
1. cd $(SOMEWHERE_LKST)

2. Untar the LKST archive
    tar -xzvf  lkst-1.3.tar.gz

3. cd $(SOMEWHERE_KERNEL)

4. Untar Linux source 
    tar -xzvf  linux-2.4.17.tar.gz

1) Build and Install Kernel patch for kernel versions 2.4.17
------------------------------------------------------------
1. Log in as root

2. Issue command to patch kernel for LKCD
     cd $(SOMEWHERE_KERNEL)/linux
     patch -p 1 < $(SOMEWHERE_LKST)/lkst/lkcd-addon/lkcd-4.1-1.patch

3. Issue command to patch kernel for LKST
     cd $(SOMEWHERE_KERNEL)/linux
     patch -p 2 < $(SOMEWHERE_LKST)/lkst/linux24.patch

4. Build kernel
    a. make menuconfig
    b. Under "Kernel hacking", select the following:
      i. Select "y" for "Linux Kernel Crash Dump (LKCD) Support".
     ii. Select "y" for "Kernel debugging".
    iii. Select "y" for "Magic SysRq key".
     iv. Select "m" for "Kernel State Tracing (LKST)".
      v. Configure other kernel config settings as needed. 
    c. Save and Exit
    d. make dep
    e. make clean
    f. make bzImage
    g. make modules
    h. make modules_install
        
5. cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.17-lkst13

6. cp System.map /boot/System.map-2.4.17-lkst13

7. rm /boot/System.map 

8. ln -s /boot/System.map-2.4.17-lkst13 /boot/System.map

9. cp Kerntypes /boot/Kerntypes-2.4.17-lkst13

10. ln -s /boot/Kerntypes-2.4.17-lkst13 /boot/Kerntypes

11. Modify /etc/lilo.conf to boot from /boot/vmlinuz-2.4.17-lkst13

12. Run /sbin/lilo to read modified lilo.conf

13. reboot


2) Install the lkcdutils tools
------------------------------------------------

1. Log in as root

2. cd $(SOMEWHERE_LKST)/lkst/lkcd-addon/lkcdutils

3. Build userspace tools

   a. ./configure --topdir=$(SOMEWHERE_KERNEL)/linux
   b. make
   c. make install


3) Install the userspace tools
--------------------------------------

1. Log in as root

2. cd $(SOMEWHERE_LKST)/lkst/command

3. Build userspace tools

   a. autoconf
   b. ./configure --with-ksrc=$(SOMEWHERE_KERNEL)/linux --mandir=/usr/share/man
   c. make
   d. make install

IMPORTANT!!!
You must build them after the kernel was built and lkcdutils is installed.
They use new include files and configurations which are included in the kernel
patch.


4) Install addon tools [Optional]
------------------------------------------------

1. Log in as root

2. cd $(SOMEWHERE_LKST)/lkst/addons

3. Build and install

   a. autoconf
   b. ./configure --with-ksrc=$(SOMEWHERE_KERNEL)/linux
   c. make
   d. make install

IMPORTANT!!!
Also You must build them after the kernel was built. 

5) Configure your system
------------------------
To load lkst module, issue following command:

       insmod lkst

If you want to configure lkst module, you will need to add the following lines
to /etc/modules.conf(or /etc/conf.modules):

       alias lkst lkst
       options lkst lkst_init_buffer_size=65536

Also see the following section on the module parameter. 

NOTE: For the configuration of LKCD, see LKCD documents which can be downloaded at
      http://lkcd.sourceforge.net/

5) Kernel parameter
---------------------
The following kernel parameter can be passed:

      lkst_maxvm=

Use integer value for LKST available memory size.
Users can use up to this value as amount of memory size for LKST.
If omitted, 1/10 of physical memory size can be used.

6) Module parameter
---------------------
The following module parameter can be passed:

      lkst_init_buffer_size= 

Use integer value for logging buffer size(in byte). You can use the value
larger than 8192. Default value is 65536. If amount of buffer size is larger
than LKST available memory described above, the size is set as default value.

     example: insmod lkstmod lkst_init_buffer_size=1048576

NOTE!!!
If you specify a value, kernel memory will be used by the value.
So you may avoid specifying large value.
