[pso] [tema2][linux] Cannot trigger RDAI
Alexandru Tudose
alexandru.tudose at gmail.com
Thu Apr 19 15:11:44 EEST 2007
- am setat masina virtuala ca com1 si com2 sa fie legate si am testat cu
(cum este descris la FAQ):
# cd /usr/src/linux
# make menuconfig
# make modules
# insmod drivers/serial/serial_core.ko
# insmod drivers/serial/8250.ko
# cat /dev/ttyS1
# echo "hello" > /dev/ttyS0
si merge ok; deci i guess ca serialele sunt configurate cum trebuie.
- am configurat porturile cele doua porturi cum este descris in
http://www.beyondlogic.org/serial/buff1024.c :
outb(0x00, devs[ i ].baseport + 1); /* Turn off interrupts -
UART16550_BASEPORT1 */
outb(0x80, devs[ i ].baseport + 3); /* SET DLAB ON */
outb(0x0c, devs[ i ].baseport + 0); /* Set Baud rate - Divisor
Latch Low Byte */
outb(0x00, devs[ i ].baseport + 1); /* Set Baud rate - Divisor
Latch High Byte */
outb(0x03, devs[ i ].baseport + 3); /* 8 Bits, No Parity, 1 Stop
Bit , SET DLAB OFF*/
outb(0xc7, devs[ i ].baseport + 2); /* FIFO Control Register */
outb(0x0b, devs[ i ].baseport + 4); /* Turn on DTR, RTS, and OUT2
*/
outb(0x03, devs[ i ].baseport + 1 ); /* Interrupt when data
received */ // RDAI && THREI = 0x03
- am atasat un handler de interrupt liniilor 4 si 3
- in momentul cand primesc un write pe com1, depun datele in buffer, dupa
care reactivez intreruperea de THREI:
outb( 0x02, dev->baseport + 1 );
- primesc THREI, iar in handler scriu totul intr-un while cu:
outb( devs[ i ].baseport, _next_char_ );
Problema este ca oricum a-si da-o, nu primesc RDAI pe parte cealalta cand
fac un echo pe com1 :-(((
M-ai putea ajuta cu o idee pls?
Multumesc mult!
Alex.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cursuri.cs.pub.ro/pipermail/pso/attachments/20070419/03e31d28/attachment.html
More information about the pso
mailing list