Re: porting linux to DSP

Bjorn Wesen (bjorn@sparta.lu.se)
Tue, 27 Jul 1999 11:46:11 +0200 (MET DST)


i work with dsp's and embedded linux (but not together :) i thought i
could add some facts to the thread.

> > I am thinking whether linux can be ported to a DSP chip. I would like to
> > know if it is possible, given that it doesn't have a cache and not a huge
> > amount of memory etc. If anybody thinks it is possible, can you please tell
> > me where to start and how to go about doing it?

first, dsp's have extremely varying architecture. the guys here who says
gcc is bad news for dsp's probably think of the first generations, which
were accumulator based (one "data" register, a couple of index registers
and a bunch of adress registers) or in other ways had very few regs.
obviously this doesn't match well with c, which likes at least a couple of
general purpose regs. example: motorola 56k. there are other reasons why
you wouldn't want to use c for producing _math_ code on them, but that's
another story (fixed point dsp arithmetic is hard to understand for a
compiler etc).

there are a lot of dsp's out there that has a perfectly normal register
architecture, cache and blaha. they are like simple normal processors but
with a very fast multiplicator/accumulator. granted, some of them might
not have support for very large external ram's, which is a problem for
linux (you need at least 2 megs, i'd say. including the kernel). examples
are the texas c3x/c4x (which there exist a very nice gcc port to) and AD
sharc (dont know the amount of external ram off-hand...)

second, as for the linux part, dsp's don't have MMU's, but the linux
kernel runs perfectly well without an mmu in an embedded context. you just
can't expect all the memory management features to work. with MM support
stripped off, you can use the linux kernel as any other task switcher, and
get as a bonus the VFS, filesystems and networking stacks, which was what
the original poster expected of the system.

i wouldn't say it's easy to port linux to a dsp. but it's certainly
doable, given that the c compiler works well enough you have enough memory
in the system. i've booted linux running on 512kb sram, but that didn't
leave much room for other things that's why i recommended 2 mb dram above
:)

third, regarding the speed vs pentium issue. a low-end pentium always
costs around $75 doesn't it ? (they remove the models when they can't make
money on them :) a standard dsp costs between $2 and $15, and will not
match a celerons raw (non-disturbed) FPU performance, but it does cost
quite a bit less. a $5 DSP (like texas new c31/150) does 75 million
multiplications and accumulations per second. a celeron has to do those
ops after each other, reducing the lead somewhat.

/bjorn

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/