如何让com口工作在中断模式:
1, 在8259中把com口对应的中断打开
2, MCR BIT3(OUT2)设1(X86架构)
3, IER 把需要的中断置起来,
如何让com口工作在FIFO模式:
1。设置FCR BIT0让COM知道下面是设置FIFO模式的命令。
2。设置FCR BIT7-BIT6 来决定缓冲大小
0 0 1byte
0 1 4byte
1 0 8byte
1 1 14byte
3. 设置FCR BIT3来 启动FIFO模式
下面这段代码就是初始化COM口,并工作在FIFO模式。
Sample Code
; Set IRQ enable and out2 to set enable interrupts
mov cl, COM_IRQ ;
mov dx, 21h
cmp cl,7 ; judge IRQ > 7
jbe short wlsp_00
mov dx, 0a1h
sub cl, 8
wlsp_00