日本免费全黄少妇一区二区三区-高清无码一区二区三区四区-欧美中文字幕日韩在线观看-国产福利诱惑在线网站-国产中文字幕一区在线-亚洲欧美精品日韩一区-久久国产精品国产精品国产-国产精久久久久久一区二区三区-欧美亚洲国产精品久久久久

Linux 開(kāi)機(jī)程序之研討( 四 )




****************************; rc.serial; ******************************

#!/bin/sh
#
# /etc/rc.serial
#;;;;Initializes the serial ports on your system
#
#;;;;Version 2.01

echo "======================= rc.serial is begin !!! ====================="
cd /dev

## 下面三行中的前兩行是設(shè)定一些變數(shù) , 由於在這個(gè) shell script 中 , 須要
## 用到 /bin/setserial -b; 這個(gè)指令 , 或是須要用到所有以 cua 開(kāi)頭的 node
## 的次數(shù)太多了 , 因此 , 把它們?cè)O(shè)定為一個(gè)變數(shù) , 是一個(gè)不錯(cuò)的方法 . 尤其
## PORTS=`echo cua? cua??` 這是一個(gè)聰明的寫(xiě)法 , 那為什麼不寫(xiě)成 PORT=
## `echo cua*` 呢 ? 各位可以在 /dev 下分別使用這兩個(gè)指令 , 觀察輸出到底
## 有什麼不同 ......

SETSERIAL="/bin/setserial -b"
PORTS=`echo cua? cua??`
echo -n "Configuring serial ports...."


## 下面這行 , 沒(méi)有學(xué)過(guò) shell programming 的人很可能會(huì)看不懂 , 不過(guò)沒(méi)有
## 關(guān)系 , 這行中的 ${SETSERIAL} 會(huì)被換成 /bin/setserial -b , 而 ${PORTS}
## 會(huì)被換成 cua0 cua1 cua2 ....... cua31 , 所以整句翻譯就是 :
## /bin/setserial -b -W cua0 cua1 cua2 cua3 cua4 cua5 cua6 ...... cua31
## 那這行指令到底在做什麼呢 ? 其實(shí)只是在做中斷偵測(cè)的工作 .

${SETSERIAL} -W ${PORTS}


## 各位看到下面原來(lái)的注解了吧 . 當(dāng)你有一些特殊的卡時(shí) , 你可以把相對(duì)應(yīng)部
## 份前面的 "#" 去掉 , 以便能做自動(dòng)設(shè)定的工作 . 其實(shí)呢 , 這種情況實(shí)在
## 不多 , 大部份人的設(shè)備都差不了多少 , 說(shuō)到關(guān)於串連埠 , 差異就更少了 .
#
# AUTOMATIC CONFIGURATION
#
# Uncomment the appropriate lines below to enable auto-configuration
# of a particular board.; Or comment them out to disable them....
#


## 好了 , 這下我們又多了一個(gè)變數(shù) : AUTO_IRQ , 這在下面會(huì)用到 .

AUTO_IRQ=auto_irq


## 下面幾行非常整齊 , 它們可以分別被換成 :
## /bin/setserial -b /dev/cua? auto_irq skip_test autoconfig
## setserial 說(shuō)穿了也沒(méi)什麼 , 這個(gè)指令可以讓你對(duì) serial port 做設(shè)定及回報(bào)
## 的動(dòng)作 , 像 IRQ , I/O port 啦等等的事情 . 一般的情況下 , 大家的電腦中
## 通常只有 COM1-COM4 , 但假如你想增加新的 port , 那 setserial 就派上用
## 場(chǎng)了 .

# These are the standard COM1 through COM4 devices
#
# If you have an internal modeme with a Rockwell Chipset, add a "skip_test"
# to the /dev/cua3 line below.; (It"s not added by default because it will
# screw up people with 8514 displays).
#
${SETSERIAL} /dev/cua0 ${AUTO_IRQ} skip_test autoconfig
${SETSERIAL} /dev/cua1 ${AUTO_IRQ} skip_test autoconfig
${SETSERIAL} /dev/cua2 ${AUTO_IRQ} skip_test autoconfig
${SETSERIAL} /dev/cua3 ${AUTO_IRQ} autoconfig

# These are for the first AST Fourport board (base address 0x1A0)
#
${SETSERIAL} /dev/cua4 ${AUTO_IRQ} autoconfig
${SETSERIAL} /dev/cua5 ${AUTO_IRQ} autoconfig
${SETSERIAL} /dev/cua6 ${AUTO_IRQ} autoconfig
${SETSERIAL} /dev/cua7 ${AUTO_IRQ} autoconfig

# These are for the second AST Fourport board (base address 0x2A0)
#
${SETSERIAL} /dev/cua8 ${AUTO_IRQ} autoconfig
${SETSERIAL} /dev/cua9 ${AUTO_IRQ} autoconfig
${SETSERIAL} /dev/cua10 ${AUTO_IRQ} autoconfig
${SETSERIAL} /dev/cua11 ${AUTO_IRQ} autoconfig


## 從這里以下 , 我省略了一大段 , 因?yàn)檫@一大段都是支援特殊的卡

# These are the 3rd and 4th ports on the Accent Async board.
#
#${SETSERIAL} /dev/cua12 ${AUTO_IRQ} autoconfig
#${SETSERIAL} /dev/cua13 ${AUTO_IRQ} autoconfig
#


.
.
.
.
.
.
.


## 好了 , 我們跳掉了一大段 , 直到這里 . 各位看到下面的注解了 .
## 假如你想用手動(dòng)的方法指定 IRQ , I/O port , 及指定 chip 的型別
## 那你可以拿掉下面對(duì)應(yīng)那行前面的 "#" 并作適當(dāng)?shù)男薷?, 比如說(shuō)
## 你用的是比較新的 16550 或 16550A , 而不是 16450 , 那你就可以

推薦閱讀