Because it is a software watchdog, his role can only be considered as a helper tool.
However, its function should be meaningless.
The implementation plan of this software is as follows:
1. Software form
A module soft_wdt.ko runs in the kernel.
2. software startup Method
Insmod soft_wdt.ko Dev =/dev/soft_wdt timeout = 5 log =/path/to/log.txt
These parameters are: device files to be exposed to users, dog Feed interval, log file path
More parameters may be supported in the future
3. Target customers
Independent user-state threads.
4. Usage
Which thread needs to check the door service and open the device file, such as/dev/soft_wdt. Write Data to/dev/soft_wdt at regular intervals.
A thread can write special data, such as setting the thread name and interval.
If a dog is not fed to any thread for a long time, soft_wdt.ko records the log (including the executable program name, thread name, and time interval) and restarts the system.
5. Development and testing platform
Use an arm board at hand and corresponding software systems, including the kernel source code and cross-compilation tool chain.
A program for implementing a Software Watchdog