First of all let me give you a brief on the insides of Ethernet MAC.
We have a MAC module which interacts with Physical layer and we have DMA which interacts with memory. So the Ethernet frame flow is like this

Transmit:
Memory-->DMA-->MAC-->Physical Layer
Receive:
Memory<--DMA<--MAC<--Physical Layer

Transmit and receive descriptors are basically used by DMA. In these descriptors, we  give address of  memory location from where DMA reads and writes back the Ethernet frame while transmitting and receiving respectively. Apart from memory location,  many other important parameters which  are required by DMA  to process a frame are programmed in descriptors.Once all the information is programmed, we give the control of descriptors to DMA. We can have one or many descriptors for one frame. When transmit or receive of frame is complete , DMA updates the status in descriptors and assign them back to user. Once we read status and frame data,  we again give control of descriptors back to DMA and the process continues.
It's our choice how many descriptors we want to program. The more descriptors we program...the more frames we can process in one go (high performance) but yes at the cost of more kernel resources. There is always a trade off in kernel.


horace papa 發表在 痞客邦 留言(0) 人氣()

使用 screen

在命令列下打 screen 就會進入 screen 的天地:

% screen

注意,所有 screen 的指令都是以 Ctrl 鍵加上 a 鍵開始的,在之後以 C-a 代表,C-a c 代表按住 Ctrl 鍵不放再按 a 鍵,然後放開按 c 鍵;而 C-a C-c 代表按住 Ctrl 鍵不放再按 a 鍵,然後放開後再按住 Ctrl 鍵不放按 c 鍵。

開啟,關閉,切換

C-a c 或 C-a C-c 開啟新的視窗,並同時切換到這個新的視窗

C-a n 或 C-a C-n 或 C-a (space) 切換到下一個視窗(0->1 1->2 ...)

C-a p 或 C-a C-p 切換到上一個視窗(1->0 2->1 ...)

C-a C-a 切換到上一個顯示過的視窗(不是照順序切換)

C-a 0 切換到第 0 個視窗

C-a (1..9) 切換到第 (1..9) 個視窗

C-a w 或 C-a C-w 會列出目前所開啟的視窗

0$ tcsh 1$ tcsh 2*$ tcsh 3$ tcsh

有星號 "*" 的表示目前顯示中的視窗,之後的 tcsh 代表這個視窗的 title ,預設是以開啟時的 shell 名稱

C-a K 關閉所有的視窗並退出 screen

C-a ' 或 C-a " 會出現 "Switch to window:" 字樣,輸入號碼後就可切到該視窗

單一視窗使用中的指令

C-a C 清除目前的視窗內容

horace papa 發表在 痞客邦 留言(0) 人氣()

When install zylin cdt plugin into eclipse, it will suffer the problem that could not find the"http://www.zylin.com/zylincdt"as below,

After searching, the correct address for installing zylin cdt should change to http://opensource.zylin.com/zylincdt

 

 


horace papa 發表在 痞客邦 留言(0) 人氣()

refer to:

https://jingyan.baidu.com/article/d621e8dae805272865913fa7.html

 

一、安装

创建安装目录,在/usr/java下建立安装路径,并将文件考到该路径下: 

# mkdir /usr/java

 

1、jdk-6u11-linux-i586.bin 这个是自解压的文件,在linux上安装如下: 

please go to download jdk-6u11-linux-i586.bin from

http://www.oracle.com/technetwork/java/javase/java-archive-downloads-javase6-419409.html

# chmod 755 jdk-6u11-linux-i586.bin 

# ./jdk-6u11-linux-i586.bin (注意,这个步骤一定要在jdk-6u11-linux-i586.bin所在目录下)

在按提示输入yes后,jdk被解压。

出现一行字:Do you aggree to the above license terms? [yes or no]

horace papa 發表在 痞客邦 留言(0) 人氣()

Create a image of VMDK file for existing harddisk in ubuntu linux host:

$sudo VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk -rawdisk /dev/sda

if create a image is created from a given partition of physical harddisk, 

$sudo VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk -rawdisk /dev/sda -partitions 1,5

Create a image of VMDK file from a exsting harddisk in window host:

  1. Run cmd as adminstrator mode 
  2. C:\> cd "Program Files\Oracle\VirtualBox"
  3. C:\Program Files\Oracle\VirtualBox> VBoxManage internalcommands createrawvmdk -filename "C:\xxx.vmdk" -rawdisk "\\.\PhysicalDrive1"

the "\\.\physicalDrive1" is the harddisk which the image create from.

if create a image is from a given partition of physical harddisk, 

C:\Program Files\Oracle\VirtualBox> VBoxManage internalcommands createrawvmdk -filename "C:\xxx.vmdk" -rawdisk "\\.\PhysicalDrive0" -partitions 6

if need to involve more partitions at once, could add "," between two partitions number, for example, -partitions 6,5

 

