Adding Kernel Call - Problem with make - Minix

This is a discussion on Adding Kernel Call - Problem with make - Minix ; Hi, I'm using Minix 3.1.1 on a VM. I'm trying to add a kernel call but I am having a problem issuing a 'make' command in /usr/src/kernel/. I think I've modified all the appropriate files in the system task, and ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Adding Kernel Call - Problem with make

  1. Adding Kernel Call - Problem with make

    Hi,

    I'm using Minix 3.1.1 on a VM.

    I'm trying to add a kernel call but I am having a problem issuing a
    'make' command in /usr/src/kernel/.

    I think I've modified all the appropriate files in the system task,
    and library to accept a kernel call.
    I have also added added my function do_mycall.c to the subdirectory /
    kernel/system.

    My problem is when I try to run 'make' in /usr/src/kernel/. I get the
    follow error:
    Undefined:
    _do_mycall
    make in /usr/src/kernel: Exit code 1

    Now, I'm not sure whether I have to edit the Makefile in /usr/src/
    kernel/system or if this is done automatically?
    When I do edit the Makefile in /usr/src/kernel/system, I get the
    following errors:

    This is with $(SYSTEM)(do_mycall.o) \
    added to the list in Makefile

    # make
    make: Don't know how to make ../system.a(do_mycall.o)

    This is with $(SYSTEM)(do_mycall.o): do_mycall.o
    $(CC) do_mycall.o
    added to the list in Makefile

    # make
    make: No targets provided in Makefile near line 146
    (line 146: $(SYSTEM)(do_mycall.o)...)

    I appreciate any help on this,
    Thanks in advance,
    Derek.

  2. Re: Adding Kernel Call - Problem with make

    Hello,

    Derek Lee wrote:

    > Now, I'm not sure whether I have to edit the Makefile in /usr/src/
    > kernel/system or if this is done automatically?


    No, this is not done automatically, you'll have to do that yourself.

    > When I do edit the Makefile in /usr/src/kernel/system, I get the
    > following errors:


    > This is with $(SYSTEM)(do_mycall.o) \
    > added to the list in Makefile


    > # make
    > make: Don't know how to make ../system.a(do_mycall.o)


    > This is with $(SYSTEM)(do_mycall.o): do_mycall.o
    > $(CC) do_mycall.o
    > added to the list in Makefile


    I think you made a typo. Only the rule's name should end in .o, the rule's
    dependency should be do_mycall.c, as should the argument to the compiler.
    The rule you entered is circular.

    Regards,

    Jens

    --
    Jens de Smit
    Student Computer Science | Vrije Universiteit Amsterdam
    jfdsmit@few.vu.nl | http://www.few.vu.nl/~jfdsmit
    "[In the end, people] get furious at IT that the goddamn magic isn't working"
    -- Stewart Dean

  3. Re: Adding Kernel Call - Problem with make

    Hi,

    "J.F. de Smit" wrote:

    > I think you made a typo. Only the rule's name should end in .o, the rule's
    > dependency should be do_mycall.c, as should the argument to the compiler.
    > The rule you entered is circular.


    I apolgoise, I did make a typo, but the typo was in this form.
    In my actual source code, the correct code appears as:

    $(SYSTEM)(do_mycall.o): do_mycall.c
    $(CC) do_mycall.c

    Which still gives me the error -
    make: No targets provided in Makefile near line 146
    (line 146: $(SYSTEM)(do_mycall.o): ...)

    ??

    Regards,
    Derek.

  4. Re: Adding Kernel Call - Problem with make

    Derek Lee wrote:
    > Hi,


    > "J.F. de Smit" wrote:


    >> I think you made a typo. Only the rule's name should end in .o, the rule's
    >> dependency should be do_mycall.c, as should the argument to the compiler.
    >> The rule you entered is circular.


    > I apolgoise, I did make a typo, but the typo was in this form.
    > In my actual source code, the correct code appears as:


    > $(SYSTEM)(do_mycall.o): do_mycall.c
    > $(CC) do_mycall.c


    Hmmm. I'm just guessing now, but it could be that your additional line has
    incorrect whitespace. 'Make' can be very picky about its whitespace. Make
    sure that the rule you wrote is preceded by an empty line, there are only
    spaces (preferably, only one) between the name of
    the target and its dependencies and that the line containing the compiler
    command starts with a single TAB. If that does not fix the problem, I'm
    out of ideas.

    Regards,

    Jens

    --
    Jens de Smit
    Student Computer Science | Vrije Universiteit Amsterdam
    jfdsmit@few.vu.nl | http://www.few.vu.nl/~jfdsmit
    "[In the end, people] get furious at IT that the goddamn magic isn't working"
    -- Stewart Dean

  5. Re: Adding Kernel Call - Problem with make

    "J.F. de Smit" wrote:

    > Hmmm. I'm just guessing now, but it could be that your additional line has
    > incorrect whitespace. 'Make' can be very picky about its whitespace. Make
    > sure that the rule you wrote is preceded by an empty line, there are only
    > spaces (preferably, only one) between the name of
    > the target and its dependencies and that the line containing the compiler
    > command starts with a single TAB. If that does not fix the problem, I'm
    > out of ideas.


    Thanks Jens, it compiles now.
    It was the TAB. I had incorrectly used spaces to line up
    $(CC) do_mycall.c.





+ Reply to Thread