How to add a C file and Enable it in Linux Kernel?

This is a discussion on How to add a C file and Enable it in Linux Kernel? within the Linux Programming forums, part of the Platform Specific Boards category; I would like to know how would you enable the Congestion Control Algorithm correctly (lets call it Tcp_quic or quic). ...

  1. #1
    Registered User
    Join Date
    Jan 2012
    Posts
    37

    How to add a C file and Enable it in Linux Kernel?

    I would like to know how would you enable the Congestion Control Algorithm correctly (lets call it Tcp_quic or quic).


    My code is almost exactly like the tcp_veno.c file. Just the algorithm in the tcp_veno_cong_avoid() function changed.
    I would like to attached the code on here, but I got an upload error. I would post it as well, but it is pretty long.


    I have successfully compile the Linux Kernel with the C file (in the directory linux-3.4-rc7\net\ipv4\tcp_quic.c)
    I just need to enable it, so I can use my algorithm and add it to the Kernel.


    I know that most people said that you should not mess with the Kernel, but it is something I would like to try.


    The code below is how I should be able to enable the Congestion Control Algorithm.


    Code:
    echo quic > /proc/sys/net/ipv4/tcp_congestion_control

    This code works for vegas, cubic, and veno because they are in the Linux Kernel.


    Is there another file or something that I need to edit to make this change?

    Oh and I get an error when I put the code above in the terminal:

    Code:
    bash: echo: write error: No such file or directory
    Last edited by geewhan; 07-06-2012 at 07:46 PM.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,671
    You should probably read these things in detail, if you're messing with the kernel
    Linux Loadable Kernel Module HOWTO
    The Linux Kernel Module Programming Guide
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Jan 2012
    Posts
    37
    I just realize that in the Linux Kernel folder(kernel\linux-3.3.6\net\ipv4), where I added the tcp_quic.c file, does not have .mod.o or .o file. With means that the tcp_quic.c did not compile successfully, right? However why did the compile in the terminal compile successfully? I read on one forum that may be I need to change something in the MAKEFILE to have .o file, is this true? I am not sure how I would do this if it is so.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linux kernel
    By Annonymous in forum Linux Programming
    Replies: 15
    Last Post: 11-09-2011, 11:26 AM
  2. Linux kernel module help
    By Annonymous in forum Linux Programming
    Replies: 18
    Last Post: 05-01-2011, 10:59 PM
  3. Linux Kernel I/O C programming
    By inferno_gogo in forum C Programming
    Replies: 11
    Last Post: 02-18-2009, 03:44 PM
  4. priorities in Linux kernel??
    By micke_b in forum Linux Programming
    Replies: 0
    Last Post: 02-22-2008, 07:10 AM
  5. linux kernel 2.5
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 07-31-2002, 11:17 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21