T-Engine Middleware T-Engine Middleware Tomas Sanchez Lopez Real-time & Embedded Systems Laboratory [email protected]
Mar 27, 2015
T-Engine T-Engine MiddlewareMiddleware
Tomas Sanchez Lopez
Real-time & Embedded Systems [email protected]
2AA
NN
TT
SS
ContentsContents
■ Introduction■ Middleware Classification■ Middleware Activities
■ T-Format■ Device Drivers■ Subsystems■ T-Collection■ T-Builder■ T-Dist
■ Conclusions
3AA
NN
TT
SS
Introduction Introduction
T-EngineT-Engine: An open standardopen standard platform for real-real-timetime, embedded systems development
MiddlewareMiddleware: software agentssoftware agents acting as an intermediaryintermediary between different application components
4AA
NN
TT
SS
Introduction Introduction
T-Engine Middleware:T-Engine Middleware: Layer that provides services to application software with user-defined system calls, application
tasks, and libraries offered by T-KernelT-Kernel. The T-FormatT-Format specification standardizes formats for middleware source and
execution code.
5AA
NN
TT
SS
Middleware Classification Middleware Classification
AA - By the way it acts Subsystem-type Middleware Device Driver-type Middleware Library-type Middleware User Task-type Middleware
BB - By the service it provides Device Driver-type Middleware Abstract Device Driver-type Middleware Extended Kernel-type Middleware Middleware to provide general functions
6AA
NN
TT
SS
Middleware Classification Middleware Classification - - AA
Subsystem-type Middleware Middleware which acts as a subsystems on the T-
Kernel Called by the applications through its interface Called when event happens
Device Driver-type Middleware Uses the device management functionality provided
by the T-Kernel Use it through general device driver interface
provided by T-Kernel
More
More
7AA
NN
TT
SS
Middleware Classification Middleware Classification - - AA
Library-type Middleware Middleware that acts as a user library User apps need to be linked with it in code creation
Provided function or global variable
User Task-type Middleware Middleware that acts as a user-task server “Management server Task” User apps get services from it:
Inter-task communication provided by T-Kernel Synchronization provided by T-Kernel
8AA
NN
TT
SS
Middleware Classification Middleware Classification - - BB
Device Driver-type Middleware Middleware that provides an API in a certain level of
abstraction concerning: Each device on T-Engine Each device connected to T-engine
Communication devices connect other devices To achieve portability, the API of lower level devices
should be standardized
Examples: RS232C driver, PCMCIA driver, Ethernet Driver, USB driver, Graphic Card Driver…
9AA
NN
TT
SS
Middleware Classification Middleware Classification - - BB
Abstract Device-type Middleware Provides SW interface of high abstraction to single or
plural devices on T-Engine
Extended Kernel-type Middleware Middleware that provides service or higher
abstraction level through T-Kernel or middleware functions to HW and SW resources managed by T-Kernel
Examples: TCP/IP, Printing I/F, FAT file system, GUI package…
Examples: Process Management function, virtual memory function, loader function, CLI (command line interpreter)…
10AA
NN
TT
SS
Middleware Classification Middleware Classification - - BB
Middleware to provide General Functions Provides general calculation functions Weak relation with kernel resources or external
devicesExamples: Sort function, Search function, random number generation function, encryption/authentication function…
11AA
NN
TT
SS
Middleware ActivitiesMiddleware Activities
Related to the development of Middleware Standards T-Format Device Driver Specification
Related to increasing amount of middleware Subsystem design Porting activities T-collection T-Builder
Related to distribution of middleware T-Dist
12AA
NN
TT
SS
Middleware Stnd. ~ T-Format Middleware Stnd. ~ T-Format
Code format of Middleware and application Software running on T-engine/T-Kernel.
Source code style guidelines Source-code style format for middleware and
applications running on T-Engine/T-kernel Source code written by various vendors can be
compiled in one program
Document format Type and format of documentation attached and
distributed with middleware and applications
13AA
NN
TT
SS
Middleware Stnd. ~ T-Format Middleware Stnd. ~ T-Format
Binary-code format Executable binary format to run in T-Engine/T-kernel Follow the ELF format Compiler dependent part of the ELF format should follow the GNU-
based reference environment and is separately defined by T-Engine forum
Symbol rules for avoiding name conflicts when combining different pieces of software from different vendors
Global symbols (Exported functions, global variables, etc) Middleware Package name Version assignation
Example: char unl_mpeg2_etronid[16];
14AA
NN
TT
SS
Middleware Stnd. ~ Device Middleware Stnd. ~ Device DriverDriver
Specifications of the Device Driver Interface Library Convenient dev. of device drivers designed to run on T-
Kernel Device Drivers consist of:
Interface layer Logical Layer Physical Layer
Interface layer: Reduce burden on developersand bring together the aspects that can be standardized
SDI (Simple Device driver interface layer)Devices that can perform all processing immediately without
queuing requests (i.e. RTC or other register-based devices) GDI (General Device driver interface layer)
For devices that must attend request in order of request (specially for those to interrupt processing) (i.e. RS-232C)
15AA
NN
TT
SS
Middleware Stnd. ~ Device Middleware Stnd. ~ Device DriverDriver
SDI GDI
Also concerns about implementation issues: Waiting functions Abort functions Buffer management between the OS and the requesting
source DMA Interrupt handlers
16AA
NN
TT
SS
Middleware Stnd. ~ Device Middleware Stnd. ~ Device DriverDriver
Examples
Audio Device Driver Enables audio IO with T-
Engine Provides audio codec
control Allows extensions with
more driver units and subunits (i.e. multiple implementations of ADC & DAC)
17AA
NN
TT
SS
Middleware Stnd. ~ Device Middleware Stnd. ~ Device DriverDriver
MIDI Device Driver T-Engine Units lack of MIDI connector Control the protocol converters and sending
or receiving logical MIDI streams Individual devices are controlled by
application’s messages (not the MIDI driver)
Back to Classification
Examples
18AA
NN
TT
SS
Increasing Middle. ~ Subsystems Increasing Middle. ~ Subsystems
T-Kernel doesn’t include file management, GUI-related, communication functions, etc
Implement these functionalities by adding subsystems to T-Kernel. Allows both lightweight and advanced systems on the same kernel
T-Kernel Extensions provide: Virtual Memory: Using MMU, create multiple virtual address
spaces Process Management functions: to modularize programs Event Management functions: for mouse, keyboard, etc File management functions
Back to Classification
19AA
NN
TT
SS
Increasing Middle. ~ Porting Increasing Middle. ~ Porting Act.Act.
Other systems hold a lot of software assets that could be very beneficial for the T-Engine
Establish porting guidelines for reusing those assets Operate other systems on top of T-Kernel Examples: ITRON middleware, Windows CE .Net
ITRON Middleware 20 years of embedded development to reuse System call level highly compatible Porting main changes:
Change in and reuse the Kernel API Changes to improve distribution (T-Format,
Subsystems…)
20AA
NN
TT
SS
Increasing Middle. ~ Porting Increasing Middle. ~ Porting Act.Act.
Hybrid mechanism of T-Kernel and other OS: T-Bus
Provide Real-Time functionality to other OS
Benefit from the guest OS capabilities (interoperation, GUI, etc)
Digital Video
Camera Example
Hybrid implementation
21AA
NN
TT
SS
Increasing Middle. ~ Porting Increasing Middle. ~ Porting Act.Act.
Linux Kernel on top of T-Kernel
Light-Weight Object Oriented programming framew.
Middleware for third-generation mobile phones
T-W
ind
ow
s
J2ME with T-engine profiles
Windows CE .Net
22AA
NN
TT
SS
Increasing Middle. ~ T-Increasing Middle. ~ T-CollectionCollection
Basic set of software that runs on T-engine and T-kernel Standard format that makes easy to run code immediately Basic modules such as algorithms or large-scale practical
software They are assumed to be Open-source Source code or binaries offered by T-Engine Forum Distributed with T-Dist
Example of Collection: Small library containing tree programs Sorting function Searching function Encryption and Signatures Data compression algorithms Basic resident programs (i.e TCP/IP, file system based on
allocation tables)
23AA
NN
TT
SS
Increasing Middle. ~ T-Increasing Middle. ~ T-BuilderBuilder
Standard development environment Ensures de portability of middleware and application
software Reference development environment
Vendors might provide better Development Environments compatible with T-Builder
Adopted the GNU development environment
Requirements Open Compatible with multiple CPUs
24AA
NN
TT
SS
Middleware Distrib. ~ T-DistMiddleware Distrib. ~ T-Dist
Distribute encrypted Software (binary) When the executable is run, the software is decrypted
and billed using the eTron (License ticket) Prevent illegal use of Software Promoting Distribution
• Generation of the encrypted Software by the server
• License control using eTRON
• Software-specific License control
25AA
NN
TT
SS
Middleware Distrib. ~ T-DistMiddleware Distrib. ~ T-Dist
Target Systems Software
Applications Subsystems Device Drivers Dynamic Libraries
Contents Static Libraries Audio-Visual
Software Electronic Book
Examples Permit execution
only on eTRON systems that store a certain encryption key
Payment mechanism based in the number of times the software runs
26AA
NN
TT
SS
Middleware Distrib. ~ T-DistMiddleware Distrib. ~ T-Dist
Server
Client / eTRON
27AA
NN
TT
SS
Middleware Distrib. ~ T-DistMiddleware Distrib. ~ T-Dist
Encrypted Middleware Format
28AA
NN
TT
SS
Middleware Distrib. ~ T-DistMiddleware Distrib. ~ T-DistM
idd
lew
are
Ven
dor
T-e
ngin
e F
oru
m
U
ser
Encrypted
Use
End of Use
Software Registration
Order
Agreement (T-Engine Forum acts as Proxy)
Delivery
eTRON
• 16 bit CPU
• 16 Mb Address Space
• 4 Kb RAM
• 96 Kb ROM
• 32 Kb EEPROM
eTRON/16 Chip
29AA
NN
TT
SS
ConclusionsConclusions
T-Engine forum emphasize the standardization and distribution methodology of the middleware
Don’t directly provide software Encourage vendors to produce the software
Easing development and interoperability Easing distribution Guarantying licensing
Provision of tools for porting existing software as T-Engine middleware
On top of the T-kernel