Re: Complete Pascal Reading from Serial Port?



Michael Kent <michael@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

David Empson <dempson@xxxxxxxxxxxxx> wrote:

The serial ports are the realm of the operating system (GS/OS) rather
than the toolbox. I think you can use them by opening a special file
(the GS/OS-suppled "generated" driver for the slot 2 firmware) but I
don't know the details off the top of my head.

This isn't very good, however. The only official API for the serial
firwmare requires a mode switch to emulation mode and only transfers a
single character at a time. This causes a huge performance hit for the
GS/OS generated driver.

Apple never provided a native GS/OS driver for the serial ports, which
would have resolved the performance problem.

If you'll forgive my intrusion where I obviously don't belong (a pro-
grammers' group), perhaps I could use the occaision as a learning ex-
perience.

I thought the "Printer" and "Modem" drivers supplied by Apple with
System 6.01 were in fact printer port and modem port drivers, respectively.
I know they're small (only about 2K each, IIRC), but I thought that's
because no more was needed to move characters down a serial line.

Are you talking about something different?

Printer and Modem are serial port drivers, but they are part of the
printer driver architecture. They allow character-based printer drivers
to send data to the serial ports, but they are no use for communication
software as they are primarily geared to sending data, not receiving it,
and have little or no support for modem flow control signals.

I haven't looked at them in detail, but I expect they are also using the
standard serial port firmware, which requires a trip into emulation mode
and only transferring one byte at a time, hence they have a huge
performance overhead.

The nonexistent driver would be a native GS/OS character device driver
for the serial ports, which might be able to share resources with the
standard serial firmware but which has its own internal direct interface
to the serial firmware transmit/receive buffers, avoiding to need to go
through the bottleneck of the emulation mode shift and copying one byte
at a time. This would allow much more CPU time for other tasks and could
allow higher baud rates to be achieved on an unaccelerated IIgs.

--
David Empson
dempson@xxxxxxxxxxxxx
.



Relevant Pages

  • Re: Complete Pascal Reading from Serial Port?
    ... GS/OS generated driver. ... System 6.01 were in fact printer port and modem port drivers, ... printer driver architecture. ... to send data to the serial ports, but they are no use for communication ...
    (comp.sys.apple2.programmer)
  • Re: Accessing peripherals from a managed application
    ... You call the Win32 APIs for serial ports. ... beitman AT applieddata DOT net ... Maybe you open the driver with CreateFile, ... Call on the imported functions to access the hardware. ...
    (microsoft.public.windowsce.app.development)
  • Re: xPC Serial Communication Problems
    ... We're using the serial ports that come on the CPU ... The older serial block you're using uses the kernel resident driver ... Is the receiving machine executing at the 'same' 50 ms rate? ... does it wait until there are at least 15 characters in the ...
    (comp.soft-sys.matlab)
  • Re: Multiport Serial
    ... > I am writing a kernel mode driver for a PCI card with 16 serial ports. ... Serial" (GUID 50906cb8-ba12-11d1-bf5d-0000f805f530). ... > None of the 16 child devices seem to appear to the system as serial ports. ...
    (microsoft.public.development.device.drivers)
  • Re: Bug in X86 serial port driver in CE.NET 4.2 ?
    ... > Yeah I have noticed that too on some UARTs. ... From the behaviour I am seeing with my driver it seems to ... > connected up (system configurable to control different pieces of hardware). ... > no serial ports and no hang with my driver. ...
    (microsoft.public.windowsce.platbuilder)