LJ Archive

UpFront

diff -u: What's New in Kernel Development

Zack Brown

Issue #217, May 2012

The GNU General Public License is pretty powerful. By ensuring that derivative works can be distributed only if the source code is made available as well under the same license, it ensures that a piece of free software can't suddenly “go dark”, if a given person or company wants to fork the code and release a proprietary version.

Since the very early days of Linux, however, there has been a nagging question surrounding this issue: are kernel drivers actually derivative works? If the courts ever decide they are, the vast and growing array of binary-only kernel drivers suddenly will find themselves faced with a tough question: either release their source code under the GPL or stop distributing the driver to anyone.

Linus Torvalds has said that he's fine with binary drivers, but other folks have said that it's really the license itself, and not his opinion, that determines whether someone has violated the GPL. Thus far, the courts have not ruled either way, so the question remains open.

From a practical standpoint, however, it's possible for binary drivers to insinuate themselves so deeply into the kernel that they really do constitute a derived work, anyway you slice it. So, a long time ago, the kernel started using EXPORT_SYMBOL_GPL to mark kernel interfaces that truly were considered intrinsic, and that could be used only to code that identified itself as being released under a GPL-compatible license. So, for a long time now, binary-only drivers have had access only to a controlled subset of kernel interfaces that prevent them from essentially forking the kernel into a proprietary version.

That's the history, and it's a balance that seems to work well enough for everyone. But recently, Christoph Hellwig submitted a patch, which was accepted, that dramatically changed that balance in the Virtual Filesystem (VFS). As Anton Altaparmakov said in response to the patch, Christoph's code would make it virtually impossible for binary-only drivers to read or write files the way they always had before. The drivers would have to re-implement from scratch all the VFS interfaces for reading and writing.

Ultimately, it turned out that Christoph had not intended to add these restrictions, but the discussion revealed a fairly big gap between the opinions and preferences of various kernel developers. Alan Cox, for example, indicated (as nearly as I can make out) that he opposed all binary-only drivers and did not think they were legal, regardless of the existence of EXPORT_SYMBOLS_GPL. He said he'd never given permission for them to use any of his code. And, since his code is virtually everywhere in the kernel, that's saying a lot.

Alexander Viro, who's been the VFS maintainer for many years, said that all interfaces exported from the VFS should be made available to binary-only drivers, unless there was “a damn good reason” to restrict them. He also said that such restrictions would need to be clearly documented.

Spice Up Your Desktop with Cinnamon!

Shawn Powers

Issue #217, May 2012

If you are disgruntled by the new interfaces provided by recent distribution releases, namely GNOME 3 and Unity, you might want to take a look at Cinnamon. With its traditional feel and extreme theme-ability, Cinnamon is a desktop interface bound to spice up anyone's computer. The general feel is that of GNOME 2, or perhaps XFCE, but its polished look and downloadable themes make it truly exciting to behold.

(Screenshot from linuxmint.com.)

Development has revolved around Linux Mint, but Cinnamon also can be installed on Ubuntu for those so inclined. If you've never seen it in action, be sure to give it a whirl: cinnamon.linuxmint.com.

Non-Linux FOSS

Shawn Powers

Issue #217, May 2012

Some say Windows has all the best games, and in the case of Xonotic, it's partially true. Xonotic is a free, open-source, first-person shooter designed by the developers of Nexuiz. Xonotic uses a highly modified version of the Quake engine called DarkPlaces. Sporting both single and multiplayer modes, the fast-paced action and detailed maps will please even the fussiest gamers. Download the Windows version of Xonotic from the Web site: www.xonotic.org.

(Image from www.xonotic.org.)

Oh, and for those folks not running Windows? Yeah, it's available for you too. Xonotic runs on Windows, OS X and Linux. Get your frag on!

That's a Beautiful $DOCUMENT_TYPE You've Got There

Shawn Powers

Issue #217, May 2012

One of the biggest frustrations most new LibreOffice (or OpenOffice.org) users have is the lack of templates and clip art. We've addressed this problem before, but with the recent surge of LibreOffice, it's important to know how to improve your powerful office suite!

