After reading this question, I was a little confused; it sounds like some daemon reacting by rebooting a system. Is that right? Is it a common occurrence in embedded *nixes?
Watchdog Reset – What is a Watchdog Reset?
embeddedkernelwatchdog
Related Solutions
If you have a watchdog on your system and a driver that uses /dev/watchdog
, all you have to do is kill the process that is feeding it; if there is no such process, then you can touch /dev/watchdog
once to turn it on, and if you don't touch it again, it will reset.
You also might be interested in resetting the device using the "magic sysrq" way. If you have a kernel with the CONFIG_MAGIC_SYSRQ
feature compiled in, then you can echo 1 > /proc/sys/kernel/sysrq
to enable it, then echo b > /proc/sysrq-trigger
to reboot. When you do this, it reboots immediately, without unmounting or or syncing filesystems.
Distribution kernel-header
packages contain, as their name implies, only kernel header files (plus the necessary plumbing) that are required to build software like kernel modules.
You shouldn't expect to find binary files at all in a kernel source directory, except for build output. (If you configure and build a kernel yourself, the kernel source directory will also contain the compiled objects, modules, the built kernel itself and a few other binary bits and pieces that make it work.)
KConfig
files are a description of the kernel configuration options (and their dependencies) that are available for a given directory/module.
Apart from that, it's all (mostly) C source code, header files and Makefile
s. There are a few helper scripts here and there, and assembly source too.
Header packages (what you installed) only contain the header part of the above (and not all of that - only the "exported" headers), and some of the build infrastructure. So what you are seeing is expected. Header packages do not contain C source code (except for some stubs and build infrastructure code). The whole point of having this type of package is to save space (and bandwidth) - the whole Linux kernel source tree is rather large, and completely unnecessary if you don't intend to compile the kernel yourself. The header packages are built and shipped by distributions to provide just the right things necessary to build modules, but no more. (They certainly do not contain the compiled kernel.)
Addressing your comment: header packages don't relocate anywhere. They are built for specific versions of the kernel, packaged in a specific directory, and that's that. It's just a set of files. (Note that the header packages don't necessarily have the same version as the current stable kernel binary packages - the header packages are generic, and can lag behind the actual kernel you're running. They should not, however, be from a kernel version that is more recent than the current installed (or target) kernel.)
Installed kernel binaries are usually installed in the /boot
directory, along with bootloader binaries and configuration files. (This is sometimes an independent filesystem, not mounted by default.) The exact name of the files depends on the kernel and distribution. (So does the bootloader.)
Installed kernel modules reside in sub-directories of:
/lib/modules/`uname -r`/
So for instance on my system, they are currently in
/lib/modules/3.1.4-gentoo/
Full kernel source code: On Ubuntu, if you want the full kernel sources to build a kernel yourself, you should install following the instructions here.
You could also download a source tarball from kernel.org
and unpack it somewhere (do not overwrite Ubuntu-installed files if you use this tarball, keep your personal stuff and the stuff managed by RPM separate).
/usr/src/linux
is a traditional place to put kernel sources, but nothing prevents you from putting kernel sources elsewhere. This path is also often just a symbolic link to a directory. e.g. I have this on my machine:
$ ls -l /usr/src/linux
lrwxrwxrwx 1 root root 18 Dec 7 17:03 /usr/src/linux -> linux-3.1.4-gentoo
The symlink is there to simplify building applications that depend on the kernel source. You link that path to your running (or target) kernel so that you don't have to specify exact version or path information when you build a module out-of-tree. Helps a bunch for source-based distributions at least.
Best Answer
Having a watchdog on an embedded system will dramatically improve the availability of the device. Instead of waiting for the user to see that the device is frozen or broken, it will reset if the software fails to update at some interval. Some examples:
The device is designed in such a way that its state is saved somewhere periodically(like Juniper routers that run FreeBSD, Android phones, and dvrs that run linux). So even if it is rebooted it should re-enter a working configuration.