Time of Update: 2018-12-04
搭建交叉調試環境arm-linux-gdb與gdbserver2013-01-10 09:19:34分類: 嵌入式作業系統:Ubuntu9.04開發板:博創2410s交叉編譯工具:arm-linux-gcc-4.1.1gdb+gdbserver 是偵錯目標板的常用方法.網路環境如下:HOST 192.168.1.123 Target: 192.168.1.21NFS共用目錄: mount -t nfs -o intr,nolock,rsize=1024,wsize=1024 192.168.1
Time of Update: 2018-12-04
核心符號:存在核心空間函數或變數所對應的符號 核心符號表可以分為“私人”和“公用”。平常所說的核心符號表指的是“公用核心符號表”。
Time of Update: 2018-12-04
1.c code: #include <linux/module.h>#include <linux/types.h>#include <linux/fs.h>#include <linux/errno.h>#include <linux/mm.h>#include <linux/sched.h>#include <linux/init.h>#include
Time of Update: 2018-12-04
驅動程式中lsmod命令實際讀取的是/proc/modules檔案即與lsmod命令對應的結果是cat /proc/modules核心中已經載入的模組的資訊存在於/sys/module目錄下modprobe命令比insmod命令要強大,它在載入某模組時會同時載入該模組所依賴的其他模組使用modprobe -r filename的方式卸載將同時其依賴的模組modinfo 模組名命令可以獲得模組的資訊modinfo hello.kofilename: hello.koalias:
Time of Update: 2018-12-04
1. c code: #include <linux/module.h>#include <linux/types.h>#include <linux/fs.h>#include <linux/errno.h>#include <linux/mm.h>#include <linux/sched.h>#include <linux/init.h>#include
Time of Update: 2018-12-04
1.c code: #include <linux/module.h>#include <linux/types.h>#include <linux/fs.h>#include <linux/errno.h>#include <linux/mm.h>#include <linux/sched.h>#include <linux/init.h>#include
Time of Update: 2018-12-04
1.c code: #include <linux/init.h>#include <linux/module.h>MODULE_LICENSE("Dual BSD/GPL");static int hello_init(void){ printk(KERN_ALERT "hello world enter/n"); return 0;}static void hello_exit(void){ printk(KERN_ALERT "hello
Time of Update: 2018-12-04
1.準備編譯 ko 的 linux 環境: 本人使用 ubuntu 9.10.2.查看系統的版本: 使用 uname -r 命令, 本人系統是 2.6.31-22-generic.3.安裝核心標頭檔: sudo apt-get install linux-headers-`uname -r` 本人使用: sudo apt-get install linux-headers-2.6.31-22-generic. 可能會得到下面的資訊: linux-headers-2.6.31-
Time of Update: 2018-12-04
Dealing with Stopped JobsSometimes when you try to logout, you'll get a message saying there are "stopped jobs". These stopped jobs are programs or processes which have been suspended by a ^Z (Ctrl - Z) command. You have to either make the job
Time of Update: 2018-12-04
陸陸續續也寫了幾個Linux核心模組了,但每次都是把代碼寫在一個源檔案中,上次嘗試了寫在兩個.c檔案中,結果沒有編譯通過。無奈之下,將其中一個.c檔案重新命名成.h檔案,再include當另一個當中。但是,在.h檔案中寫函數的實現總感覺怪怪的。今天查看了以下Kbuild的文檔,有如下描述: If a kernel module is built from several source files, you specify that you want to build a
Time of Update: 2018-12-04
net_util.c #define WIRED_DEV "eth0" #define WIRELESS_DEV "ra0" #define PPPOE_DEV "ppp0"#define DEBUG_PRT(fmt, arg...) printf(fmt,##arg)/** * get ip address. * @param net_
Time of Update: 2018-12-04
在調試區域網路內通過UDP協議擷取其他裝置IP地址時,伺服器使用UDP 廣播後, 用戶端裝置無響應. 先研究一下正常情況下, UDP廣播通訊方法. 參考了網路上一寫資料. 代碼整理如下:伺服器端向: 255.255.255.255:6023發送UDP廣播:serverUDP.c#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h&
Time of Update: 2018-12-04
最近把系統全裝成Ubuntu9.04了,但是得考慮到別人都用Windows,不能把隨身碟格式化成Linux系統下的檔案系統,比如ext2、ext3、ext4。還是格式化成vfat格式比較妥當,下面是我的步驟: 1、首先要查看隨身碟的裝置名稱,此時必須保證隨身碟已經跟電腦串連,可以用下面兩個命令: (1)sudofdisk
Time of Update: 2018-12-04
參考網路資料,經整理驗證ok.#include <sys/socket.h>#include <sys/ioctl.h>#include <linux/if.h>#include <string.h>#include <stdio.h>int net_detect(char* net_name){ int skfd = 0; struct ifreq ifr; struct sockaddr_in *pAddr =
Time of Update: 2018-12-04
核心版本:2.6.33.4switch_to宏定義在System.h (arch\x86\include\asm)中,全文如下:/* * Saving eflags is important. It switches not only IOPL between tasks, * it also protects other tasks from NT leaking through sysenter etc. */#define switch_to(prev, next, last) \do {
Time of Update: 2018-12-04
Overview of Linux memory management 32-bit architectures can reference 4 GB of physical memory (2^32). Processors that have an MMU (Memory Management Unit) support the concept of virtual memory: page tables are set up by the kernel which map
Time of Update: 2018-12-04
標準Linux核心對於實體記憶體的管理採用1:3的分配比例,即實體記憶體的1/4為核心空間(kernel space),剩下的3/4為使用者進程空間(user
Time of Update: 2018-12-04
1、xargsxargs比較實用的應用 $ ls | xargs -t -i mv {} {}.bak -i 選項告訴 xargs 用每項的名稱替換 {}。 參數解析:t-----------------先把命令列印出來再執行i------------------用檔案名稱替換{} 刪除數量比較多的檔案 ls | xargs -n 20 rm -fr 參數解析:n---------------------n 數字
Time of Update: 2018-12-04
以下所有的命令均在aix6.1.0.0下通過(查看aix版本資訊的命令為oslevel)1、chown參考網站http://baike.baidu.com/view/1229019.htm 使用:chown beps:beps
Time of Update: 2018-12-04
目前在開發的一套軟體,使用OpenGL繪製大量圖片,圖片是在運行過程中動態根據需要載入進來的,在我的X200下,WindowsXP中運行該程式時,每次調用glTexImage2D()時,都感覺畫面有明顯的停頓感,而在Ubuntu8.10下,則絲毫感覺不到,系統運行異常的平滑。不過在Ubuntu下需要關閉Compiz,否則程式關閉時,原始案頭不會完全重新整理,會有部分程式畫面殘留在上面。