LibreOffice offers both templates and extensions to add creativity and flair to your documents. Whether you're looking for a template to aid with your home budgeting spreadsheet or want some clip art to advertise your garage sale, the LibreOffice Web site holds plenty of options.

A quick click to templates.libreoffice.org or extensions.libreoffice.org will give you a huge list of available add-ons. You also will have the opportunity to add your own templates or extensions to the Web site so others can benefit from your creations! The site features a voting system to help promote the highest quality submissions, and a search feature narrows down the available items to fit your needs. Check it out $DATE_THIS_ARTICLE_IS_READ!

Programming for Scientists

Joey Bernard

Issue #217, May 2012

My last several articles have covered different software packages that are useful to scientists trying to do computational science. I tried to explore as broad a spectrum of subjects as I could in those pieces, and I even covered some basic programming constructs like MPI or scipy. But, I always have been limited by the amount of space a venue like this allows. All I can do is provide a taste of what is out there and hope that readers take it away and learn more on their own. Also, in many cases people find themselves doing research in areas that never have been done by anyone else before. This means there will not be an appropriate software package, and researchers will need to write their own software from scratch.

One major problem for computational science researchers is that they simply do not have the time to attend normal classes over the span of a term or two in order to learn the skills they need to do their work. They need to be able to jump-start their research and essentially go from zero to 100mph in no time flat. Part of my day job is to help them do this. I provide crash courses in most of the subjects that they may need. But, what can they do when they leave and try to apply this information several days or weeks later? Enter the Software Carpentry site (software-carpentry.org), a resource that should be on every researcher's bookmark list. I have no association with the author and maintainer of the site. I'm just glad to have a high-quality source of information to which I can point my users.

The first level of resources available is a set of self-paced on-line workshops. These workshops are distributed under a creative commons license, specifically the Creative Commons Attribution License. This means you are free to use the material and remix it, as long as you properly attribute the author. These workshops cover a vast number of subjects and are available as both PDF and PowerPoint files. For some of the workshops, video screencasts even are available, so it's almost like having an instructor right there with you. Each topic is broken down into smaller sections to make digesting them easier. Additionally, exercises are available so you can review the material.

Many new researchers, graduate students and post-docs have had little or no experience in computational science at all. Many never even have seen any type of UNIX environment. This is quite a stumbling block, as most high-performance computing centers that I know of run Linux. So you probably will want to start with the workshop The Shell. This workshop is broken down into the following sections:

  • Introduction

  • Files and Directories

  • Creating and Deleting

  • Pipes and Filters

  • Permissions

  • Finding Things

  • Job Control

  • Variables

  • Secure Shell (SSH)

This list of items should make new Linux users comfortable enough to use the command line effectively. Because most HPC clusters are accessed through an SSH connection, being comfortable on the command line is essential.

The next workshop you should look at is the Version Control workshop. To my mind, this is one of the most important subjects to learn for computational science research. This is a field where code constantly is being toyed with, by many different people over long periods of time. It is of utmost importance to be able to back out experimental changes in the code when something breaks or when you've gone down the wrong path in your research. But, almost no one uses a version control system. So, just to make my life easier as a research consultant, please go ahead and check out this particular workshop. It will be one of the most useful workshops you could attend.

As far as programming workshops go, the only language explicitly covered is Python. The Python workshop is relatively complete, and it covers the following:

  • Basics: running Python, variables, comparison operators.

  • Control Flow: while loops and conditionals.

  • Lists: creating, deleting and maintaining lists, for loops.

  • Input and Output: dealing with files.

  • Strings: handling strings, formatting, concatenation.

  • Aliasing: what it is and how it can cause problems.

  • Functions: what they are and how to use them effectively.

  • First-Class Functions: binding functions to variables, passing functions to functions.

  • Libraries: importing modules, dealing with namespaces.

  • Tuples: creating and indexing, unpacking lists.

  • Slicing: slicing vs. indexing, and so on.

  • Text: how lines and characters are stored, dealing with unicode.

