aleix's blog

16C950 UART 9-bit and custom baud rates support for Linux

21 February 2010 9:06 am (c | linux)

Last friday I found myself patching the Linux kernel sources to be able to add custom baud rates support for 16C950 UART cards. I needed to communicate, via a serial port, with one of the devices built by the hardware guys at work. Unfortunately, a non-standard baud rate and 9-bits were needed.

The Sealevel Ultra COMM+422 PCI card we are using is already provided with a patch that adds 9-bit support. However, I was not able to found how to change the baud rate to a non-standard one.

Following the 9-bit patch approach, I added extra requests to ioctl in order to modify the 16C950 registers needed to achieve custom baud rates. Here is the list of added extra ioctl requests (also the 9-bit ones) with the necessary parameters and updated/accessed 16C950 registers:

Request Parameters 16C950 registers Description
TIOC9BITGET out: integer NMR Get current 9-bit status
TIOC9BITSET NMR Enable 9-bit support
TIOC9BITCLR NMR Disable 9-bit support
TIOCPRESCALERGET out: integer EFR, MCR Get prescaler status
TIOCDIVLATCHGET out: integer LCR, DLL/DLM Get divisor latch register
TIOCDIVLATCHSET in: integer LCR, DLL/DLM Set divisor latch register
TIOCSAMPLINGCLKGET out: integer TCR Get sampling clock
TIOCSAMPLINGCLKSET in: integer TCR Set sampling clock
TIOCPRESCALERCLKGET out: integer CPR Get prescaler clock
TIOCPRESCALERCLKSET in: integer CPR Set prescaler clock

I'm not sure if this is the best way to do it, but it works. So, if you need 9-bit and custom baud rates support, apply one the following patches to the kernel (I have aslo updated the Sealevel patch for older and newer kernels than the one provided):

9-bit 2.6.24 2.6.26 2.6.31 2.6.32
9-bit and baud rate 2.6.24 2.6.26 2.6.31 2.6.32

I am not responsible for any damage that these patches can cause to your hardware. No warranty is provided, so use them at your own risk.

