wendyzh 发表于 2009-9-2 10:35:23

bypass功能

搞到了一块支持bypass功能的主板,想测试bypass功能,可是不太会编程呀,看了一下文档,bypass功能倒好搞,可是watchdog功能就比较麻烦了,不是很懂。想请假老大们,能否共享一下adt_bpctrl和adt_monitor程序的源代码,我改造一下。


Set “High” sample code (Assembly):
mov dx,GPIO_Port + 38h ;GPIO_Port is 480h
in al,dx
newiodelay
or al,11000000b ;GPIO 38, 39 pull high to enable
out dx,al
Set “High” sample code (C Language):
//Set High
unsigned char dataIn;
unsigned char dataOut;
dataIn = inportb(0x480+0x38);
dataIn |= 0xc0;
outportb(dataIn, 0x480+0x38);


Watch Dog Function:
Support 1~255 second or minute selectable timeout interval.
Watch Code:
1) Enter configuration mode:
MOV DX,4EH
MOV AL,87H
OUT DX,AL
OUT DX,AL
2) Logical Device 8
MOV DX,4EH
MOV AL,07H
OUT DX,AL ;point to Logical Device Number Reg.
MOV DX,2FH
MOV AL,08H ;select Logical Device 8
OUT DX,AL
3) Enable WDTO# and set to KBRST#
MOV DX,2EH ;CR 30h: bit0 fill in 1
MOV AL,30H
OUT DX,AL
MOV DX,2FH
MOV AL,01H
OUT DX,AL
MOV DX,2EH ; CR F7h: bit4 fill in 0(clear event)
MOV AL,F7H
OUT DX,AL
MOV DX,2FH
2-19
Hardware Setup
IN DX,AL
AND AL,0F7H
OUT DX,AL
;CR F6h: bit0~7 fill in counter time
;CR F5h: bit1 fill in 1(Enable WDTO# & KBRST#)
Bit 3 (0: Second Mode,1:Minute Mode)
4) Exit configuration mode:
MOV DX,4EH
MOV AL,0AAH
OUT DX,,AL

wendyzh 发表于 2009-9-3 08:02:46

老大们为什么没有回答,必须专业版才能回答这些问题吗

wusiye1986 发表于 2011-5-6 03:24:18

必须回帖。。。今天整了一天的c语言,一头雾水~~~前几天刚买到支持bypass的网卡。也得到了硬件代码....但是在程序编写和编译卡住了,编写完了又怎么样编译成FREEBSD下的程序?各种不懂
页: [1]
查看完整版本: bypass功能