POSIX 1003.1
The latest ISO/IEC POSIX 1003.1 standard no longer refers to the
old A, B, and C sections, but they are useful to refer to in this
discussion. Section A is the basic Unix API, B is realtime extensions,
and C POSIX threads.
The initial implementation will support only the following elements
of the POSIX standard:
Base Unix API (Section A)
Most file and directory operations:
- read, write, open, close, lseek, fnctl, mkdir, rmdir, chdir, link, unlink, opendir, readdir, fsync.
- no dup, chown, or ftruncate
- debate stat and chmod
Time operations:
- time, localtime.
- No timezone support (initially; this is no big loss since the current standardized interface the time handling functions implement is not sophisticated enough for most implementations anyway.)
- (Not in POSIX, but include gettimeofday.)
Signals will be included in the standard as an optional element.
The initial implementation may well not include support for signals.
_exit, abort, exit will have slightly modified characteristics
from the POSIX standard depending under which environment they are
executed in (configurable hard stop, system restart, etc. under eCos).
Realtime extensions (Section B)
- Async I/O
- Semaphores (only for semaphores used in a single process)
- Reliable signals (meaning queueable real-time signals, subject to the limit of the maximum number of outstanding real-time signals)
- Message passing (glibc will be enhanced to support mqueues, which are missing from the current version of glibc)
- Time related functions: nanosleep.
- Other timer-related functions (timer_gettime, clock_gettime, etc.) may be included via patches that exist to the Linux kernel today.
We will support SCHED_RR and SCHED_FIFO (disable
timeslice) scheduling policies. The default scheduler will be the
eCos MLQ scheduler. We could consider implementing a Linux compatible
scheduler for SCHED_OTHER, or as a configuration option, but
there doesn't seem to be a valid reason to do this in the embedded
context. Other schedulers will be configurable as per std eCos
functionality - but this is not strictly part of the EL/IX standard
as this feature is not available under Linux. Many eCos scheduler
implementations should however be compatible with the eCos pthreads
implementation.
mmap and shared memory are not supported - amongst
other reasons they would either require filesystem and MMU support
as standard, or are not sensible in the context of a single process.
We may elect to support mlock/munlock - as NOPs, and potentially
add mprotect in the future (but would require some basic MMU
support being added to the eCos hardware abstraction layer (HAL)).
POSIX threads (Section C)
All of the pthreads functionality is included with the possible
exception of pthread_kill and pthread_cancel. Thread
cancellation and signals are optional (configurable) elements of EL/IX,
and will probably not be included in the initial implementation.
Per-thread data requirements can be huge. The POSIX standard defines
a minimum of 128 keys to be available, which may consume 512 bytes per
thread in some implementations. We will provide a STRICT_POSIX
configuration option that provides this minimum, but the standard default
will be 0 - but configurable. We will also follow this type of philosophy
for maximum open file limits, etc.
ISO C Library
The full ISO C Library is included with the following additions and modifications:
- fileno.
- All the _r reentrant functions (from Section 8 of 1003.1), namely strtok_r, rand_r, asctime_r, ctime_r, gmtime_r, and localtime_r.
- Only the C locale will be supported (initially; future versions will be able to support additional locales through configuration options).
- Multiple timezone support will not be included.
- Debatable, but probably include environment, but will not include any variables as standard. Include putenv.
- Maths library - C90 for now with the C9x extension of long double. Other C9x may be supported in the future
BSD socket library
Now in draft as POSIX 1003.1g, excluding STREAMS (which are now
optional). We will probably include most of it, but make DNS operations
such as gethostbyname optional (most likely
to be provided by vendors of TCP/IP stacks that can be configured into
non-Linux operating systems).
Not part of EL/IX as such, but infrastructure will be provided to
enable third party vendors to plug their stacks and file systems into
eCos. This will include support for the select functions,
read, write, etc. on sockets and files.
I/O
EL/IX includes BSD sockets (as part of 1003.1g), which should take
care of many I/O requirements. We also provide POSIX 1003.1 file I/O
facilities which can operate on network drives, flash file systems,
RAM and ROM disks, and even real hard disks. But beyond these devices,
we really want to support some kind of abstraction layer that can be
used to describe a wide range of custom hardware devices that will enable
embedded applications to be ported across embedded Linux, eCos, and other
operating systems that support EL/IX. For now, the specification of that
abstraction layer part of the file system hierarchy is currently excluded from the EL/IX
proposal. Since I/O is so fundamental to most uses of embedded systems,
and since there is so much variety that must be supported, some sort
of abstraction layers need to be defined, which is a subject for the
next section.
|