Re: RS232 ports and new PC's - Page 2

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Re: RS232 ports and new PC's
On Wed, 13 Aug 2003 16:10:55 -0400, Elroy the Seedy Impaler

Quoted text here. Click to load it


How is this so hard to believe ?

Computers have emulated instructions (opcodes) which were not
available on a specific processor for quite a few decades.

A typical example are the floating point instructions in some computer
families. The largest members of the computer family had the floating
point instructions implemented in hardware. In order to be able to
execute an identical program on the smallest members of the family
that did not implement the floating point instructions, emulation was
used.

When the small computer encountered the floating point instruction, it
was trapped using the illegal op-code trap (reserved instruction or
whatever it was called). The trap service routine would first decode
the offending opcode and if it was one of the emulated instructions,
it would determine were the operands are and then executed the
floating point instruction using some library routines, that used
integer instructions. When the floating result was ready, it would be
stored in the same place as the floating point instruction would have
stored it, before the reserved instruction trap would return and the
program execution would continue from the next op-code following the
floating point instruction.

To the application program, it would appear as if the processor had
floating point instructions, but of course the program would be much
slower.
---
Now it should be quite obvious, how emulation of UART access is
implemented.

We've slightly trimmed the long signature. Click to see the full one.
Re: RS232 ports and new PC's

Quoted text here. Click to load it

I thought it was all along, but thanks for explaining it in
detail.

Quoted text here. Click to load it

Yup. The [3456]86 processor architecture has that.

Quoted text here. Click to load it

Yup.  Dosemu has been doing that for years.

Quoted text here. Click to load it

However, the DOS program can be running in virtual-8086 mode.

Quoted text here. Click to load it

In true real mode, there is no such concept as a "non-existant
location" that is comparable to a non-mapped area in a machine
with VM.  All locations exist.  Some locations just don't have
hardware that responds when those locations are accessed.

Quoted text here. Click to load it

The write cycle is actually performed, but nobody on the bus is
paying attention because their chip-selects are all inactive.
Read cycles are likewise performed, and whatever value happens
to be on the data lines is returned.

Quoted text here. Click to load it

Easy: You don't run it in real-mode.  You run it in
virtual-8086 mode on a 386 or latter.  

www.dosemu.org

--
Grant Edwards                   grante             Yow!  Zippy's brain cells
                                  at               are straining to bridge
We've slightly trimmed the long signature. Click to see the full one.
Re: RS232 ports and new PC's


Quoted text here. Click to load it

How then do the drivers access the hardware?  Or is it your point that all
the software at that level has already been written?



Re: RS232 ports and new PC's
Quoted text here. Click to load it

With an Intel cpu and some others you have the 'in' and 'out' machine
instructions to access device hardware. A low level device driver would
typically use these instructions to write and read to and from the
device registers.  Devices are not mapped into main memory address space
as with many micros, but live in a separate and private address space
unique to the in and out instructions. It's not segmented and can be
thought of as being in parallel with the 0x0000 to 0xffff main memory
space.

So, on a pc, if real i/o device registers not physically mapped into the
i/o space, they can't be seen by the in and out instructions or, by
implication, system code that calls the driver.

This is all muddied by the fact that all sorts of code is called a
driver now, but to me, a 'device driver' is always low level code that
talks directly to hardware :-)...

Chris

Re: RS232 ports and new PC's
Quoted text here. Click to load it

Even in plain vanilla DOS, this is feasible. All you need is a device driver
started from config.sys, that switches the CPU into virtual mode and run DOS
is a VM. Just like EMM386.SYS did. And in that situation, the DOS app sees
real comm port registers.

Meindert



Re: RS232 ports and new PC's

Quoted text here. Click to load it

Perhaps it's true for Windows, but you can run DOS and DOS apps
under Linux using DOSemu, and it will provide "virtual" hardware.

Quoted text here. Click to load it

You can make it look like you do.

--
Grant Edwards                   grante             Yow!  HUMAN REPLICAS are
                                  at               inserted into VATS of
We've slightly trimmed the long signature. Click to see the full one.
Re: RS232 ports and new PC's
Quoted text here. Click to load it

