|
DUDS
|
Distributed Update of Data from Something
|
A silly name, because I'm not good at making up names, that attempts to describe the ultimate goal for this family of libraries. At present, DUDS only has a single library with functionality for time and interfacing with hardware through the Linux kernel. It aspires to be a set of libraries that include functionality for representing measurements taken from hardware, sending that data over a network, and doing so in a multi-platform environment. At the moment, it is more about using low-level hardware with a high-level interface.
While only a single library results from the build at present, it will be broken up into several libraries as it grows to allow use of only part of DUDS functionality.
Notable missing features:
The license is the two-clause simplified BSD license. See the License page for the text.
A few files in duds/general have code I did not write. They are marked with the correct author and license. It is my intent that any other licenses work well with the BSD license. So far, the only code not under a BSD license is in the public domain.
The audience, users of the library, include:
The audience is not intended to include:
While it is not intentional to exclude people from using this library, the library isn't intended to be a perfect fit for everyone or every use. For instance, it isn't made with the goal of being super easy to use as a top priority, and the documentation assumes a familiarity with C++.
The documentation is generated with the help of Doxygen and Graphviz. If you are looking at something else, like a Markdown page on Github, it may not be the most recent. Documentation comments are used throughout all header files and I consider writing them to be part of the development process. Currently, the documentation is limited to a reference with some sample source code thrown in.
At present, DUDS only supports Linux, including kernel versions 3.6 through 6.6, and likely newer. The kernel's user-space interfaces for hardware may change and break support, but that doesn't happen on a regular basis. The hardware interface libraries are written to allow multiple implementations, but I have no other operating systems to test with, nor the inclination to make an implementation for another system.
I plan on supporting data representations and network communications on Windows as well as Linux, and hopefully this will work on other systems, too. The intention is to allow front-ends on a variety of platforms. However, since my only Windows running computer is an old thing with XP and Visual Studio 2005, I'm not yet sure how I'm going to build DUDS on Windows. Also, I'm not giving up C++17 to build on Windows and I'm not sure if VS2015 supports all the C++17 features used in the source, but it should at least have almost all of the support needed. Earlier versions of Visual Studio all lack required C++14 features.
All development will be on Linux with gcc for a while longer, and I'm in no rush to change that.
The target hardware is the system that runs the operating system, DUDS, and the programs. Currently DUDS uses the user-space interfaces of the Linux kernel for hardware support. As a result, it requires the kernel to be built with support for the hardware. This limits hardware speciifc code in DUDS to drivers that communicate with gizmos through kernel interfaces like i2c-dev.
The library is structured to allow support to be written for specific hardware, although the build system doesn't yet have the ability to build a subset of the code.
The devices include all hardware separate from the target hardware (although potentially on the same board) that the software will communicate with. Some devices are supported by drivers in the Linux kernel. Others will have support in duds::hardware::devices.
Supported devices are listed on the Supported Devices page.
DUDS uses SCons 3.x as its build system, which is written in Python. Compiling and linking is done with gcc 7.3.x, 9.2.x, or something similar.
The so-called C++17 standard, officially ISO/IEC 14882:2017, is used by DUDS. Use of features in newer C++ specifications is being avoided for now.
The Boost C++ library is required. Version 1.62 or newer must be used. Version 1.65.1 or newer is best as it allows exceptions to include a stack trace. Boost's multiprecision library is used for 128-bit integer support when gcc's __int128 is not available, and for serializing 128-bit integers even when __int128 is available. This results in some notable differences in 128-bit integer support on 32 and 64 bit platforms, but maintains a serialization format that is identical across platforms when things like endianness and padding do not affect the results.
The Boost unit test framework is used by a test program. This program does not require any special hardware to run. Some of the tests require leap second information from a zoneinfo (is that the proper name?) file. If the file isn't specified as the first argument to the program, those tests will be skipped.
The default build target is the DUDS library made for debugging. Sample programs are built with the "samples" target, and the tests program (one program right now) with the "tests" target. All those targets make debug builds. There are also targets with names that end in either "-dbg", or "-opt", for debug or optimized builds respectively. Build from the root directory of DUDS by running scons. The binaries will be placed in a directory under bin named for the target and build. For example:
There is currently no target for installation. Despite using Linux since 2001, I'm not really sure how software is typically installed.
There is some support in the build for handling building for multiple targets with the same source files. I intended this to make it easier to go back and forth between my deskunder computer (AMD64) and a Raspberry Pi using the same directory with help from sshfs. It is my first attempt at such support with SCons, and has a few limitations and issues.
The time support in the DUDS library requires knowledge of leap seconds to support unambiguous times, but it can be used without this data. The data is read from the zoneinfo files that are common on Linux installations. Not all of these files include leap second data. The files in /usr/share/zoneinfo usually lack the data. The files in /usr/share/zoneinfo-leaps, or /usr/share/zoneinfo/right (older) should have the data.
On Gentoo Linux, the files with leap second data are provided by the package sys-libs/timezone-data when the use flag leaps_timezone is given.
The system should not be configured with a timezone from a zoneinfo file with leap second data. As of 2018 May 10, Gentoo's zoneinfo files with leap second data causes local timezones to differ from UTC by the regular amount minus 27 seconds. This matches no system of time I can find. It looks like the zonefile was intended to configure the system such that what it claimed was UTC was really TAI, but it only accounted for the 27 leap seconds and not the 10 second difference that existed when UTC officially started.
Support for internationalization is mostly an attempt at keeping string literals out of the library or Human language neutral. For instance, the exception classes do not define error strings returned by std::exception::what().
All std::string objects are presumed to contain UTF-8 strings, but nothing actually cares right now.