Выбрать главу

On a personal level, this book is dedicated to the two most important people in my life:

To Susan, my best friend, my soul mate. Thanks for sharing life’s journey with me.

To Brian, budding lighting designer, actor and musician, future pilot, and all-around great kid. Thanks for keeping me young at heart.

Never doubt that a small band of committed citizens can change the world. Indeed,  it is the only thing that ever has.

Margaret Mead

On a professional level, the book is dedicated to those who made it possible: open source programmers everywhere, especially that small band of open source pioneers whose radical notion of free software for the good of the community, and just for the fun of it, has indeed changed the world.

Foreword: A Brave New World of Embedded Software Development

The world of embedded computing has always struggled to offer its developers a consistent user interface. In the early days of 8-bit processors, the tools required to program them were very specific to the processor architecture, and developers used incircuit emulators to debug their machine-code based applications. Then, as high level languages emerged, a consistency and portability of embedded code emerged. Sadly, the user interface to use and debug these high level applications was typically proprietary to the tools vendor providing them. The open-source community provided good compiler tools such as GNU GCC, but the debug interface for GNU GDB was basic, and had no concept of an Integrated Development Environment (IDE). The closest any embedded vendors got to a consistent user interface was to use Microsoft’s Visual Studio extendibility to produce an embedded IDE, which was both beholden to Microsoft and only available on a Windows platform.

Fast forward to around 2003, and some embedded vendors (typically providing embedded Linux or similar OS solutions) decided to investigate using an open-source framework called Eclipse. This framework was not designed to be an embedded IDE, but was open and extendible enough that it could be made to work. These early embedded vendors also got involved with the Eclipse consortium and then the Eclipse foundation, and helped steer both the framework and some of the most relevant Eclipse projects to meet the needs of embedded developers.

Today in 2008, the Eclipse framework is used by the majority of embedded tools and operating system providers, and finally offers a consistent user interface for embedded developers regardless of which processor, operating system, host development platform or language is being used. In a matter of four years Eclipse has gone from relative obscurity to the de-facto environment for embedded software development. Embedded Systems Conferences will often have an Eclipse track, and even the EclipseCon conference typically has embedded tutorials, showing that Eclipse is important to embedded, and embedded is important to Eclipse.

Doug’s book is an important step for the embedded community as it guides the reader through the important first steps of using Eclipse for embedded development, especially when using an embedded Linux operating system. Although Eclipse is generally intuitive to a novice user, it is somewhat of a paradigm shift for embedded developers who have typically had a very “debugger-centric” view of the world. In Eclipse, the code is the center, and a debugger is just one of a selection of tools that are available to work with the code.

By reading this book from start to finish, the embedded developer will gain a rare insight into everything Eclipse: from its history, through a guided installation of Eclipse and CDT, and then into examples of new features, new projects, plug-ins, and commercial offerings. This will give the embedded developer the confidence and understanding to become very productive very quickly when using this new environment.

The many months that Doug has spent researching and evaluating Eclipse and then carefully detailing his findings in this book will serve our embedded community well, and will help to further propagate the adoption of this unique standard platform for embedded Linux developers across the globe.

Robert Day
VP Marketing, Lynux Works Solutions Members Representative, Board of Directors, Eclipse Foundation Chairman, Embedded Workgroup, Eclipse Foundation

Preface

The open source software movement has come a long way since Richard Stallman founded the Free Software Foundation in 1985. Once the province of hackers and hobbyists, open source has gone “mainstream.” Linux is now found in cell phones, PDAs, and countless other embedded devices. It’s even starting to make inroads on the desktop. Apache is probably the most widely used web server now. While the business models are not always clear, numerous companies are finding a niche commercializing open source in one form or another.

Then there’s Eclipse. Who would have thought, say 10 years ago, that the movers and shakers of the software industry, the likes of Borland, IBM, and Nokia, would come together and actually cooperate on a major open source platform for software development?

But we should all be very grateful they did. The result is, in my opinion, probably the most professional, well-managed open source project around. In terms of quality, ease of use, and just plain “polish,” Eclipse is as good as, if not better, than any other IDE I’ve used in my long career as a software developer. The breadth of functionality offered by the Eclipse ecosystem is truly astounding, encompassing Java and web development, enterprise development and business tools, and embedded device software development, to name just a few.

Embedded software development using Eclipse is the subject of this book. Many books have been written about Eclipse, but none have yet addressed this particular niche. This seemed like a good time. The C Development Toolkit (CDT) and Device Software Development Platform (DSDP) in particular seem to have made great strides with the June 2008 Ganymede release of Eclipse.

Specifically, the book focuses on embedded software development, using Linux as both the host workstation and as the target. Why Linux? Several reasons, really:

• It’s free, and so are the tools needed to build software.

• Linux derives from the same open source impulse that spawned Eclipse.

• I happen to like Linux, although there are times when I wonder why.

Audience and Prerequisites

While the primary focus is embedded software development, much of the book is applicable to anyone developing software in C or C++. Thus, it is expected that you have a reasonably good understanding of C and/or C++, know how to build executable applications from source code, and how to debug and run those applications — if not on an embedded target, at least on a workstation. You should at least know what a makefile is even if you’re not fluent in the details of the make language.

The required Linux background is fairly minimal. You should know your way around the file system and how to change file permissions, how to install software from archive files, and a little bit about scripting. Unlike most Linux hackers, I do most of my work from the KDE graphical desktop environment and only use the command shell when absolutely necessary. That’s a personal preference, and of course, you’re free to adopt whatever working style suits you.

No previous experience with Eclipse itself is assumed. If you’ve worked with other IDEs, so much the better.

This is very much a “hands-on” book. To get the most out of it, you need to actually do the steps that are being described. Of course, Eclipse runs equally well on Windows and Mac OS platforms. It’s just that it’s harder to set up a software development environment on those platforms. If you choose to use a Windows platform, Chapter 2, “Installation,” offers some guidance on setting up an appropriate Windows environment.