2013年9月5日 星期四

[LINUX]Something for ipmi driver and ipmitool

1. ipmi driver的source code放置於/usr/src/kernels/3.10.4-19_00032_g982b172/driver/char/ipmi下。

2.於/usr/src/kernels/3.10.4-19_00032_g982b172/使用下面command可以complie ipmi driver
make M=driver/char/ipmi

3. ipmi driver不允許user直接送下列的raw commnd,
   raw 0x06 0x33 - Get Message
   raw 0x06 0x34 - Send Message
   raw 0x06 0x35 - Read Event Message Buffer - 可使用ipmiutil getevent取得event

4. 如果要使用ipmitool -t 0x2c -b 6 raw 0x06 0x01,則必須建立nmchannel.i,因為ipmi driver在啟動時,會送Get Channel Info command去scan all channel,如果沒有nm channel的info,ipmi driver即不會傳送bridge command to BMC。

2013年7月17日 星期三

Build SPX in ubuntu

1. Change bash
unlink /bin/sh
ln ‐sf bash /bin/sh

2. install the necessary packages.
apt‐get install libtool
apt‐get install zlib1g
apt‐get install zlib1g‐dev
apt‐get install libcurl4‐gnutls‐dev




2013年5月14日 星期二

於u-boot內查看Linux kernl的printk buffer.

於Linux build directory內,打開System.map,搜尋__log_buf,

c035ff98 b __log_buf

->009e06b8即是printk buffer所在的kernel virtual address,可以使用下列方式取得實體位址
printk(KERN_ERR "__log_buf 0xc035ff98 ---> %p \n",__pa(0xc035ff98));

一般想偷懶的話可以直接將0xc0換成chipset 的DRAM memory base address,像AST2300是0x40000000

可以使用md 4035ff98讀出printk buffer的內容。

2013年4月2日 星期二

Pass the string array to some function.



傳遞字串陣列時,若已有事先指定每個字串的長度,則需於fun1 parameter中填入一樣的長度

否則會發生segment fault...

...

int fun1(char str[][5]){

        printf("str:%s.\n", str[0]);

        return 0;
}


int main(){
        char a[5][5];
        sprintf(a[0], "%xh", 32);
        fun1(a);
        return 0;
}