Question about _get_free_pages()

This is a discussion on Question about _get_free_pages() within the C Programming forums, part of the General Programming Boards category; Hello In the code : unsigned long size = 2621440; unsigned int order; order = get_order(size); __get_free_pages(GFP_KERNEL,order); 1.What value get_order(size) ...

  1. #1
    Registered User
    Join Date
    Mar 2012
    Posts
    26

    Question about _get_free_pages()

    Hello
    In the code :

    unsigned long size = 2621440;
    unsigned int order;
    order = get_order(size);
    __get_free_pages(GFP_KERNEL,order);


    1.What value get_order(size) will return ?
    2.What calculation get_order() is doing ?

    Thank You

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,761
    What do
    - the manual pages tell you?
    - searching the web tell you?
    - reading the source code tell you?

    If you're starting to mess about on kernel side, you really should be doing all these things before asking.
    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
    Mar 2012
    Posts
    26
    Wow
    Take it easy man
    If you don't know how to answer this one that is ok
    Let somebody how can

  4. #4
    Registered User
    Join Date
    Dec 2011
    Posts
    795
    You should really check out LXR, they have a repository of all the Linux kernel source code in an easily browsable format.

    But the way you've gone about trying to answer your question is awful: double posting, not putting any effort into the question first, and telling someone off because they didn't immediately answer your question.

    Kernel modules are very powerful (and potentially dangerous) programs, and writing them requires learning and hard work, even if you already know C. You need to be prepared to encounter difficulty and have the resources to solve it, rather than pasting a couple lines of code and expecting someone to explain them.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 03-23-2011, 10:00 AM
  2. *szString = things question/memory question
    By Jang in forum C Programming
    Replies: 3
    Last Post: 01-20-2011, 04:59 AM
  3. Newbish Question file reading question....
    By kas2002 in forum C Programming
    Replies: 23
    Last Post: 05-17-2007, 01:06 PM
  4. Self regiserting DLLs question and libraries question.
    By ApocalypticTime in forum Windows Programming
    Replies: 2
    Last Post: 03-22-2003, 02:02 PM
  5. A question of color...(not a racial question)
    By Sebastiani in forum Windows Programming
    Replies: 7
    Last Post: 01-15-2003, 08:05 PM

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