views:

4800

answers:

10

I am using ubuntu 8.04.1 and i am trying to write a character driver in kernel mode. What would be a good ide, ideally with code completion, to do that ?

+1  A: 

Although a bit "fringe" I always recommend Ultimate++ for Linux development. Not only the library itself is quite good, but the IDE is brilliant for any kind of C/C++ development.

The problem with kernel development, as I suppose you are already aware, is that besides code completion and project management you'll get little else from the IDE. Most of the debugging is done spitting things out to the system log and meditation :)

dguaraglia
+3  A: 

If you're not comfortable compiling the kernel yourself, you probably shouldn't be doing module development. So, I'd suggest saddling up with vim or emacs - whichever suits you better - and gcc, and getting good at building things by hand.

To be honest, I've never known of anyone doing kernel or module dev in linux using an IDE... but, maybe Eclipse can support a kernel build?

rpj
Well, only dabbled in modules, but really any IDE capable of running `make` will build, but _beyond_ that, how much support you'd get...
Bernard
A: 

i'd use Kate

or, if you like CTags, KDevelop

Javier
A: 

If all you ask of an IDE in your context are the basic things IDEs provide, then I'd say Eclipse with the CDT plugin will more than suffice. On KDE, I've also used KDevelop, which I find a simple, clean, easy-to-use IDE. Personally, I'd stick to using Vim for something as serious as kernel module development.

ayaz
+1  A: 

Haven't used it for years, but Anjuta is pretty powerful for C development and it supports standard autotools/automake/autoconf projects and etc.

Check out http://anjuta.sourceforge.net/ or download packages for Ubuntu

axel_c
Oh God. Last time I used Anjuta... No. It is best not spoken. *shudder*;p
Bernard
autotools has little to do with linux kernel
shodanex
+1  A: 

Emacs would give you a bare-bones unintelligent word completion(which at times, i've found quite useful). You would be able to compile and even insmod you module from inside emacs. Also, IMHO, avoid going for a X-windowed IDE, since you are writing a kernel module, you might cause the system to crash during development. Lesser the files open, lesser the chance for filesystem corruption. So, go for emacs on the console.

technomancer
+16  A: 

I've recently been hunting around this kind of problem space myself. Ive found crash and qemu/kvm incredibly useful for the basic testing. People often tell you often not to test a kernel/modules on a system with X, although I usually have a serial console and kdump setup to catch the vmcore to find out what exactly happened (more useful than just the log messages).

My views on editors i've been using:

Eclipse

While java based, the ganymede version seems quite responsive even when dealing with larger C projects such as the kernel. The source manager integration seems nice. I deal with multiple (300+) trees of the kernel, so it gets a good work out.

The Indexer does lag behind a bit, but after adjusting some startup parameters, it seemed to handle indexing of a few kernels with no particular problems. The auto-build functions of the C project didn't suit the kernel well, but its quite easy to add an external "build" for something like the kernel. The downside is that the debugger does not deal with vmcore/crashdumps, at least I couldn't figure out how.

The debugger could however connect a remote kernel under GDB, so this may be useful for those debugging remote live systems.

Vim/Gvim

I hear people cry about VIM not being a suitable tool for editing large amounts of code, I find this simply untrue. Gvim along with cscope, NerdTree and ctags make working with large code bases quite efficient and easy to work with.

A second tab open with "crash" (http://people.redhat.com/anderson/crash_whitepaper/ ) running allowed me to inspect and copy names/elements between the editor. The Eclipse debugger didnt open vmcore files, and I couldn't figure a way to open a terminal with any decent size to be useful with crash.

Emacs

Not my favourite editor, but I've learned the basics of how it works, and it ends up being very similar to vim.

Kdevelop.

KDevelop indexer wouldn't index more than 3 code trees. Didn't investigate why. Code completion didnt work so well with a code base this large.

None of these editors integrate "well" with kvm/crash which is an area I'd like to see improved.

Hope this helps.

Wade Mealing
+3  A: 

I used vim/gvim with ctags, cscope, c.vim.

See also the tutorial "Make Vim as Your C/C++ IDE Using c.vim Plugin" (http://www.thegeekstuff.com/2009/01/tutorial-make-vim-as-your-cc-ide-using-cvim-plugin/)

Here are some screen shots : http://lug.fh-swf.de/vim/vim-c/screenshots-en.html

BianJiang
+1  A: 

MicroEmacs, according to Wikipedia and The Rampantly Unofficial Linus Torvalds FAQ.

mouviciel
+1  A: 

Kscope is exactly something you want to look at. As the homepage says :

KScope is a KDE front-end to Cscope. It provides a source-editing environment for large C projects, such as the Linux kernel.

So you have cscope + and IDE. Or if you are not pleased with it, use your favourite editor + the linux cross reference site

shodanex