Not true. All I/O access by applications is indeed trapped by windows. But
the most common I/O ports like the UARTs, LPT ports and even the PIC are
virtualized in windows, in order to let old DOS apps access these I/O ports
'directly'. And I know from experience, because my self written DOS terminal
programs do this exactly, and have always run fine in DOS, Windows 3.x, 95,
ME, NT4 and 2K.

Meindert



Re: RS232 ports and new PC's
Quoted text here. Click to load it


Not quite "all I/O access by applications" are trapped by Win
3.x/9x/ME (they are all by NT/2K/XP).  Any port that hasn't been
grabbed by a VxD in 3.x/9x/ME is generally allowed to be accessed by
DOS apps without interference.  The system does provide VxDs for all
of the system hardware (eg. PIC, timer, keyboard, display, etc.), so
those are all virtualized by default, but if you install some
non-standard hardware without a VxD, you *can* hit it from a DOS app
under 3.x/9x/ME.  Other resources (I/O device memory especially) have
a similar "default" access unless virtualized by a VxD under
3.x/9x/ME.

Re: RS232 ports and new PC's

Quoted text here. Click to load it

This is not actually true.  Programs that use the comms port hardware
directly have no trouble under Win9x (since it's really just glorified
Win3.1, runs dos underneath and has very little hardware protection), and
they have no trouble under NT or W2K (I can't answer for XP - I wouldn't
touch it with a bargepole), which virtualises the ports.  Programs that use
the parallel port directly (very common for people in this group) work fine
under Win9x (again, it's a toy system with no protection), and can be made
to run under NT/W2K with a bit of help.  If the author of the program is
helpful, then they can include the "giveio" driver - a program can access
this driver, and then have rights to access the hardware directly.  Almost
all parallel-port programs (for debuggers, programmers, etc.) that have
NT/W2K support use this technique.  If you can't modify the program, then
you can use the "totalio" driver - start it, and *any* program can access
the parallel port directly.  I've used it to get old Win3.1 parallel-port
programs to work under NT, although obviously you don't want to use it more
than necessary.




Re: RS232 ports and new PC's
Quoted text here. Click to load it
perfectly
register

Have a look at http://www.osnews.com/story.php?news_id39%12 and the story
linked to it.  You can make DOS do anything you want - you can even run a
32-bit multitasking gui on top of it, albeit a bit unreliably, and sell it
with claims that it is a new real operating system.




Re: RS232 ports and new PC's
On Thu, 31 Jul 2003 16:23:03 -0400, Elroy the Seedy Impaler

Quoted text here. Click to load it



http://www.catc.com/products/usb4dos.html has a ISB DOS stack
available. It is not free, but if one really need to get a USB device
going, it might be worthwhile.

Do a google for USB and DOS. There are quite a few drivers available
for Mass Media type devices.

Regards
  Anton Erasmus


Re: RS232 ports and new PC's
Quoted text here. Click to load it

Colin,
   I have not used USB to RS-232 because sometimes there is a problem
according to some vendors.  I believe it has to do with latency, but I
don't recall exactly.
   I have used TCP/IP to serial and they seem to work fine.  Check with
Digi, Equinox, and Moxa (in no particular order).  Of course this means
your laptop will need a network port.

Dennis,

Re: RS232 ports and new PC's


Quoted text here. Click to load it

and than there is one mfr. that has one only header for a commport on
the motherboard and it does not work. I have to "remove" the commport
from the systems setting and restart the computer before the
commport is active. Even got a new bios upgrade from the mfr., no help
rw


Re: RS232 ports and new PC's
Quoted text here. Click to load it

We have development system that requires an RS232 port with a working
DTR, and preferably a working DSR. We tried several RS232/USB
converters and found one that worked well on all Windows OSes across
different versions and configurations of our systems so we resell it
on our Webstore.

Some customers have tried OTS serial port cards and found that the DTR
didn't work.

RS232 ports are going away faster on laptops, and the quality of the
ports and drivers can be questionable. A major laptop/desk maker had
the DTR glitching when the port was closed and reopened. They posted a
patch, but we had to patch our SW to work around the problem too.
-Brian

www.zworld.com
www.rabbitsemiconductor.com

Site Timeline