reference from:

https://www.virtualbox.org/manual/ch09.html#idm8266


horace papa 發表在 痞客邦 留言(0) 人氣()

Installing  VirtualBox Guest Addition in host and target platform still can't chanage window XP resolution, the highest resolution is 1024X768.

Two methods to adjust display resolution.

1.Set vesa resolutions in host platform:

cd c:\programfiles\oracle\virtualbox  
VBoxManage setextradata "VM name" "CustomVideoMode1" "1400x1050x16

2.Configuring the maximum resolution of guests when using the graphical frontend:

VBoxManage setextradata global GUI/MaxGuestResolution any

will remove all limits on guest resolutions.

VBoxManage setextradata global GUI/MaxGuestResolution >width,height<

manually specifies a maximum resolution.

VBoxManage setextradata global GUI/MaxGuestResolution auto

restores the default settings. Note that these settings apply globally to all guest systems, not just to a single machine.

 

reference from

https://www.virtualbox.org/manual/ch09.html#idm8266

 

  •  

horace papa 發表在 痞客邦 留言(0) 人氣()

[音響論壇] 調整LP唱盤的八大基本功

音響論壇第87期 217-221頁 作者/劉漢盛。 

在LP時代,許多人終其一生聽LP唱片,然而,他們可能連唱頭要調整三個角度都不知道。只知道唱頭鎖上唱頭蓋,加上適當針壓就能唱出聲音了。從「知」的角度來看,他們可說是糊里糊塗的聽著唱片。從「不知」的角度來看,他們才是真正幸福的LP迷,因為他們從來未曾感受到調整唱頭唱臂的痛苦。 
 

 

調整唱頭唱臂有什麽痛苦呢?第一:聲音不穩定。往往今天聽了好聲,明天聲音就跑掉了。至於為什麽聲音會跑掉?從來這就是無頭公案。也因為聲音不穩定,LP時代邀請人來家裏聆樂時,往往就因為聲音跑掉而尷尬極了。第二:越調越迷糊:每一個人在調整唱頭唱臂時都想要越調越好,但往往反覆調過幾次之後,聽覺越來越遲鈍,越來越迷糊,也越來越不敢確定到底哪一次聲音最好。調到後來,經常就是心神耗盡,疲勞崩潰收場。第三:變數大多。就以唱片本身來說好了,唱片彎曲不說,每個廠牌的唱片厚度還不一樣。唱片彎曲其他的調整就都白費了,因為所有的角度都會不正確。而厚薄不同也讓費心調好的垂直循軌角V.T.A心血泡湯,因為我們爭的也就是那零點零幾公分的差異。第四:要非常小心。為什麽非常小心是痛苦之一?當然羅,因為祇要您一不小心,昂貴的唱針就會被您弄斷。唱針一弄斷至少就要花個幾千幾萬,您不會心疼痛苦嗎? 

基於這四大痛苦,所以今日CD盛行真是救苦救難菩薩,讓大多數人從苦海中解脫。奇怪?既然聽LP唱片那麽的痛苦,為什麽還有人甘之如飴呢?其實答案也很簡單。第一:聽LP唱片有成就感。調整功夫的高低直接就影響到聲音的好聽與否,功夫不夠,聲音就不好聽;功夫好,大家都稱讚。因此,聽LP唱片比聽CD要來得有成就感。第二:LP是類比的聲音。類比聲音裏有數位聲音所無法企及的許多細節,而且音質也更自然。這也是許多人仍不放棄聽LP唱片的主要原因。 

對於從LP時代跨到CD時代的LP迷而言,調整唱頭唱臂的一些基本功夫他們皆已具備。而對于那些要從CD時代跨入LP領域的新LP迷而言,他們恐怕就沒有這些基本功夫。因此,我在這裡想以最簡單的方式來為這些新鮮人講述調整唱盤系統的八大基本功。有了這八大基本功之後,您再往更細微的地方去發展,很快的就會有所成就。 

第一功:調唱盤、轉盤的水平 

這裡所說的唱盤包括整座唱盤本身以及轉盤。尤其是轉盤,如果轉盤本身沒有水平,那就沒什麽戲好唱了。為什麽?由于它不水平,抗滑會有問題,唱片溝槽二側受力也不同。這樣一來,許多問題就會產生。 

調整方法:使用水平儀。水平儀有二種,一種是圓形中間有孔的,可以套在轉軸中央。另一種是長型的,可以測較大面積的表面水平與否。最好的方法就是二種都準備,先用長型水平儀側唱盤水平與否。然後再用圓形的測轉盤水平與否。至於要如何調轉盤的水平,由于各種唱盤的懸浮系統都不一樣,因此無法在此詳述。 

檢驗成果:以目視檢驗,看氣泡是否在中間就對了。 
文章標籤