62 responses

  1. Jack William says:

    Nice one for reading.

  2. best resume ever written says:

    Linux work same as the way windows work in our computers and laptops. But mostly people use window because it's easy to install and easy to use.

  3. IP-address says:

    The great solution! Thanks for sharing

  4. lauren ebsary says:

    Probably nonetheless windows on a new machine. However according to custom essay writing service UK even they need to charge a fortune earlier than they even communicate to you after a couple pf months. At which point mac are higher. However linux has loads of loose boards managing any issues you've got with every distribution.

  5. Harvey Mac says:

    This is very useful and something we will take on board with my driveways company

  6. Buy Coursework Assignment Help says:

    This A Good Way To Appreciate The Teacher As They Put Their Efforts To Train Students. UK Dissertation Writers Appreciates The Teachers.

  7. Kanada Vizesi says:

    Kanada Vizesi

  8. Almanya Vizesi says:

    Almanya Vizesi

  9. Write my Essay for me Online says:

    this is a with a terrific degree lighting fixtures up article. I moreover agree with your publish name and you're genuinely well mild up your standpoint. I'm staggeringly exuberant to see this publish. A dedication of thankfulness is all together for share with us. keep it up and proportion the extra most associated publish.

    first-rate paintings!

  10. Essay Service says:

    This a great way to realize The trainer As They put Their Efforts To educate students. united kingdom Dissertation Writers Appreciates the lecturers.

  11. Essay Help Online UK says:

    That is a with a remarkable diploma lighting fixtures up article. I moreover consider your publish name and you are actually nicely slight up your point of view. i'm staggeringly exuberant to peer this post. A willpower of thankfulness is all collectively for proportion with us. preserve it up and proportion the extra most associated publish.

  12. UK Best Essays says:

    That is a with an astounding recognition lighting apparatuses up article. I, in addition, consider your distribute name and you are very slight up your perspective. i'm staggeringly rich to peer this post. A self-control of appreciation is all by and large for extent with us. save it up and extent the additional most related distribute.

  13. corporate car service says:

    I'd ride in one of those taxis....not. Can't wait for the sand to swallow up that shit hole middle east when oil dependence eventually goes away.

  14. Do my Essay Now says:

    The help portrayed beneath is 24x7 and accessible in English. Unless shrouded in the open source innovation bolster scope that takes after, the client should work with our Linux accomplices or programming sellers straightforwardly for situations that are not upheld by Microsoft. For instance: application advancement, investigating custom applications, and custom code. Also, Microsoft Support won't offer help with the plan, design, or organization of uses or arrangements on Azure.

  15. Best Essay Help says:

    Linux charge line. This is the shell – a charge procedure that enables you to control the PC through orders wrote into a content interface. This is the thing that, at one time, frightened individuals off from Linux the most (accepting they needed to take in an apparently antiquated summon line structure to influence Linux to work). This is not true anymore. With present day work area Linux, there is no compelling reason to ever touch the order line.

  16. Essay Help says:

    Linux is very. It's in your telephones, in your autos, in your fridges, your Roku gadgets. It runs the majority of the Internet, the supercomputers making logical leaps forward, and the world\'s stock trades. Be that as it may, before Linux turned into the stage to run work areas, servers, and installed frameworks over the globe, it was (and still is) a standout amongst the most solid, secure, and straightforward working frameworks accessible.

  17. Adam says:

    Thanks for the update. Regards from,

  18. Zend Framework Assignment Help says:

    Hi Buddy, Your Blog' S Design Is Simple And Clean And I Like It. Your Blog Posts About Online Writing Help Are Superb. Please Keep Them Coming. Greets!

  19. Capacitance Electrical Project says:

    Such A Nice Post, Keep Up The Fantastic Work

  20. free robux says:

    Hey friends lets come on and check out this game free roblox with free robux generator. It gives the bestever experience to the gamer as it has a lot of things to discover and many sources and resourses in it.

  21. see page says:

    This is really interesting to read about

  22. go bowling alley says:

    good info. great work.

  23. irfan says:

    nice info. great work.

  24. irfan says:

    nice post. good effort on your part. plz keep posting.

  25. Programming Language Assignment Help Online says:

    Hi buddy, your blog' s design is simple and clean and i like it. Your blog posts about Online Dissertation Help are superb. Please keep them coming. Greets!!

  26. Help With Mechanical Engineering Assignment says:

    I personally like your post, you have shared good article. It will help me in great deal.

  27. C Sharp Project Online Help says:

    Science Channel’s are giving a complete knowledge to its viewers about every thing students write done dissertation on this subjects and show its importance.

  28. Jake4 says:

    Very interesting information here you have.

  29. Marketing Research Paper says:

    If you are in need of marketing research paper assistance then come at Students Assignment Help and get all your queries resolved. Our writers our masters and Ph.D. level expert and work 24x7 for students assistance.

  30. Project on Programming says:

    Good way of telling, good post to take facts regarding my presentation subject matter, which i am going to deliver in my college

  31. Take My Mechanical Homework says:

    John arnold is an academic writer of the Dissertation-Guidance. Who writes quality academic papers for students to help them in accomplishing their goals.

  32. Help With Python Homework says:

    Really i appreciate the effort you made to share the knowledge. This is really a great stuff for sharing. Keep it up . Thanks for sharing.

  33. Do My Online Exam says:

    This Is Really Great Work. Thank You For Sharing Such A Good And Useful Information Here In The Blog For Students.

  34. Semi precious stones says:

    thanks for sharing such a nice information i really appreciate your work in this and looking for more such good posts in the future thank you

  35. PhD dissertation writing services says:

    This is some great information for the students. This article is very helpful for the people who are looking forward to get information on this issue. I am in love with your blog already. Love it.

  36. Assignment Help Online says:

    Students could often find it tough to write their academic tasks. It could lead to them not getting desired grades in the academics. Opting for our Assignment Help Online could be ideal for such students and they can get a complete assignment solution from us.

  37. Do My Online DataBase says:

    Hi Buddy, Your Blog' S Design Is Simple And Clean And I Like It. Your Blog Posts About Online Writing Help Are Superb. Please Keep Them Coming. Greets!

  38. Carla Warner says:

    Literacy is the first key to improve yourself other than you have to read such information that will help to improve your skill just like Is Browser Hijacker a Virus? This is also interesting topic to improve your tech knowledge.

  39. Emily Brown says:

    Valuable list of added extra IOCtl requests with the necessary parameters and updated/accessed 16C950 registers you providing here which are very helpful for IT learners of Dissertation Help where they are come to get dissertation assistance.

    With team of professional dissertation writers offering dissertation assistance.

  40. Transport routier baie-mahault says:

    A scholarly group considers exposition as what strict creators think about a work of art.

  41. jack says:
  42. jack says:
  43. jack says:
  44. Carla Warner says:

    If Fix and Removal Malware is difficult so you need to read this information, where you will get complete information about secure your computer from suspicious programs.

  45. Marco Williams says:

    Working on a dissertation paper can be really stressful if there’s a stringent deadline hanging over your head like a sword. Every year, hundreds of UK students discontinue their study programs because they fail to cope with the increasing academic pressure. If you are assigned with a dissertation paper and are worried that you may not be able to finish it on time, can provide you with the essential dissertation help to save you from the trouble.

  46. Need Assignment Writer US says:

    If you may wish to get the assignment written by professionals, then the first and foremost thing to consider in this matter is choosing to work with someone who is best in the business and has thorough knowledge of the subject being dealt with. In case you need assignment writers in U.S. who can handle your project reliably, then get in touch with the experts at during any time of the day, and receive carefully crafted and well knit papers on time.

  47. Adamsnow147 says:

    I wish this site will be updated soon I can't wait to see some more racing games unblocked

  48. Josiaha Matty says:

    Work hard in silence then let your success be your noise same as here are representing your way of working. Let you read about Driver Tonic Serial Key for activation.

  49. james stephens says: provides Essay help online service. Our company has more than 3,000 writers.

  50. Naincy Kumari says:

    Hello guys ! How are you? Are you alone? Don't worry. I'm with you. If you want to sleep with me on bed with all physical love and entertainment, You shuold follow me on the links specified bellow.

    |*| Call girls in Gurgaon |*||*| Call girls in Kolkata |*||*| Call girls in Mumbai |*|

    |*| Escorts in Gurgaon |*||*| Escorts in Kokata |*||*| Escorts in Mumbai |*|

    |*| Kolkata Call girls |*||*| Call girls in Bangalore |*|

    Thanks and have a good luck!

  51. Call Girls Provider Eillen Sharma says:


    ||Escorts In Gurgaon||
    ||Gurgaon Escorts||
    ||Escorts In Bhubaneswar||

    ||Call Girls In Gurgaon||
    ||Escorts In Puri||
    ||Escorts In Cuttack||

    ||Escorts In Lucknow||
    ||Escorts In Guwahati||

  52. Assignment help Australia says:

    I am Sophia Miller.

    Get the best perdisco assignment help in Australia.

  53. says:

    It’s really good conversation, with one of the devices built by the hardware guys at work via a serial port which is inopportunely, a non-standard baud rate and 9-bits were needed.

  54. academic assistance help says:

    nzassignmenthelp provide best essay work for students by academic assistance help providers. We offer excellent dissertation service to students with help of assignment writers.

  55. . says:

    If you are searching for good jobs that suit your nature then you can visit the link below to find career opportunities for your bright future.

  56. Yes No Tarot says:

    Your topic is very engaging and have been keeping me occupied since I have read it. I will surely recommend it to my friends on various social media platforms.
    And if you are interested in yes no tarot reading, visit our page. Go to Daily Horoscope and our experts will tell how about your day in advance so you can plan accordingly.

  57. Domenic Tylor says:

    Such great information provided in this articles. It is very helpful to learn new things easily and efficiently with something written in a simple manner. assignment help

  58. Sumon Rahman says:

    I really like the overall concept and the ability and information you made! I think it would be much more useful for everyone. Really very informative article, great job! Keep us posted like this. Best SMM Panel, SMM Reseller Panel


    Sumon RahmanTOP SMM PANEL

  59. Alex Black says:

    Thank you So much for sharing this useful information , I was searching this from last one month I found this article really helpful. Definitely going to check out the info you shared. This great article and am highly impressed on it keep up your good work. SMM SERVER PANEL, BEST SMM SERVER PANEL, SMM SUPPLIER PANEL, BEST SMM SUPPLIER PANEL, MAIN SMM SUPPLIER, BEST SMM SUPPLIER, SMM SUPPLIER PANEL, BEST SMM SUPPLIER PANEL, RUSSIAN SMM SERVER, RUSSIAN SMM PANEL



  60. Furnance cleaning company says:

    Nice post. Thanks for sharing.Furnance cleaning company

  61. Free Horoscope Astrology says:

    Excellent information on your Article, thank you for taking the time to share with us such a nice article.

  62. zapya pc says:

    zapya for windowszapya pczapya apk downloadzapya free download
    Another interesting feature of Zapya is that in it you can create a group with up to 5 people to share your files with all of them at the same time.

Leave a Reply