On Thu, Feb 04, 2010 at 11:02:51AM +0000, Johann Myrkraverk Oskarsson wrote:
> I've already begun to look at the docs for FDC37C665GT as well as
> superio.c, curtesy of filth on #playpen, freenode.

The '665 is pretty much exactly a 16C550 clone in the serial port
department, so there is plenty of other documentation out there.

> Right now I have only one question: What happens when the real UART
> doesn't support the same baud rates as the chip we're emulating?  I
> just checked, and according to the OpenSolaris driver sources, my UART
> does not have all the speeds listed in the hw docs.  It is safe to
> assume this will be the care for many real serial ports/UARTS out
> there.

It depends on how low level access you have.  Assuming the serial hardware
is roughly similar, the divisor registers on 16Cxxx devices (which form most
PC serial ports) can set up a wide range of baud rates, not just 1200, 2400,
4800, 9600 etc etc.  But you may not have access to the raw divisor values -
the OS may only allow you to pick from a fixed list.

I'm not sure of the best way to handle rates that don't fit.  99% of people
will just use the standard rates, so it probably isn't a big problem.  The
only use I can think of strange rates is ancient 1200/75 modems (which
connected to online services that no longer exist).

Certainly emit a warning.  Maybe set the FDC37C665 divisor 'registers' to
the closest you can do, which will be apparent if something tries to read
them back (but I don't think this helps much, since I assume RISC OS keeps
its own copy of the baud rate it previously set)

I think you just have to emit a warning and carry on as best you can.  The
wierd rates will probably never get used for real anyway.

Theo

_______________________________________________
Rpcemu mailing list
[email protected]
http://www.riscos.info/cgi-bin/mailman/listinfo/rpcemu

Reply via email to