create a linux system call

Upload: thiago-alves

Post on 24-Feb-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/25/2019 Create a Linux System Call

    1/3

    CPE 436/536Homework 1 (parts a b and c)

    Thiago odrig!es "#$es

    1a % Constr!ct a s&stem ca## that a##ows 'or passing b#ocks o' data between a !ser program andkerne#

    To create the system call, some files of the linux kernel had to be modified. Here is a list of themodified files: /usr/src/linux/arch/i386/kernel/syscall_table.S

    /usr/src/linux/include/linux/syscalls.h

    /

    usr/src/linux/include/asmi386/unistd.h

    !fter modifyin" these files tocreate an entry for the ne#system call, the files for thesystem call itself had to be created:

    /usr/src/linux/include/linux/read_kernel_mem.h $user library%

    /

    usr/src/linux/kernel/read_kernel_mem.c $system call%

  • 7/25/2019 Create a Linux System Call

    2/3

    The &akefile forthe directory

    '/usr/src/linux/kernel( had to be modified to com)ile the ne# system call:

    1b se thes&stem ca## toret!rn thecontents o' thesched!#e *!e!es/trees at 1 second inter$a#s1c modi'& the sched!#er to assign processes/threads to cores based on their n!mber with oddn!mbered tasks r!nning on odd n!mbered cores and e$en n!mbered tasks r!nning on e$enn!mbered cores+ Two cores (,-1) are s!''icient 'or this task! ne# system call #as created in order to chan"e the )rocesses schedule and return the contents of theschedule *ueues/trees. The )rocedure to create the system call #as the same as the )re+ious item.elo# is the code for both files of the system call:

    /usr/src/linux/include/linux/read_kernel_mem.h $user library%

    /

  • 7/25/2019 Create a Linux System Call

    3/3

    usr/src/linux/kernel/read_kernel_mem.c $system call%