lkml.org 
[lkml]   [2000]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: Help offered/tasks wanted - mentor needed
    On Thu, Feb 17, 2000 at 11:49:11PM -0600, Jeff Dike wrote:
    > > would please point me in the direction of areas needing help, and
    > > would be kind enough to give me an introduction to that area of the
    > > kernel then I'd be greatfull.
    >
    > Well, I've got the world's simplest kernel port (the user-mode port - see
    > http://user-mode-linux.sourceforge.net). So, if the lower levels of the
    > kernel interest you, that's all pretty simple process-level code. Fiddling
    > with that ought to be a relatively gentle introduction to the complexity that
    > lies above it.
    > Jeff
    ---end quoted text---

    my $0.02

    Break it into manageable blocks and understand them before moving into
    other areas. I would suggest starting with main.c (That's what I am doing.)
    To facilitate reading this, I preprocess it and then filter it with this perl
    script which is pasted below. This makes it a whole lot easier to read. Of
    course, you can run menuconfig to set up <linux/autoconf.h> which defines all
    the preprocessor constants in main.c. This may seem weird, but it's how I am
    approaching the same problems...

    This is released under public domain... It's a quick hack. You may need to
    modify it. One potential drawback is gcc removes the c comments prior
    to preprosessing. Some might not like that, but I would rather read the
    plain bare source... Hope it helps you.

    Karen.


    #!/usr/bin/perl -w
    #
    # This file removes the excess empty lines and some other junk from a
    # preprocessed c source file. It does not remove the c comments. The
    # compiler actually does that magic prior to running the preprocessor.


    my $operandfile;
    my $basefilename;
    my $linetest;
    my $linebuf;

    die "\n\nYou must enter the file name as the only command line argument!\n\n"
    if ($#ARGV != 0);

    $operandfile = shift @ARGV;
    die "\n\n$operandfile is not a valid file name.\n\n"
    unless ( -f $operandfile && -r $operandfile && -w $operandfile );

    open(INPUT, $operandfile) || die "Can\'t open $operandfile : $!\n";

    # see man perlop->/STRING
    chomp ($basefilename=qx<basename $operandfile>);
    open(TEMPFILE, ">/tmp/$basefilename.buffer")
    || die "Can\'t open for write /tmp/$basefilename.buffer : $!\n";
    select TEMPFILE;

    $linetest=0;
    while (<INPUT>) {
    $linebuf = $_;
    s/^[ \t\a\f\r\e]+//;
    if (/^\n/ && $linetest == 0) {
    print "$linebuf";
    $linetest++;
    }
    elsif (! /^[\n#]/ ) {
    $linetest = 0;
    print "$linebuf";
    }
    }

    close (INPUT);
    close (TEMPFILE);
    open (INPUT, ">$operandfile")
    || die "Can't open for write $operandfile : $!\n";
    open (TEMPFILE, "/tmp/$operandfile.buffer")
    || die "Can\'t open /tmp/$operandfile.buffer : $!\n";
    select INPUT;
    while (<TEMPFILE>) {
    print INPUT;
    }
    close (INPUT);
    close (TEMPFILE);

    # see man perlop->/STRING
    qx<rm -f /tmp/$operandfile.buffer>;


    --
    ----
    Karen Shaeffer
    Neuralscape; (831) 426-8547
    Santa Cruz, Ca. 95060
    shaeffer@neuralscape.com http://www.neuralscape.com
    -------------------------------------------------------

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

    \
     
     \ /
      Last update: 2005-03-22 13:56    [W:0.036 / U:0.408 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site