Configuring serial port
Posted: Sat Feb 18, 2017 1:00 pm
I am trying to configure serial port for my small kernel. I read all the details about the configuration of UART from this http://retired.beyondlogic.org/serial/serial.htm#14 tutorial but I am a bit confused. The tutorial does not tell you what are the default values that should be set to have a working serial port. I have looked at some code like this one
Then from our linux kernel we get different values that are set.
What I mean to say is that is there any predefined protocol to set these values. Does the sequence matters in setting of values?
Code: Select all
outportb(device + 1, 0x00);
outportb(device + 3, 0x80); /* Enable divisor mode */
outportb(device + 0, 0x03); /* Div Low: 03 Set the port to 38400 bps */
outportb(device + 1, 0x00); /* Div High: 00 */
outportb(device + 3, 0x03);
outportb(device + 2, 0xC7);
outportb(device + 4, 0x0B);
What I mean to say is that is there any predefined protocol to set these values. Does the sequence matters in setting of values?