Results 1 to 2 of 2
Hi
I know how you all love a challenge. I'm trying to test a hardware watchdog on an embedded board running ubuntu by freezing/crashing the kernel.
An example for doing ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 09-18-2012 #1Just Joined!
- Join Date
- May 2012
- Posts
- 9
How to test a hardware watchdog
Hi
I know how you all love a challenge. I'm trying to test a hardware watchdog on an embedded board running ubuntu by freezing/crashing the kernel.
An example for doing this in 1998 is shown here lkml.indiana.edu/hypermail/linux/kernel/9810.2/0135.html]Linux-Kernel Archive: Re: Testing watchdog timer card...?
This is what it gives I've saved it as hang-kernel.c
---------------------
#include <linux/module.h>
#include <linux/version.h>
#include <asm/io.h>
int init_module(void)
{
cli();
for(;
--- <--- for some reason this forum isn't showing whats here "for open bracket two semicolons closed bracket"
;
return 0;
}
void cleanup_module(void)
{
}
--------------------------
I've hacked together a Makefile from info from elsewhere which I've include here. I've no idea if this is correct.
################################################## ###########################
#
# Makefile for building the hang-kernel kernel module
#
################################################## ###########################
#ifneq ($(KERNELRELEASE),)
# call from kernel build system
obj-m := hang-kernel.o
#else
PWD = $(shell pwd)
CROSS_COMPILE ?= /embedded/toolchains/bctre2/bin/arm-none-linux-gnueabi-
KERNEL_PATH ?= /embedded/projects/bctre2/linux-2.6.38.8bctre2
ARCH ?= armel
export ARCH CROSS_COMPILE
KBUILD_FLAGS = -C $(KERNEL_PATH) M=$(PWD)
default: modules
modules:
echo $(MAKE) $(KBUILD_FLAGS) modules
$(MAKE) $(KBUILD_FLAGS) modules
clean:
rm -rf *.o *~ *.ko *.mod.c .*.cmd .tmp* modules.order Module.symvers
#endif
when I type "make"
This is the errors I receive
..../hang-kernel.c: In function 'init_module'
..../hang.kernel.c:10:1: error: implicit declaration of function 'cli'
..../hang-kernel.o] Error 1
..../hang-kernel] Error 2
the dots are just the path to the location that the hang-kernel.c and Makefile are located.
As I've no idea how the original program works, does cli mean clear all interrupts, googling cli just gives command line interface which is something completely different.
Any suggestions on how to get the above to compile so I can use this to test the watchdog, or an alternative method of freezing linux so that a watchdog can be tested would be appreciated.
Thanks
Bullfrog
- 09-30-2012 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 10,144
To display code properly, you need to use code blocks, as in:
Put ALL of your code in code blocks like this, including your Makefile, then repost.Code:// This is some C++ code class foo { public: foo(); foo(const foo&); ~foo(); };Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote
