And does the mouse being a ps/2 input vs USB make a difference?
And does the mouse being a ps/2 input vs USB make a difference?
This would be one way in which the Rust crowd could really make a difference.
On the developer side, documentation was also amazing. There are tens of full, working example applications. BB10 used QT behind the scenes (Cascades UI). It had also a Python (2.x) binary on the device among other typical UNIX programs.
[0]: https://developer.blackberry.com/devzone/files/design/bb10/i...
[1]: https://developer.blackberry.com/devzone/design/bb10/10_3_vi...
[2]: https://developer.blackberry.com/devzone/design/bb10/keyboar...
The BB10 UI was built on something like QML (the language and runtime) from Qt 4 with their own UI elements and an OpenGL based backend from the acquired company The Astonishing Tribe. They had animations e.g. for slider switches running in the render thread, perfect 60 fps. Qt Quick (the UI framework based on QML, colloquially called "QML") only got an OpenGL backend in Qt 5.
Another very good Qt-based phone OS (after the Nokia N9, got one of these at a conference as well) that failed :(
By the way, the Ford Sync 3 IVI ("in-vehicle infotainment system") is also based on QNX and Qt and it received fairly good reviews. I think I made some tiny contribution to it, if only helping a coworker with something.
The difference used to be very noticeable. Nowadays my PC doesn't have a PS/2 port.
- USB works by polling for changes at fixed intervals
- ps/2 works with interrupts, so the OS will know immediately when hw does something.
A kid who asks you 1000 times a second whether you are there yet is going to know within 1ms of when you get there, but I imagine we’d all like being the driver much more if there were no “are we there yet”s and all the kid needed was one “We’re here” exactly when you arrive.
That all being true, having a publish/subscribe model is still not the same as having a true interrupt (and I’d have to do some digging to figure out whether there wasn’t still polling somewhere in the pub/sub pipeline)
The difference is real time control of stepper motors with crazy speeds when microstepping at 300K steps / second or more interpolating across 5 axis vs moving them at a snails pace of maybe 10K steps / second (on really nice and otherwise idle hardware, miss a single step and your goose is cooked, now you have a cumulative error).
This intuitively makes sense especially with SSDs and especially with NVMe SSDs: you're not going to have to wait that long, especially compared to the overhead of an interrupt. Also, if you're reading sequentially, once you get one I/O completion you're going to get a lot more in a short timeframe—it makes sense to just poll for those instead of handling every one as an interrupt. Interrupts are pretty expensive (I honestly don't have a good grasp of how Linux interrupt handling works but it can easily be on the order of microseconds.)
It also has some side benefits like preventing the CPU from going into a lower power state for only a short period of time.
If it’s possible to interrupt on a serial port, are there existing examples of how to configure a mouse or keyboard to interrupt over a serial port?
Typically a serial port would contain a small buffer which would fill up, upon completion of the first byte an interrupt would be generated and you'd respond to that and read out the register freeing up room for more bytes to be received. Transmit the same but reversed, as soon as a byte had left the shifter in the chip it would generate an interrupt so you could re-use that space for more bytes to send.
This works quite well. Hardware flow control can help in case the OS doesn't respond fast enough to the interrupts, so you don't lose characters.