|
nckernel
0.1
|
시리얼 접근을 위한 x86 전용 함수 인터페이스를 정의한다. More...
Enumerations | |
| enum | serial_ctrl_cmd { SERIAL_CMD_BAUDRATE, SERIAL_CMD_DATA, SERIAL_CMD_STOP, SERIAL_CMD_PARITY, SERIAL_CMD_ENTER_SETUP, SERIAL_CMD_LEAVE_SETUP } |
| Serial control command. More... | |
Functions | |
| int | serial_init (void) |
| Serial 장치를 사용할 수 있도록 초기화 하는 함수 More... | |
시리얼 접근을 위한 x86 전용 함수 인터페이스를 정의한다.
Serial 과 관련된 정보는 URL: http://www.senet.com/au/~cpeacock Title: Interfacing the Serial / RS232 Port v5.0 문서를 대부분 차용하였다.
PC 를 위한 UARTS 의 종류는 다음과 같다.
8250 - First UART in this series, It contains no scratch register. The 8250A was an improved version of the 8250 which operates faster on bus side.
8250A - This UART is faster than the 8250 on the bus side, Looks exactly the same to software than 16450
8250B - Very similar to that of the 8250 UART.
16450 - Used in AT's (Improved bus speed over 8250's). Operates comfortably at 38.4KBPS. Still quite common today.
16550 - This was the first generation of buffered UART. It has a 16 byte buffer, however it doesn't work and is replaced with 16550A.
16550A - Is the most common UART use of for high speed communications eg 14.4K & 28.8K Modems. They made sure the FIFO buffers worked on this UART.
16650 - Very recent breed of UART. Contains a 32 byte FIFO, Programmable X-On / X-Off characters and supports power management.
16750 - Produced by Texas Instruments. Contains a 64 byte FIFO.
이제 Serial port 를 access 하고 초기화 하기 위해 Port In/Out 을 사용한다. Port 의 주소는 다음과 같다.
각 Port 의 Base address 를 기준으로 아래 Table 에 기록된 Offset 위치의 필요한 Register 들로 접근할 수 있다.
아래에서 Divisor Latch Low/High byte 정보를 이용해서 Serial modem 의 통신속도를 지정할 수 있다.
기본 115,200 BPS 를 원하는 Baudrate 로 나누면 Divisor Latch Low/High byte 에 설정할 값을 구할 수 있다.
즉 예를 들어 2400 BPS 의 통신 속도를 원한다면, Divisor = 115200 / 2400 이 된다.
Divisor 의 High byte 와 Low byte 를 나눠서 아래 알맞은 Register 에 써주면 된다. 물론 조건에 맞춰서 (DLAB enable)
| enum serial_ctrl_cmd |
| int serial_init | ( | void | ) |
Serial 장치를 사용할 수 있도록 초기화 하는 함수
Definition at line 242 of file serial.c.
References DEVICE_COM1, DEVICE_COM2, DEVICE_COM3, DEVICE_COM4, EFAULT, NULL, vfs_get_ninfo(), and vfs_new_dev_ninfo().
Referenced by drivers_init().


1.8.4