2010年1月3日 星期日

Linux Serial Console

8250.c的interrupt handler

serial8250_interrupt


On booting
console_init -> con_init -> serial8250_console_init -> register_console -> release_console_sem


Kernel mode
release_console_sem 會把要印的東西直接丟進serial port,而printk也會呼叫release_console_sem,所以每次呼叫printk都會直接的把結果印到console上

printk -> vprintk -> release_console_sem -> __call_console_driver -> (tty) vt_console_print -> ... -> (ttyS) serial8250_console_write -> uart_console_write -> serial8250_console_putchar
-> serial_out ----> mem_serial_out
-> serial_in ----> mem_serial_in


run_timer_softirq -> __run_timers -> serial8250_backup_timeout

User mode
沒追
user mode要印的訊息應該是由/dev/ttyS寫進來然後 (.....) 最後在serial8250_interrupt -> serial8250_handle_port -> transmit_chars裡被印出來



Serial Drivers
http://www.linux.it/~rubini/docs/serial/serial.html

Interfacing the Serial / RS232 Port
http://www.beyondlogic.org/serial/serial.htm

Serial Programming HOWTO
http://tldp.org/HOWTO/Serial-Programming-HOWTO/

Linux Serial Console HOWTO
http://www.vanemery.com/Linux/Serial/serial-console.html

河馬工作室: Linux Serial Driver 系統架構 (ref to other articles)
http://riverhippo.blogspot.com/2007/06/linux-serial-driver.html

河馬工作室: Linux Serial Port Programming (ref to other articles)
http://riverhippo.blogspot.com/2007/06/linux-serial-port-programming.html

沒有留言: