It is true that Linux is not fully POSIX compliant (e.g.,
https://linuxhint.com/is_linux_posix_compliant/). But Linux folk have
gone to a lot of work to clean up a Linux specification with the LSB:
https://refspecs.linuxfoundation.org/lsb.shtml and that generally adopts
POSIX standards.
We use the the term "Linux" loosely here. POSIX specifies the
interface between applications and an operating system. However,
the user application never interacts directly with Linux which
resides in kernel space but rather with various user space libraries
like libc that, in turn, interface with Linux via call gates
(uncontrolled and not not prototype-able C interfaces). So more
correctly, it is the GNU libraries that determine the user
application interface. Calling this Gnu/Linux is more accurate but
that phrase manages to piss off everyone.
NuttX has evolved over the years in regard to what it uses as its
standards base.
1. Originally, in the beginning, NuttX was a very tiny OS (think
FreeRTOS or ChibiOS) with a very limited user interface but drawing
primarily from POSIX interface definitions. Since NuttX provides both
the OS and the libc, we can safely call this interface NuttX.
2. Later the project adopted OpenGroup.org as the standards base.
OpenGroup.org is a good clean POSIX definition and no user interface
could come in that was not specified by OpenGroup.org. OpenGroup.org is
THE Unix spcification. Documentation (like the Inviolables.md) still
claim that OpenGroup.org is the standards base.
3. Most NuttX users are also Linux users so there has always been
pressure to follow Linux interface definitions (the LSB). After Xiaomi
adopted NuttX, the pressure to adopt the LSB as the specification base
(NSB?) was irresistible.
From my point of view, I am just happy that we can point to
specifications and say, "NuttX is compliant with that" -- whether that
is OpenGroup.org or the LSB.
I have led technical teams for several decades and one thing I have
learned is that everyone does thing differently and as a technical
leader, you have to stand back and simply ask does the propose solution
work? Does the proposed solution meet the need? If yes, then you just
have to accept the solution and let the rest go as personal preference.
Unless you are the BDFL as I was for so many years.
Also, the TERMIOS changes are POSIX and compliant with the LSB,
OpenGroup.org and, I am sure, BSD.
A bunch of caveats.
- Use of the term POSIX compliance OS in regard to any OS that is not
POSIX certified is a trademark violation, but people say this all of the
time.
- http://get.posixcertified.ieee.org/certification_guide.html
- POSIX is a trademark of the IEEE
- Unix is a trademark of OpenGroup.org
- Linux is a trademark of Linux Torvalds
On 3/11/2023 12:08 PM, Tomek CEDRO wrote:
Please consult Unix manual and source code (for instance any of the BSD).
Linux was never a reference in Unix world, it was about to mimic Unix, but
was not even self-compatible. Not a good reference point. See how big mess
it introduced in current drivers implementation (i.e. drm kms) and their
propagation to other OS. Is this similar situation here?
Device driver should not provide any additional processing / silent rewrite
of data, just provide raw data, that is then processed by the application.
Driver may be configured by ioctl/sysclt, to enable additional / specific
behavior (i.e. debug, buffer size, latency, etc), so the user always knows
exactly what the driver does.
I am pro Greg approach, so driver is always simple and generic, everything
else is up to application. This is the Unix way and you will know how most
things work, because they all work the same generic standardized way, as
simple as possible, nothing else happens "in the background unnoticed".
If a specific device needs a specific handling by a generic driver, then
"quirks" may be used. That explicitly mark "specific" behavior for a given
device (and only this device).
--
CeDeROM, SQ7MHZ,http://www.tomek.cedro.info