Does VirtualBox allow modifying CPU IO register values?

Discussions related to using VirtualBox on Linux hosts.
Post Reply
joelding
Posts: 4
Joined: 28. Jan 2009, 05:13

Does VirtualBox allow modifying CPU IO register values?

Post by joelding »

Hello everybody,

I am learning how to write Linux drivers by using VirtualBox. Lately I came to write UART (a.k.a serial port, COM1/2, or RS232 ports, etc) but I found it was not possible to setup baud rate into IO address 0x3F8. VirtualBox's COM1 is corrected connected to host's /dev/ttyS0.

My driver code is certainly correct because the same code has been successfully tested in VMware 6.5.1. VMware allows modifying registers from 0x3F8~0x3FF.

< Environment >
Host : Ubuntu x86 version 8.04.1
Guest : Fedora Core 3. The kernel version 2.6.9 is self-made from Fedora Core kernel 2.6.9-1.677, by removing "serial" driver.
VirtualBox version 2.1.4

< Test >
1. Boot up Fedora Core 3 vdi and switch to home-made kernel
2. Login and check availability of IO address 0x3f8. ($ cat /proc/ioports)
3. Run home-made driver by # sh load_module.sh
4. Run test by ./test/test

From the kernel message (# tail -f /var/log/messages), I can see the baud rate is not set the way I want it to be. The register value is always 65535.

Did I misunderstand VirtualBox as a simulation to real PC (CPU)? Does VirtualBox allow modifying CPU IO register values?

My test driver and application program can not be attached here. If you feel interested in trying for yourself, please copy this line (http://joelding.myweb.hinet.net/uart03.tar.gz) to download.

Any idea or comment is great. Thank you all in advance.

Joel
Post Reply