0

I've been following this tutorial to create a system call in Minix.

http://homepages.cs.ncl.ac.uk/nick.cook/csc2025/minix/syscall-exercise1.html

I can use the system call correctly when I use _syscall and now I would like to create a libc library function to allow it to be easily used. However, following the last steps of the tutorial are not working for me. When I try to compile my code, I receive undefined reference to [my library function]. I've added the prototype to unistd.h, I think something is going wrong in my Makefile. All I did was add SRCS += myfile.c. Is there something more I need to do?

3
  • To clarify, myfile.c exists, contains my library function, and is in the same folder as Makefile.inc
    – SpyMachine
    Feb 25, 2016 at 20:43
  • Are you able to succeed when you follow the tutorial exactly (ie. implementing a library function named printmsg() in a source file named printmsg.c? Feb 25, 2016 at 20:57
  • It appears to be slightly out of date, I followed it the best I could.
    – SpyMachine
    Feb 25, 2016 at 21:34

1 Answer 1

1

Ok, so I was putting SRCS+=... in libc/sys/Makefile.inc but this Makefile is mostly under a conditional which I just realized is false. I moved over to libc/misc and added everything there and it worked like a charm.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.