horace papa 發表在 痞客邦 留言(0) 人氣()

[音響論壇] 調整LP唱盤的八大基本功

音響論壇第87期 217-221頁 作者/劉漢盛。 

在LP時代,許多人終其一生聽LP唱片,然而,他們可能連唱頭要調整三個角度都不知道。只知道唱頭鎖上唱頭蓋,加上適當針壓就能唱出聲音了。從「知」的角度來看,他們可說是糊里糊塗的聽著唱片。從「不知」的角度來看,他們才是真正幸福的LP迷,因為他們從來未曾感受到調整唱頭唱臂的痛苦。 
 

 

調整唱頭唱臂有什麽痛苦呢?第一:聲音不穩定。往往今天聽了好聲,明天聲音就跑掉了。至於為什麽聲音會跑掉?從來這就是無頭公案。也因為聲音不穩定,LP時代邀請人來家裏聆樂時,往往就因為聲音跑掉而尷尬極了。第二:越調越迷糊:每一個人在調整唱頭唱臂時都想要越調越好,但往往反覆調過幾次之後,聽覺越來越遲鈍,越來越迷糊,也越來越不敢確定到底哪一次聲音最好。調到後來,經常就是心神耗盡,疲勞崩潰收場。第三:變數大多。就以唱片本身來說好了,唱片彎曲不說,每個廠牌的唱片厚度還不一樣。唱片彎曲其他的調整就都白費了,因為所有的角度都會不正確。而厚薄不同也讓費心調好的垂直循軌角V.T.A心血泡湯,因為我們爭的也就是那零點零幾公分的差異。第四:要非常小心。為什麽非常小心是痛苦之一?當然羅,因為祇要您一不小心,昂貴的唱針就會被您弄斷。唱針一弄斷至少就要花個幾千幾萬,您不會心疼痛苦嗎? 

基於這四大痛苦,所以今日CD盛行真是救苦救難菩薩,讓大多數人從苦海中解脫。奇怪?既然聽LP唱片那麽的痛苦,為什麽還有人甘之如飴呢?其實答案也很簡單。第一:聽LP唱片有成就感。調整功夫的高低直接就影響到聲音的好聽與否,功夫不夠,聲音就不好聽;功夫好,大家都稱讚。因此,聽LP唱片比聽CD要來得有成就感。第二:LP是類比的聲音。類比聲音裏有數位聲音所無法企及的許多細節,而且音質也更自然。這也是許多人仍不放棄聽LP唱片的主要原因。 

對於從LP時代跨到CD時代的LP迷而言,調整唱頭唱臂的一些基本功夫他們皆已具備。而對于那些要從CD時代跨入LP領域的新LP迷而言,他們恐怕就沒有這些基本功夫。因此,我在這裡想以最簡單的方式來為這些新鮮人講述調整唱盤系統的八大基本功。有了這八大基本功之後,您再往更細微的地方去發展,很快的就會有所成就。 

第一功:調唱盤、轉盤的水平 

這裡所說的唱盤包括整座唱盤本身以及轉盤。尤其是轉盤,如果轉盤本身沒有水平,那就沒什麽戲好唱了。為什麽?由于它不水平,抗滑會有問題,唱片溝槽二側受力也不同。這樣一來,許多問題就會產生。 

調整方法:使用水平儀。水平儀有二種,一種是圓形中間有孔的,可以套在轉軸中央。另一種是長型的,可以測較大面積的表面水平與否。最好的方法就是二種都準備,先用長型水平儀側唱盤水平與否。然後再用圓形的測轉盤水平與否。至於要如何調轉盤的水平,由于各種唱盤的懸浮系統都不一樣,因此無法在此詳述。 

檢驗成果:以目視檢驗,看氣泡是否在中間就對了。 

horace papa 發表在 痞客邦 留言(0) 人氣()

1.creat a file.

   dd if=/dev/zero of=/swapfile bs=1024 count=65536

2.make swap file 

    mkswap /swapfile

3.enable swap file

   swapon /swapfile

4.add swap file instance into /etc/fstab for auto enable swap file after reboot.

   /swapfile swap swap defaults 0 0

 


horace papa 發表在 痞客邦 留言(0) 人氣()

When meet the problem that can't access the phpmyadmin with "http://xx.xx.xx.xx/phpmyadmin

  the problem could be caused by the following

  1) mysql isn't started up

        --> use this command to up mysql "sudo /etc/init.d/mysql start"

        --> check whether mysql is up or not "mysql -h 127.0.0.1 -P 3306 -u root -p

  2)apache2 dosn't up

        --> to start apache2 with command "sudo /etc/init.d/mysql start" 

  3) phpmyadmin doesn't configure properly

       -->reconfigure it with command "sudo dpkg-reconfigure phpmyadmin"

 

 

 


horace papa 發表在 痞客邦 留言(0) 人氣()