|
|
各位大侠:
最近需要对看门狗进行编程, 我看了网上的资料写了一段:
- #include <stdio.h>
- #include <asm/io.h>
- #define WATCHDOG 0x443
- int restart_watchdog()
- {
- // start or restart watchdog and setting timer
- outb(0x10, WATCHDOG);
- }
- int main(void)
- {
- // open watchdog
- if (ioperm(WATCHDOG, 1, 1))
- {
- perror("ioperm");
- exit(1);
- }
-
- for (i=0; i<11; i++)
- {
- restart_watchdog();
-
- sleep(i);
-
- printf("i: %d \n", i);
- }
- }
复制代码
可是每次我执行程序的时候都是 ioperm: Invalid argument 错误.
我已经在 BIOS 里面把 WDT 给 Enabled 了, 可是还是这个错误, 我尝试打开其他地址(0x2ef)的时候没有问题.
请问各位, 会是什么原因无法打开看门狗的地址 0x443 |
|