Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
I have a problem when initializing the serial port via the BIOS. It works fine if everything's connected, but if the null modem cable is connected on the TBOS side and not on the other side or if no cable is connected it freezes. Here's my serial port init code:
PS: Is it possible to deinitialize or shut down a serial port?
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
Troy Martin wrote:I have a problem when initializing the serial port via the BIOS.
Troy Martin wrote:What's the problem?
The problem is you're using the BIOS...
For serial ports, the BIOS code is crap - polling wastes CPU time and can cause data loss (e.g. several bytes arrive while you're trying to do something with already received data), and these functions don't support higher speeds (anything above 9600 bits per second) and have no control over things like FIFOs (no FIFO means more chance of data loss). Because of this (and because serial ports are well documented and mostly standard) nobody has used the BIOS serial port functions in the last 20 years (they just write decent serial port code that uses I/O ports); and because nobody uses these functions it's probably not a good idea to assume the BIOS serial port functions have been tested (they're probably full of bugs that nobody cared about).
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Hmmm, I'll go find some serial code on the wiki then!
Thanks!
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.