Lesson 1: Setting up your development host, and general principles

Printer-friendly versionPrinter-friendly version

General course principles

In this first actual lesson, we're going to discuss how to set up your development host with all of the software you'll need for the entire course, but let's discuss a couple general course principles first.

As with many courses, all Crash Course offerings are designed to be "hands-on", replete with labs and exercises and homework and so on. More importantly, though, the plan is that everything you read in these lessons should just work. As much as possible, we want to avoid qualifiers such as, "If that doesn't work, try ...".

It's a truism that the most common frustration for beginners to any new topic is to follow instructions to the letter, and to have the result fail. To that end, it really is the goal of this course that everything here should just work, which means we have to necessarily restrict our course platforms to what I can personally test everything on.

I've chosen to base this course on my fully-updated, 64-bit Ubuntu 11.10 system, which means that if you use the same distro, the exercises should work exactly the same way. If you choose to use another, relatively recent distro, you'll almost certainly still have success; you'll just have to map the commands or packages yourself to what's appropriate, but we'll come back to that shortly. So what are you going to need?

What you need to install

In terms of downloading kernel source, we'll be cloning from a Git repository so, on your Ubuntu system, you'll want to:

$ sudo apt-get install git

Obviously, if you're already familiar with Git on Ubuntu, you can do whatever it takes to get the git command installed. (NOTE: Earlier versions of Ubuntu had a package called git-core, but that name now represents a transitional dummy package, and you should just install git.)

Next, when we get to configuring and building a new kernel, if you want to use a semi-graphical interface for that, you'll need to install the Curses development library:

$ sudo apt-get install libncurses5-dev

Finally, if by some chance you don't have a proper development environment, you can just:

$ sudo apt-get install gcc

For now, that should be sufficient and, if we need additional packages, we'll update this list as necessary. But here's the important principle to keep in mind.

Some students are going to want to do their work on a different distribution, or even in a virtual machine, and while there's simply not enough time to cover every possibility, that's why each lesson comes with a comments section.

If you want to try something different, by all means, feel free to experiment, and if it doesn't work, ask for help. On the other hand, if it does work, you can share that with other readers so everyone gets the benefit. If you discover an error, or omission, or clever trick, leave a note and I can always add it to the lesson. In the end, the point is to try the instructions, check the results, ask questions and share what you discover with others.

At this point, I'm sure there might be more I can mention but, once you think you've installed all the required packages for kernel development, head into the next lesson, where we'll discuss the kernel-related files and directories that should already be on your system.

ADDENDUM 1: It appears that Ubuntu still has the meta-package build-essential, which will install the combination of C and C++ compiler, development libraries and make, so a single install step might handle most of your requirements.

EXERCISES

As your first exercise, if you can think of any other packages that should be installed on an Ubuntu system (or are worth installing for later), leave a note in the comments section.

If you're planning on working with another distro or using a virtual machine, take careful notes and share those notes with others who want to try the same thing.

Comments

Ubuntu comes with GCC

With the Ubuntu 11.10, gcc is installed by default. It's even available in the live CD. I don't think it needs to be apt-get'ted.

The i386 live CD shows gcc version 4.6.1-9ubuntu3. I'd assume the amd64 (x86_64) live CD would be the same.

I suspect most of the necessary packages are already there.

I'm just being overly cautious. :-)

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <p> <br> <pre> <h1> <h2> <h3> <h4>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.