Mirror of CollapseOS
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

31 linhas
1.3KB

  1. # Asynchronous Communications Interface Adapters
  2. Machines talking to each other is generally useful and they
  3. often use ACIA devices to do so. Collapse OS has drivers for
  4. a few chips of this type and they all have a similar approach:
  5. unbuffered communication using RTS/CTS handshaking as flow con-
  6. trol.
  7. The reason for being unbuffered is simplicity and RAM. The logic
  8. to implement input buffering is non-trivial and, alone, doesn't
  9. buy us much in terms of reliability: you still have to signal
  10. the other side when your buffer is nearly full.
  11. Because we don't really need speed, we adopt a one-byte-at-once
  12. approach: The RTS flag is always high (signalling that it's not
  13. ready for communication) *except* when calling the ACIA driver's
  14. "read" word, which is blocking.
  15. That "read" word will pull RTS low, wait for a byte, then pull
  16. it high again.
  17. This slows down communication, but it's simple and reliable.
  18. Note that this doesn't help making communications with modern
  19. systems (which are much faster than a typical Collapse OS
  20. machine and have their buffer output faster than the RTS flag
  21. can be raised) very much. We have to take extra care, when
  22. communicating from modern system, not to send too much data too
  23. fast. But for COS-to-COS communication, this simple system
  24. works.