Python is relatively similar to other languages (like C), so you should be able to apply what you learn here to those other languages with just minor syntax translations. Also, Python is growing in popularity in scientific programming circles due to its clean formatting rules and the relative ease of incorporating external high-performance libraries written in C or FORTRAN. In this sense, you almost can consider Python to be a glue language, but it has quite a lot of capability available directly through external libraries like numpy and scipy. You could do worse as a computational scientist than learn Python. With its growing popularity, there is also a greater chance that the specific problem area you're researching already has tools or libraries available.

Once you have at least one language under your belt, it is time to learn more of the details involved in programming itself. These workshops cover the following:

  • Program Design: goes through a simple example of designing, debugging and improving a program.

  • Testing: how you should test your software, handle exceptions and do unit tests.

  • Make: how to use rules, patterns and macros to build your software.

These topics cover a lot of the extra items you need to know in order to program effectively, but they aren't strictly programming proper. That topic is covered by the following workshops:

  • Sets and Dictionaries: using associative data structures to represent data that doesn't really fit into a list.

  • Regular Expressions: how to use regular expressions for pattern matching.

  • Databases: an introduction to SQL.

  • Data Management: an introduction to managing your data.

  • Matrix Programming: using numpy to handle numerical processing.

  • Multimedia Programming: programming using sound, pictures and other media files.

  • Spreadsheets: using spreadsheets for analysis and visualization.

With these workshops, you will learn many of the programming elements and structures that will be of use to you in scientific programming. After this, you should have covered enough, hopefully, to be able to program a solution to the problem you are studying. Again, all of these workshops include exercises, so you actually can try applying what you have learned. I'm a firm believer that you don't learn anything until you actually try to use it.

In-person workshops and boot camps also are available. Because all of the material is available for free reuse, you simply can use the workshop materials to put on your own workshop or boot camp. The team behind Software Carpentry also is available to do in-person boot camps. You can contact them through the Web site to make arrangements. These boot camps are two- or three-day crash courses to cover the bulk of the material, and they're always being offered at different places around the globe—follow the blog to see when one is being offered in your neck of the woods. If you do decide to run your own, the team at Software Carpentry is happy to help out and spread the word through its network. A forum is available at the Web site for each of the workshop topics where you can discuss the material with other attendees or other presenters.

Finally, I suggest that you actually subscribe to the blog RSS feed. New workshops always are being added, and new boot camps always are being planned. Watching the RSS feed will keep you informed about these additions. As always, feel free to contact me if you have anything specific you'd like to see covered here. Hopefully, I've been able to plant the seed and give you ideas on how you can pick up the skills you need.

Open Formats, Open Editors

Shawn Powers

Issue #217, May 2012

E-books are currently quite a hot topic in the publishing world. Heck, for the past few months, it's been quite a hot topic here as well! Thankfully, digital publication doesn't have to mean proprietary formats and DRM-laden files.

If you want to delve into the world of e-book creation, you should check out Sigil. It's a cross-platform WYSIWYG tool for creating EPUB-format e-books. It supports images, table of contents, and all the other features that make e-books so powerful. If you have a book you want to convert into EPUB format, or if you just have a text file you'd like to add markup language to for e-readers, Sigil is a powerful tool you won't want to miss.

Download the latest version from code.google.com/p/sigil.

They Said It

Buying the right computer and getting it to work properly is no more complicated than building a nuclear reactor from wristwatch parts in a darkened room using only your teeth.

—Dave Barry

There is only one satisfying way to boot a computer.

—J.H. Goldfuss

In a way, staring into a computer screen is like staring into an eclipse. It's brilliant and you don't realize the damage until its too late.

—Bruce Sterling

If the automobile had followed the same development as the computer, a Rolls-Royce would today cost $100, get a million miles per gallon, and explode once a year killing everyone inside.

—Robert Cringely

A computer once beat me at chess, but it was no match for me at kick boxing.

—Emo Philips

LJ Archive