Find the answer to your Linux question:
Results 1 to 7 of 7
Hello All, I am new to this forum and newbie to Linux as well. I want to implement an IO/disk scheduling algorithm (e.g. FCFS, SSTF, SCAN etc) for Linux kernel. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2014
    Posts
    10

    Linux Kernel Programming - How to implement disk scheduling algorithm?


    Hello All,

    I am new to this forum and newbie to Linux as well. I want to implement an IO/disk scheduling algorithm (e.g. FCFS, SSTF, SCAN etc) for Linux kernel. I have my own algorithm approach which I want to implement for Linux. I have installed VMware and Fedora on my machine. But I have no idea where to start implementing the algorithm now. I don't even know how to compile the Linux kernel code in fedora. This is all what I know about Linux right now.

    So my questions are:
    1 - How to compile Linux kernel code in fedora?
    2 - How shall I implement disk scheduling algorithm and what will be involved from start to finish implementing the disk algorithm for Linux Kernel?
    3 - What are the complexities involved to implement it?
    4 - Also share any good reading and video material for it?

    I'll be very grateful to you for any help.

    Thanks in advance,
    momersaleem
    Software Engineer

  2. #2
    Linux Guru
    Join Date
    Dec 2013
    Location
    Victoria, B.C. Canada
    Posts
    1,651
    Start here:
    https://fedoraproject.org/wiki/Building_a_custom_kernel

    Read this:
    kernel/git/torvalds/linux.git - Linux kernel source tree

    Search on "linux IO scheduling"

    I trust you do program in the C language? If not you're grabbing the stick at the wrong end.

  3. #3
    Just Joined!
    Join Date
    Mar 2014
    Posts
    10
    Dear Gregm,

    Thanks for your reply.

    I'll look into it. Hopefully, it will help a lot.

    I am a C# developer. I didn't program in C for a long time. But that does mean that I don't know C. You know, normally we start programming in computer science with C language. Then we gradually move towards other language like I am working in C# now. But I am still but worried about your statement

    "I trust you do program in the C language? If not you're grabbing the stick at the wrong end".

    Do you mean by this statement is that implementing IO scheduler in Linux is very difficult task or something else?

    Kindly guide me!

    Thanks again,
    momersaleem
    Software Engineer

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru
    Join Date
    Dec 2013
    Location
    Victoria, B.C. Canada
    Posts
    1,651
    The kernel is programmed in C. You do need to be very comfortable with the language to modify it. The kernel uses a variant of C that is often called GNU C. Again, to understand the kernel you'll need to understand that variance in C. Learning GNU C

    Programming for the kernel is different then application programming. If you want to modify the kernel then you'll have to understand the kernel and how to program for it. You may want to read "Linux Kernel Development" and "Understanding The Linux Kernel".

    It's not up to me to say what will be difficult for you.

  6. #5
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,737
    What gregm said. Kernel programming (and debugging) is NOT like application programming. See this link: https://www.kernel.org/pub/linux/ker...e/jwessel/kdb/
    A disc driver is a block-oriented device. I suspect that if you want to use one of the current main-stream file systems, then you will need to modify their drivers (ext2/3/4 for example). Also, I STRONGLY suggest that you study existing scheduling algorithms as implemented - you may find that what you want to do is already there!
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  7. #6
    Just Joined!
    Join Date
    Mar 2014
    Posts
    10
    Hello,

    Thanks for your replies. I am studying and understanding all these. Will get back to you in case of any issues.

    Thanks,
    momersaleem

  8. #7
    Just Joined!
    Join Date
    Mar 2014
    Posts
    10

    How to design images for disk scheduling algorithm to show on paper?

    Hello,

    I am also writing a term paper on disk scheduling algorithm so I need to know how to design images/figures for Disk Scheduling algorithm like designed in any disk scheduling algorithm.

    You can search for Major Half Served First (MHSF) algorithm paper to see the examples.

    Please do have a look and guide me if there exist any tool that can do this for me.

    Thanks,
    momersaleem

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •