Jeep

initrd

101OIO | 12 十二月, 2008 12:25

http://hi.baidu.com/liyangzhao/blog/item/24628f36a93851320b55a9f5.html


http://www.ibm.com/developerworks/cn/linux/l-initrd.html

Open

# mkdir temp ; cd temp

# cp /boot/initrd-2.6.14.2.img initrd-2.6.14.2.img.gz

# gunzip initrd-2.6.14.2.img.gz

# cpio -i --make-directories < initrd-2.6.14.2.img

Make

$ find ./ | cpio -H newc -o > /boot/new-initrd.cpio

1354 blocks

$ cd /boot

$ gzip new-initrd.cpio

$ mv new-initrd.cpio.gz new-initrd.img


about malloc

101OIO | 08 十二月, 2008 19:25

做了一个调用malloc 分配memory 的小程序.

执行之后,top/ ps -A -o pcpu,pmem,cmd

发现memory 没有分配。

在malloc 后面添加 memset ,memory 才被分配


How to make root file system image file

101OIO | 07 十二月, 2008 22:23

Refer to : http://topic.csdn.net/t/20051103/17/4369767.html# http://en.wikipedia.org/wiki/Loop_device dd if=/dev/zero of=/tmp/tmp_loop bs=1k count=512 (容量根据需要自定义) losetup /dev/loop0 /tmp/tmp_loop (associate ) mkfs -t ext2 /dev/loop0 mount -t ext2 /dev/loop0 /mnt mkdir -P /mnt/dev mkdir -P /mnt/bin mkdir -P /mnt/etc ... umount /mnt losetup -d /dev/loop0 dd if=/tmp/tmp_loop | gzip -9 > /tmp/Image.gz rm -f /tmp/tmp_loop sync

How to Take a Screenshot in Linux With the Terminal (ImageMagick)

101OIO | 04 十二月, 2008 15:41

please refer to:

http://tips.webdesign10.com/how-to-take-a-screenshot-on-ubuntu-linux


import MyScreenshot.png

or

sleep 10; import -window root MyScreenshot2.png


usb mass storage

101OIO | 03 十二月, 2008 20:08

refer to http://www.linux-usb.org/gadget/file_storage.html

Create a windows FAT32 partition.

>fdisk /dev/XXX

Add filesystem

>mkfs.vfat /dev/XXXY

connect your usb mass storage device and host PC(windows) with mini USB.

insert module

>modprobe g_file_storage file=/dev/XXXY removable=y

#The 'removable=1' argument is required to make the device operate as a well known flash disk. If it is omitted Windows will recognize the device as a hard disk and it has to be assigned a drive letter manually.

Now you can see new device tip on your host PC


Linux 2.6.18 下安装 usb 无线网卡(zd1211)

101OIO | 26 十一月, 2008 22:59

[设备采购] SAGEM XG-760A chipset :zd1211 价格:30RMB 新旧程度:旧 使用状况:良好 http://auction1.taobao.com/auction/item_detail-0db2-01f4ed18b77e327bf152606009114236.jhtml?pm1=1 [安装Driver] 参考 http://blog.linym.net/archives/209 首先要安裝編譯相關套件 & 下載 linux source $ sudo apt-get install build-essential kernel-package linux-source 切換至 src 目錄並解開 linux source $ cd /usr/src $ sudo tar -xjvf linux-source-2.6.22.tar.bz2 拷貝 kernel 設定檔(.config) 至 linux source $ sudo cp linux-headers-2.6.22-14-generic/.config linux-source-2.6.22 編輯 zd_usb.c 加入新 USB ID,可利用 lsusb 指令可以找出網卡的 ID,如:2019:5303 $ cd linux-source-2.6.22 $ sudo vim drivers/net/wireless/zd1211rw/zd_usb.c 在檔案開頭不遠處可以看到一堆 USB ID 號碼,就是要加進這裡面,GW-US54GXS 是 ZD1211B 晶片,所以在 ZD1211B 下方增加一行: /* ZD1211B */ { USB_DEVICE(0x2019, 0x5303), .driver_info = DEVICE_ZD1211B }, 確認後就存檔離開 開始編譯驅動 $ sudo mkdir .tmp_versions $ sudo make drivers/net/wireless/zd1211rw/zd1211rw.ko 沒錯誤就會產生 zd1211rw.ko,將它覆蓋原本系統中的 $ sudo cp drivers/net/wireless/zd1211rw/zd1211rw.ko /lib/modules/`uname -r`/kernel/drivers/net/wireless/zd1211rw $ sudo depmod -a 重開機應該就可以正確驅動了:D [连接设置] 参考 :http://blog.csdn.net/Crob/archive/2008/11/13/3292950.aspx WEP iwconfig interface essid oceanboo-wireless key XXXX WPA 使用wpa_passphrase命令产生PSK: 用法:wpa_passphrase [passphrase] 比如:wpa_passphrase my_ssid abcd1234 network={ ssid="my_ssid" #psk="abce1234" psk=xxxxxxxxxxxxxxxxxxxxx } 完整的配置文件/etc/wpa_supplicant.conf ctrl_interface=/var/run/wpa_supplicant ctrl_interface_group=0 network={ ssid="your network SSID" psk="your wpa key (up to 63 characters)" proto=WPA priority=5 } $ wpa_supplicant -Bw -i eth1 -c /etc/wpa_supplicant.conf -D wext $ dhclient eth1 如何自启动 http://buffalo.nas-central.org/index.php/Install_wireless_zd1211#Network_with_WPA.2FWPA2_encryption

Error: No rule to make target XXX

101OIO | 25 十一月, 2008 11:22

在Src 目录下new 几个新的目录和文件,Make 就出现上面的Error 了。

〔问题原因〕

应该是在Make的过程中没有找到 指定的file。


〔解决方法〕

可以在Makefile.am 或者 Makefile 中 加入 VPATH(搜索path)

例如:

VPATH = base utils engineer


Convert files...

101OIO | 23 十一月, 2008 16:48

>abld build winscw udeb

...

Convert files...

之后就no response

[解决方法]

close Emulator and comand line windows , then try again


ERROR: Unable to identify a valid CodeWarrior for Symbian OS installation

101OIO | 23 十一月, 2008 16:38

ActivePerl-5.6.1.638

S60-SDK-200634-3.1

Carbide.c++_v1.3

Building an application(HelloWord) for the emulator from the CLI

>bldmake bldfiles

>abld build winscw udeb

ERROR: Unable to identify a valid CodeWarrior for Symbian OS installation


我觉得这个错误提示可能有些问题,它可能需要某个IDE的env setting, 而不一定是CodeWarrior

[解决方法]

windows menu : [开始]->Carbide c++ -> Configure environment for winscw command line

或者是 from command line

cd ..NokiaCarbide.c++ v1.3x86Buildenv_switchenv_update.exe


函数的声明 (Too Much Default Visibility)

101OIO | 21 十一月, 2008 17:33

函数的使用范围应该得到最大程度的限制,而不是default 的 globle。

如果不想 global ,就应该在前面加上static (only 在本源文件中使用)


#这个以前没有注意到

#参考来源 <Expert C programming> deep c secrets

# Too Much Default Visibility


return value of GTK callback function

101OIO | 21 十一月, 2008 14:22

False:

如果你想在你的Callback 之后继续把signal 传递给system继续处理

True:

如果你想到此为止(不再把signal 传递给system继续处理)


如何查看BT (BlueTooth) 的信息

101OIO | 20 十一月, 2008 15:43

lsusb -vv

bluez下面

hciconfig hcitool

 查看全文

如何查看wifi 的 frequency 和 out power

101OIO | 20 十一月, 2008 15:38

iwconfig 的输出中有 frequency 和 Tx-power

全局静态变量 global static variable

101OIO | 20 十一月, 2008 11:14

全局静态变量与 全局变量的区别在于全局静态变量只能在被本源文件中使用。

[header.h]

static int i = 0;
void setStatic();

[s1.c]

#include <stdio.h>
#include "header.h"

int main(int argc, char *argv[])
{
setStatic();
printf("%d %dn",&i, i);
return 0;
}

[s2.c]

#include <stdio.h>
#include "header.h"

void setStatic()
{
i = 1;
printf("%d %dn",&i, i);
}

gcc header.h s1.c. s2.c

./a.out

就可以看到 s1 和 s2 中i 具有不同的地址空间,也就是两个不同的变量。

 查看全文

指定进入S3 S4 的等待时间

101OIO | 17 十一月, 2008 13:35

/etc/rfppm/rfppm.cfg
 
Accessible and Valid XHTML 1.0 Strict and CSS
Powered by pLog - Design by BalearWeb