Menu

#208 Support for RS-232 emulation with v 2.00 ROM

Next_Release
closed
nobody
None
5
2015-06-23
2010-06-04
SD Snatcher
No

The RS-232 emulation isn't working. No send chars appear on the output file, and nothing from the input file is received.

Testbed: openMSX-0.8.0-11467 on Mac OS X v10.5.8

Steps to reproduce the problem:

1) run openmsx -machine Panasonic_FS-A1WSX -ext rs232
2) On the openMSX console, type:
2.1) set rs232-outputfilename /tmp/rs232msx.out
3) On MSX-BASIC, type:
3.1) CALL COMINI("8N1NNNNN",9600)
3.2) CALL COMTERM
4) Now type some text on the MSX terminal. It doesn't matter what you type, it never goes to the /tmp/rs232msx.out file

The same applies for the rs232-input file.

Discussion

  • Patrick van Arkel

    I never used this feature (I knew it existed but never looked into it)

    I just started a machine with rs232 extentions loaded (see FRS post) and typed the commands he typed (including the openMSX console commands)

    No file was even created so nothing was written.

     
  • Wouter Vermaelen

    Did you plug in the rs232-tester? In the console type:
    plug msx-rs232 rs232-tester
    Does this fix it? (I can't easily test today.)

    I agree this can be confusing/annoying, especially because we currently only have one rs232 pluggable that fits in the rs232 connector.

     
  • Wouter Vermaelen

    • status: open --> pending
     
  • Manuel Bilderbeek

    I plugged the tester and then it works. But it is weird that openMSX starts using a LOT of CPU time as soon as the tester is plugged in. Even when using plain files as input and output. Updating bug report for this.

     
  • Manuel Bilderbeek

    • summary: RS-232 emulation doesn't work --> RS-232 emulation uses an excessive amount of CPU time
    • status: pending --> open
     
  • SD Snatcher

    SD Snatcher - 2010-06-05

    Confirmed: plugging the tester makes it work on Mac OS X too, but the CPU usage also skyrockets and the emulator freezes on exit.

    Please document the requirement for the "plug rs232-tester" on the manual.

    I noticed another problem: The rs232.rom required by openMSX currently is a very earlier version (seems to be v1.00) of the RS-232 BIOS that contained an annoying bug: a CALL 0217h at the address 4590h, when it should contain a CALL CALSLT. This has the consequence that this old BIOS always freezes when it's INIT function is run on MSX2 or higher machines.

    Please choose a newer version of the BIOS, like v1.06 or preferably the v2.00. I'm not sure, but probably the ASCII MSX RS-232C interface has one of those newer BIOS.

     
  • Manuel Bilderbeek

    Thanks for your continuous feedback!

    For the CPU usage, try this patch (tested on Linux and Windows):

    diff --git a/src/serial/RS232Tester.cc b/src/serial/RS232Tester.cc
    index 4890eaa..de3b6d4 100644
    --- a/src/serial/RS232Tester.cc
    +++ b/src/serial/RS232Tester.cc
    @@ -97,7 +97,7 @@ void RS232Tester::run()
    {
    byte buf;
    if (!inFile) return;
    - while (true) {
    + while (!feof(inFile)) {
    size_t num = fread(&buf, 1, 1, inFile);
    if (num != 1) {
    continue;

    the plug stuff will be added to the manual.

    About the ROMs: I don't have these ROM images, but if you give me a list of sha1sums which should be used in order of preference, I'll add them to the hardwareconfig.xml file, so they will be used next time.

     
  • Manuel Bilderbeek

    • status: open --> pending
     
  • SD Snatcher

    SD Snatcher - 2010-06-05

    You're welcome. It's a pleasure to help this project.

    I don't have a building environment here to apply/compile the patch, so I'll wait until a new build appears here: http://twitter.com/openmsx_builder (tks, Fixato!)

    About the ROMs: I'm looking for original ROMs for the i8251 UART myself but those are indeed pretty hard to find.

    I do own a Gradiente RS-232C interface. It don't have the BIOS bug, but it's based on the Z8530 UART (like, it seems, the Philips RS-232C interfaces) instead of the i8251 like the standard specifies. The Harukaze tools+BIOS are pretty easy to find, but this one uses a NS16550A UART.

    Researching deeper, I discovered about the v1.00 ~ v2.00 versions on the RS-232C documentation available at the msx-archive.

    After that, I recreated both the v1.01 and v2.00 using the sources from the msxsyssrc project (awesome work!). I had to fix some disassembly errors it contained, but now the v1.01 is working fine and the only difference seems to be that CALL CALSLT fix.

    The v2.00 isn't supported on openMSX: it seems to require RAM at the same slot of the ROM in a similar fashion that the MSX-Audio BIOS requires. There's an additional circuitry to configure the i8251 to be mapped as MMIO (Memory-mapped I/O) or PMIO (port-mapped I/O). MMIO is used when more than one RS-232C is connected to the MSX. The v2.00 seems to be able work without this additional circuitry.

    For the RS-232C v2.00 bios, the required addressing seems to be:

    - 4000h~5FFFh: ROM
    - 6000h~7FFFh: RAM
    - BFF8h: FFh = enable the UART on I/O space

    More info can be obtained on the msxsyssrc project.

    So, I don't have dumped ROMs for the i8251, but just recreated ones from the msxsyssrc project. If you're interested, those are the checksums. At least it's the best we have currently. Without it, the rs232 emulation on openMSX will only be usable when emulating MSX1 machines.

    SHA1(rs232v101.rom)= 47c78981b5ffbb9e8d9c2145f9c2e642ff0e8193
    SHA1(rs232v200.rom)= b6746f3e422080d51d54302c5d22e440315a381b

    Note: The easer way to obtain the v1.01 is by just patching the v1.00 at address 4590h. Change the 0xcd,0x17,0x02 to 0xcd,0x1c,0x00.

     
  • SD Snatcher

    SD Snatcher - 2010-06-05
    • status: pending --> open
     
  • Manuel Bilderbeek

    • summary: RS-232 emulation uses an excessive amount of CPU time --> Support for RS-232 emulation with v 2.00 ROM
     
  • Manuel Bilderbeek

    Moving to feature request tracker, because this is now about adding support for the v 2.00 ROM which requires different hardware.

     
  • SD Snatcher

    SD Snatcher - 2011-03-10

    This is an updated xml: MSX2 compatibility patch included

     
  • SD Snatcher

    SD Snatcher - 2011-03-10

    I've attached a new xml file that contains a small IPS patch that fixes the RS-232 incompatibility with MSX2 (or higher) computers. This way the original RS-232.ROM v1.00 can be used without trouble.

     
  • Manuel Bilderbeek

    • status: open --> pending
     
  • Manuel Bilderbeek

    RAM for RS-232C is now implemented, see the Sony HBI-232 extension. Apparently this is a V2 type of ROM?

    If you disagree that this feature request is implemented now, please reopen.

     
  • Manuel Bilderbeek

    • status: pending --> closed
    • Group: --> Next_Release
     
  • SD Snatcher

    SD Snatcher - 2015-06-23

    Confirmed: The Sony HBI-232 uses the Generic RS-232 BIOS v2.00 (without DMA, but with 2KB of SRAM), just like the Sony HB-G900P built-in RS-232.

     

    Last edit: SD Snatcher 2015-06-23
MongoDB Logo MongoDB