Time of Update: 2018-12-03
學習Linux裝置驅動時第一步就是構建核心樹,首先下載Linux核心,按Linux Device Dervier 3作者的說法,只要是linux-2.6.xxx的核心都可以,我的是linux-2.6.30.4。具體步驟:(1) 下載核心源碼包,並解壓:[root@yanbo kerneltest] # tar -zxvf linux-2.6.30.4.tar.gz(2) [root@yanbo linux-2.6.30.4] # make mrproper(3) [root@yanbo
Time of Update: 2018-12-03
除了init程式外,所有的linux程式都是由其他程式或使用者啟動的UID是使用者身份的關鍵,類型uid_t#include <sys/types.h>#include <unistd.h>uid_t getuid(void); 啟動程式的使用者的UIDchar* getlogin(void); 與目前使用者關聯的登陸名 /etc/passwd/etc/shadow #include <sys/types.h>#include
Time of Update: 2018-12-03
寢室的網路採用802.1X認證,新裝了個RedHat 9 ,發現上不了網,需要安裝 802.1X 認證用戶端。學校的網管只提供華為的Windows用戶端,沒有Linux版。自己動手,從 www.open1x.org 下載 xsupplicant ,從 http://libdnet.sourceforge.net/ 下載 libdnet-1.7.tar.gz 。先編譯安裝libdnet、再安裝xsupplicant。之後mkdir /etc/1xcp 1x.conf /etc/1x/編輯
Time of Update: 2018-12-03
原貼:http://www.linuxfly.org/post/300/ 5 [原]Linux下的rename命令 linuxing , 16:28 , 網路服務 » 虛擬機器 , 評論(0) , 引用(0) , 閱讀(61) , Via 本站原創 大 | 中 | 小 引用地址: 注意:
Time of Update: 2018-12-03
先來個常式:#include <stdio.h>#include <stdlib.h>#include <unistd.h>int main(int argc, char* argv[]){ pid_t pid; pid = fork(); if(0 == pid) { printf("This is child process, %d\n", getpid()); sleep(5); }
Time of Update: 2018-12-03
如何將Linux配置為一個FAX伺服器- 中國WEB開發人員網路 (http://www.webasp.net)-- 技術教程 (http://www.webasp.net/article/)--- 如何將Linux配置為一個FAX伺服器 (http://www.webasp.net/article/11/10591.htm) -- 作者:未知-- 發布日期: 2004-06-11 一. 介紹 下面介紹的配置採用了Hylafax
Time of Update: 2018-12-03
Steps i followed in setting up Kgdb-Serial b/w two Desktop Pc's.Downloaded kgdb-2.4(eperimental)patches from SourceForge.net: kgdb.Downloaded Linux kernel-2.6.16.40 from kernel.org.I used quilt utilty to patch the kernel.In Dev m/c$ cd
Time of Update: 2018-12-03
linux下一類通用錯誤的解決方案編譯原始碼的時候,會經常出現一類錯誤就是:/usr/bin/ld: cannot find -libutempter更加通用點的就是/usr/bin/ld: cannot find -l***後面的星星表示一類錯誤的名字。這個錯誤的原因很簡單,就是連結錯誤,很簡單的做法就是手動設定連結一次,就拿/usr/bin/ld: cannot find -libutempter來說:我們現在lib檔案夾下面去看看該類庫檔案存在的形式:cd /usr/libls -la |
Time of Update: 2018-12-03
1. findfind是最常見和最強大的尋找命令,你可以用它找到任何你想找的檔案。find的使用格式如下: $ find <指定目錄> <指定條件> <指定動作> - <指定目錄>: 所要搜尋的目錄及其所有子目錄。預設為目前的目錄。 - <指定條件>: 所要搜尋的檔案的特徵。 - <指定動作>:
Time of Update: 2018-12-03
在學習Linux驅動的過程中,遇到一個宏叫做container_of。該宏定義在include/linux/kernel.h中,首先來貼出它的代碼:1. 439/** 2. 440 * container_of - cast a member of a structure out to the containing structure 3. 441 * @ptr: the pointer to the member. 4. 442 *
Time of Update: 2018-12-03
先編寫testserver指令碼。再把指令碼拷貝/etc/init.d目錄下。/////////////////////////////////////////////////////////////////////// #!/bin/bash## chkconfig: 35 90 12# description: testserver server# # Get function from functions library. /etc/init.d/functions # Start
Time of Update: 2018-12-03
linux 線程 進程經典文章作者: alexclark(http://alexclark.itpub.net)發表於: 2004.12.15 14:57分類: 所見即所得 (WYSIWYG) 出處: http://alexclark.itpub.net/post/670/10087--------------------------------------------------------------- linux 線程
Time of Update: 2018-12-03
文章參考Linux核心修鍊之道。1. 系統調用概念大家都知道作業系統的作用是管理電腦的軟硬體資源,但是作業系統要向使用者提供各種各樣的服務,而使用者應用程式訪問這些服務的方式就是通過系統調用。但是一般來說,我們都是通過作業系統封裝好的API(應用編程介面)來間接使用系統調用的。比如在Windows編程中,你可以調用WinAPI,他以C庫的形式給出。比如在Linux當中,我們調用的read函數:int read(int handle, void *buf, int nbyte),
Time of Update: 2018-12-03
《精通unix下c語言-編程與項目實踐》學習筆記1.庫的分類 庫可分為靜態庫和動態庫兩種。
Time of Update: 2018-12-03
以下內容來自 beginning linux programming一書第5章 終端#include <stdio.h>#include <stdlib.h>#include <termios.h>char *menu[] = {"a - add new record","d - delete record","q - quit",NULL,};int getchoice(char *greet,char *choices[],FILE *in,
Time of Update: 2018-12-03
以下內容來自 linux beginning programming #include <unistd.h>#include <stdlib.h>#include <curses.h>int main(){WINDOW *new_window_ptr;WINDOW *popup_window_ptr;int x_loop;int y_loop;char a_letter =
Time of Update: 2018-12-03
代碼: 1.c#include <unistd.h>#include <stdio.h>#include <stdlib.h>int main(){ if(!isatty(fileno(stdout))){fprintf(stderr,"You are not a terminal\n");exit(1);}exit(0);}gcc 1.c -o t./t ./t > file 輸出You are not a
Time of Update: 2018-12-03
sudo apt-get install libncurses5-dev 安裝 gcc 1.c -o t -lncurses (-l不可少)以下內容來自 beginning linux programming#include <stdio.h>#include <unistd.h>#include <stdlib.h>#include <string.h>#include <curses.h>int main(){const
Time of Update: 2018-12-03
幾日前公司同事王開源同志將筆記本系統轉成了liunx系統,看上去不錯,應該有的應用基本上都有了。如文檔處理軟體、表格處理軟體、eclipse開發環境等。別說,還真不錯。自己又一次動心想裝一個liunx系統使用,可是還沒有敢這樣做,採用linux系統實在是太浪費精力了,很多東西要自己設定。 業內推廣Liunx系統N年了,很多人都在鼓吹著Linux這好那好的,可是我們為什麼不選擇Linux呢? 我想主要應該有以下幾個原因: 1、系統安裝的自動化不夠 目前windows系統不管是什麼版本的
Time of Update: 2018-12-03
6.1下半部下半部的任務就是執行與中斷處理密切相關但中斷處理常式本身不執行的工作。對於在上半部和下半部之間劃分工作,儘管不存在某種嚴格的規則,但還是有一些提示可供借鑒:(1)如果一個任務對時間非常敏感,將其放在中斷處理常式中執行。(2)如果一個任務和硬體相關,將其放在中斷處理常式中執行。(3)如果一個任務要保證不被其它中斷打斷,將其放在中斷處理常式中執行。(4)其它所有任務,考慮放在下半部執行。當我們開始嘗試寫自己的驅動程式的時候,讀一下別人的中斷處理常式和相應的下半部會令你受益匪淺。現在的問題