DA-681 Linux
Software Configuration
2-14
MOXA:~# df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 790M 219M 531M 30% /
udev
10M 44K 10M 1% /dev
/dev/hdb1 790M 219M 531M 30% /
/dev/hdb1 790M 219M 531M 30% /dev/.static/dev
tmpfs 248M 0 248M 0% /dev/shm
none 248M 13M 236M 6% /tmp
/dev/mtdblock0 161M 25M 136M 16% /home
MOXA:~#
ATTENTION
You can free up the cache space with the command # apt-get clean
MOXA:~# apt-get clean
MOXA:~#
WDT (Watchdog Timer)
1.
Introduction
The WDT works like a hardware timing device that triggers a system reboot whenever necessary. You can
enable it or disable it. When users enable WDT but the application does not acknowledge it, the system will
reboot. You can set the ack time from a minimum of 1 sec to a maximum of 60 seconds.
2.
How the WDT works
The watchdog is enabled when the system boots up. The kernel will auto ack it. The user application can
also enable ack. When users do not ack, it will let the system reboot.
3.
The user IO control commands
The user application can program the watchdog via below IO control commands.
// Enable the user mode watchdog driver
#define IOCTL_SWATCHDOG_ENABLE
1
// Disable the user mode watchdog driver
#define IOCTL_SWATCHDOG_DISABLE 2
// Get the driver mode and timeout information
#define IOCTL_SWATCHDOG_GET 3
// Acknowledge the user mode watchdog driver
#define IOCTL_SWATCHDOG_ACK 4
User application can programming the watchdog like this.
main() {
…
swtd_fd=open(“/dev/swtd”, O_RDWR)
…
time=4000; //4000 ms
ioctl(swtd_fd, IOCTL_SWATCHDOG_ENABLE, &time);
…
while(1) {
…