Accessing the 8250 UART registers directly (bypassing the serial driver)

Submitted by uprooter
on December 11, 2008 - 9:48am

Hello,
I'm a student and im asked to write a program that has to do rs232 communication with another computer.
In order to do so I have to program the UART registers manually. and not via a driver
The working environment is borland C running under dosbox.
This approach is used since dos running in real mode and not in protected mode.
The question is If I remove the serial_core driver will I be able to access the registers directly ?
Or that I still have to run the OS in real-mode(is it possible to run something like real-mode linux under some kind of virtual machine) ?
Thanks.

with the ioperm()

Anonymous (not verified)
on
December 14, 2008 - 6:24am

with the ioperm() systemcall, you can allow access to the uart from user space.

not so real

Ferdinand (not verified)
on
December 16, 2008 - 8:15pm

DOSBOX is an emulator. It only pretends to run in real mode. It calls upon the Linux kernel to perform all I/O.

Add this to your dosbox.conf file:

serial1=directserial realport:com1

and *do not* remove any serial drivers from the Linux kernel.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.