編譯linux核心 Documentation 為man手冊 收藏
對每一個linux核心以及驅動開發人員來說,核心內建的 Documentation目錄無疑是一個非常非常有用的參考資料和學習資料。建議多讀~
當我們在寫驅動或者修改核心的時候,可能需要用到某些kernel api,我們也想能夠像libc api那樣可以通過man手冊查看其使用方法,毫無疑問,直接到核心 source code 裡面去尋找到相關的函數定義是一種方法,但是顯得比較麻煩。你可以將核心api安裝為man手冊,然後你就可以很方便的 man xxx-kernel-api 了。具體步驟如下(based on FC6 ):
(1)在kernel source的頂層目錄,執行make installmandocs就可以將man 手冊安裝到 /usr/local/man/man9下面了。
NOTES: 注意,如果在執行make installmandocs的時候需要其他的一些工具程式,可以使用yum工具來進行線上安裝,比如,我的系統在make installmandocs時報缺少xmlto,所以執行yum install xmlto安裝好需要的工具之後再執行make installmandocs就可以了。
自此,已經安裝好了。下面show一段: man copy_from_user
COPY_FROM_USER(9) User Space Memory Access COPY_FROM_USER(9)
NAME
copy_from_user - Copy a block of data from user space.
SYNOPSIS
unsigned long copy_from_user (void * to, const void __user * from,
unsigned long n);
ARGUMENTS
to Destination address, in kernel space.
from Source address, in user space.
n Number of bytes to copy.
CONTEXT
User context only. This function may sleep.
DESCRIPTION
Copy data from user space to kernel space.
Returns number of bytes that could not be copied. On success, this will
be zero.
If some data could not be copied, this function will pad the copied
data to the requested size using zero bytes.
Kernel Hackers Manual January 2008 COPY_FROM_USER(9)
本文來自CSDN部落格,轉載請標明出處:http://blog.csdn.net/bshawk/archive/2008/01/27/2068676.aspx