Creating a System Call in Linux

前端 未结 3 668
自闭症患者
自闭症患者 2021-02-03 15:21

We just got a midterm project today for my \"operating systems\" course, we are requested to implement a system call (and I guess I assume we\'ll have to write a piece of code t

相关标签:
3条回答
  • 2021-02-03 16:02

    but does this mean I'll have to recompile the whole kernel, so the kernel knows about my module?

    Yes, you will need to recompile the kernel.

    • Implementing Linux System Calls
    0 讨论(0)
  • 2021-02-03 16:08

    I understand I'll need to update the table of the system calls

    It's /usr/src/linux/arch/i386/kernel/syscall_table.S

    does this mean I'll have to recompile the whole kernel, so the kernel knows about my module?

    Yes, indeed.

    Just wanted to get a feel for the size of the effort I'll be making.
    

    If you know what code you are going to write as a part of the system call, you're already done. You only have to wait out the kernel recompilation time. Here's a set of instructions:

    Implementing a System Call in Linux

    0 讨论(0)
  • 2021-02-03 16:10

    You want to read:

    • Linux Kernel Programming, Third Edition (Paperback) by Michael Beck (Author), Harald Bohme (Author), Mirko Dziadzka (Author), Ulrich Kunitz (Author), Robert Magnus (Author), Dirk Verworner (Author), Claus Schroter (Author), published by Addison-Wesley (Pearson Education), ISBN-10: 0201719754 , ISBN-13: 978-0201719758

    and possibly as well for more details:

    • Understanding the Linux Kernel, Third Edition By Daniel P. Bovet, Marco Cesati, published by O’Reilly, ISBN 10: 0-596-00565-2, ISBN 13: 9780596005658
    • Linux Device Drivers, Third Edition By Jonathan Corbet, Alessandro Rubini, Greg Kroah-Hartman, published by O’Reilly, ISBN 10: 0-596-00590-3, ISBN 13: 9780596005900
    0 讨论(0)
提交回复
热议问题