Re: More linker magic..

Benjamin Redelings I (bredelin@ucla.edu)
Tue, 03 Aug 1999 12:26:50 -0700


I think Ingo is right... Why not make this clean? I know that
traditionally the boot code has been partially a hack to simply
bootstrap the rest of the kernel, but clean initialization should really
cause any problem, should it?
It just so happens that I wrote (and am writing) some code that does
just this ordering. Its not really that hard, but I don't think the
'single number' idea works:

Basically,
1. You have a directed graph, where an edge from node1 to node2 means
that node2 depends on node1.
2. You give all nodes an attribute called 'order', starting at
0.
3. Every time you add an edge to the graph, you force
(1) order(node2) >= order(node1)+1;
except for loops (which we can thus detect).
4. This can have repercussion, so you follow them through the
graph.
5. But you don't follow edges from node1 to node2 if node2 is (already)
connected to node1 is a sequence of strictly increasing order.

That is perhaps a bit oversimplified, but thats about it. I just wrote
a template library in C++ that does this to analyze code structure in an
evolution simulation that evolves corewars-like programs, and it works
fine (at least that part does).
Anyway, all this graph analysis code could be
1. Freed on boot, or
2. Perhaps run at compile time?

David Woodhouse's idea that kernel subsystems could be distributed
entirely independantly sounds pretty cool :)

BTW, if anybody knows where I could find some tools that have implented
a program that does flow chart generation and visual display from
directed graphs, I'd be quite happy :) Perhaps somebody who works on
optimization in compilers?

Thanks,
-BenRI

-- 
"This isn't right.  This isn't even wrong." -- Wolfgang Pauli
Benjamin Redelings I      <><     http://www.bol.ucla.edu/~bredelin

- 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/