From aidebbs.edu.tw!news.csie.nctu.edu.tw!tpts1.seed.net.tw!vc0328 Sat Feb 18 13:13:42 1995
Path: aidebbs.edu.tw!news.csie.nctu.edu.tw!tpts1.seed.net.tw!vc0328
From: vc0328@tpts1.seed.net.tw (Vincent Chen)
Newsgroups: tw.bbs.comp.linux
Subject: linux安裝-1
Date: Sat, 18 Feb 1995 20:30:10 CST
Organization: Vincent Research.
Lines: 403
Message-ID: <vc0328.2.0002A51F@tpts1.seed.net.tw>
NNTP-Posting-Host: @140.109.247.5
X-Newsreader: Trumpet for Windows [Version 1.0 Rev B final beta #4]




Slackware的安裝



一、  準備開機磁片


　在安裝Slackware之前必須準備兩片磁碟片，一片是boot disk放
開機及核心程式，一片是root disk放基本的系統程式。基於記憶體
使用上的考量，不同的boot disk所支援的硬體各不相同，必須根據
自己的配備加以選擇。在使用boot disk開機後，會看到一小段介紹
，跟著出現boot: 等您輸入指令。如果root disk和boot disk放在
同一臺磁碟機上，直接按enter即可開始載入系統核心。如果想把
root disk放在另一臺磁碟機上，則鍵入drive2即可在系統核心載入
後，從另一磁碟機讀入系統程式。


Slackware目前提供的boot disk
(除old1118外，其他disk的核心程式皆為1.1.59)

bare        - 只支援IDE硬碟
cdu31a      - IDE + SCSI + CDU31/33a CD-ROM
cdu535      - IDE + SCSI + CDU531/535 CD-ROM
loaded      - 幾乎支援所有您的硬體配備?
mitsumi     - IDE + SCSI + Mitsumi CD-ROM
old1118     - 舊 1.1.18 核心程式
nec260      - IDE + SCSI + NEC 260 ( IDE CD-ROM )
net         - IDE + ethernet ( 用於NFS安裝 )
sbpcd       - IDE + SCSI + SB Pro/Panasonic CDROM
scsi        - IDE + SCSI + SCSI CD-ROM
scsinet     - IDE + SCSI + SCSI CD-ROM + ethernet
xt          - IDE + XT HD

＊　如果您是從CD-ROM安裝，則所使用的boot disk必須同時支援
    CD-ROM驅動程式及ISO9660檔案系統。

＊　net系列的boot disk似乎不支援iso 9660的檔案系統，所以即
　　使偵測到您的光碟機，還是不能從CD-ROM安裝。


Slackware目前提供的root disk

color144:    全螢幕彩色安裝程式。
umsds144:    將linux放進DOS的一個目錄內。
tty144:      單色交談式的安裝程式。
tape144:     支援從磁帶安裝。


＊　如果您拿到的是.gz檔,必須先用gzip -d *.gz解壓縮，再用
　　rawrite程式將磁片影像檔寫到軟碟上。

＊　在LINUX環境製作安裝磁片
    dd if=scsi of=/dev/fd0H1440

＊　在DOS環境製作安裝磁片

    G:\SLACKWAR\BOOTDSKS.144>..\rawrite
    RaWrite 1.2 - Write disk file to raw floppy diskette

    Enter source file name: scsi
    Enter destination drive: a:
    Please insert a formatted diskette into drive A: and press -ENTER- :
    Number of sectors per track for this disk is 18
    Writing image to drive A:.  Press ^C to abort.
    Track: 79  Head:  1 Sector: 16
    Done.


　在核心程式(boot disk)載入的過程中，會顯示各硬體驅動程式的
載入情形，如果一切順利，會看到要求放入root disk的訊息。由於
linux會自動偵測各硬體的設定，因此誤判的情形在所難免，而導致
當機。這時候必須重新開機，在看到boot: 的提示後，鍵入硬體設
定傳入核心，最常須要指定參數的週邊包括硬碟、網路卡、SCSI卡
等。指定方法如下：


boot: <ramdisk or drive2> <hardware setting>

１．　硬碟參數
　　　hd=cylender,head,sector
      ex: hd=901,5,53

２．　網路卡參數
　　　ether=irq,i/o port,parm 1,parm 2,device name
      ex: ether=10,0x300,eth0

３．　SCSI參數
      st0x=memaddr,irq             Segate ST02 controller
      t128=memaddr,irq             Trantor T128B controller
      tmc8xx=memaddr,irq
      ncr5308=port,irq,dma         NCR-5308 controller
      aha152x=port,irq,scsi id,1   Adaptec 152x controller

４．　指定一段I/O Port不去偵測
　　　reserve=port,count
      ex: reserve=0x300,0x2f


　在看到放入root disk的提示後，放入root disk並按enter鍵，一
段時間後，會看到一段提示訊息及login:等待使用者簽入系統，這
時候可以用root帳號簽入。


＊　在按enter前，請再詳細看一下螢幕上所顯示的驅動程式載入情
　　形，以確定您的光碟機、網路卡等週邊是否都正確的被偵測到。
　　如果有遺漏或錯誤，請確認使用的閞機片是否正確或參考上表將
　　該週邊的參數傳入系統核心。


Console: colour EGA+ 80x25, 1 virtual console (max 63)
Calibrating delay loop.. ok - 16.61 BogoMips
Serial driver version 4.00 with no serial options enabled
tty00 at 0x03f8 (irq = 4) is a 16450
tty01 at 0x02f8 (irq = 3) is a 16550A
Cyclom driver $Revision: 1.35 $$Date: 1994/12/16 13:54:18 $
lp1 at 0x0378, using polling driver
snd3 <Pro AudioSpectrum 16 rev 255> at 0x388 irq 12 drq 3
snd2 <SoundBlaster 2.0> at 0x220 irq 5 drq 1
snd1 <Yamaha OPL-3 FM> at 0x388 irq 0 drq 0
Floppy drive(s): fd0 is 1.44M, fd1 is 1.2M                            ┐ヾ
FDC 0 is a 8272A                                                      ┘
Configuring Adaptec at IO:330, IRQ 11, DMA priority 5                 ┐
scsi0 : Adaptec 1542                                                  │ゝ
scsi1 : Pro Audio Spectrum-16 SCSI                                    │
scsi : 2 hosts.                                                       ┘
  Vendor: QUANTUM   Model: LPS540S           Rev: 5900                ┐
  Type:   Direct-Access                      ANSI SCSI revision: 02   │
Detected scsi disk sda at scsi0, id 0, lun 0                          │
scsi : detected 1 SCSI disk total.                                    │
  Vendor: NEC       Model: CD-ROM DRIVE:210  Rev: 1.0                 │ゞ
  Type:   CD-ROM                             ANSI SCSI revision: 01   │
Detected scsi CD-ROM sr0 at scsi1, id 6, lun 0                        │
scsi : detected 1 SCSI cdrom 1 SCSI disk total.                       │
Scd sectorsize = 2048 bytes                                           │
SCSI Hardware sector size is 512 bytes on device sda                  ┘
Memory: 6816k/8448k available (768k kernel code, 384k reserved, 480k data)
This processor honours the WP bit even when in supervisor mode. Good.
Swansea University Computer Society NET3.019
Allocated 128 sockets.
Swansea University Computer Society TCP/IP for NET3.019
IP Protocols: ICMP, UDP, TCP
PPP: version 0.2.7 (4 channels) NEW_TTY_DRIVERS OPTIMIZE_FLAGS
TCP compression code copyright 1989 Regents of the University of California
PPP line discipline registered.
SLIP: version 0.8.3-NET3.019-NEWTTY (16 channels) (6 bit encapsulation enabled)
CSLIP: code copyright 1989 Regents of the University of California
NE*000 ethercard probe at 0x340: 00 00 c0 00 02 f1                    ┐
eth0: NE2000 found at 0x340, using IRQ 15.                            │々
ne.c:v1.10 9/23/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)        ┘
Checking 'hlt' instruction... Ok.
******************************************************************************
  Linux kernel 1.1.78 compiled by vincent@vr486.orient.net.tw (Vincent Chen)
******************************************************************************
Partition check:                                                      ┐
  sda: sda1 sda2                                                      │
  hda: Conner Peripherals 420MB - CFS420A, 406MB w/64KB Cache         │ぁ
  hda: enabled 32-sector multiple mode                                │
  hda: hda1 hda2 hda3 hda4                                            ┘

ヾ 軟碟機：Ａ為１．４４，Ｂ為１．２
ゝ SCSI卡：偵測到１５４２及ＰＡＳ－１６
ゞ SCSI週邊：偵測到硬碟及光碟機各一部
々 網路卡：網路卡在port 0x340，IRQ 15
ぁ 硬碟機：SCSI硬碟有兩個partition，IDE有四個


＊　在安裝時，很多人提到核心啟動時在CSLIP的地方會當機，從上
　　表可以看到CSLIP之後接著是載入網路卡驅動程式，因此大多是
　　網路卡沒有被正確的偵測到，請參照前面的說明將網路卡的設
　　定傳入核心即可。



二、  分配硬碟空間給linux



　在這�先介紹partition的概念，根據BIOS的流程，在完成硬體自
我測試(POST)後，系統會先試著從軟碟->硬碟讀入作業系統，若失
敗則再嘗試進入BASIC ROM(現在大概很少有機會看到了)，如果不能
讀入作業系統又找不到BASIC ROM，則在螢幕上顯示NO ROM BASIC，
SYSTEM HALTED。

　從硬碟讀入作業系統才是這�要討論的重點，BIOS會從硬碟第0軌
、第0面、第0區讀入一小段程式碼，在程式碼後面跟著一張表格，
記錄著各OS所在的位置及目前由那一個OS優先讀入(ACTIVE)。一般
狀況下partition table可容納4筆記錄，分別在0x1be、0x1ce、
0x1de,0x1ee的位置。當然，如果改寫前面那一小段程式碼，這�也
可以用來讀入更多的表格而不受4筆記錄的限制，或載入病毒程式碼
等。

  DOS是用fdisk程式來分配硬碟空間，linux所使用的程式也叫fdisk
，只不過在操作上有些差異。下面說明linux的fdisk操作方式：


＊　在配備4 mega記憶體的機器上安裝linux時，一定要建立一個
    swap partition，並且在執行setup程式前啟動swap，否則連
　　setup程式都會因記憶體不足，而無法執行。

    1. 在swap partition建好後，mkswap <device name> <blocks>
    2. 執行swapon <device name>


　下fdisk指令後可看到下面的畫面：

# fdisk

Using /dev/hda as default device!

Command (m for help):

　在這�fdisk以/dev/hda為編輯的對象，也就是IDE的第一部硬碟，
如果要把linux放在其他硬碟，或修改其他硬碟分配情形，可在fdisk
指令後加上該硬碟的device name，如IDE的第二部硬碟為/dev/hdb，
第三部為/dev/hdc，以此類推。SCSI則是/dev/sda、/dev/sdb。

＊　把linux放在第二部IDE硬碟，fdisk /dev/hdb
＊  把linux放在第二部SCSI硬碟，fdisk /dev/sdb

　進入fdisk後，用m指令可以得到一份指令列表。

Command (m for help): m

Command action
   a   toggle a bootable flag
   c   toggle the dos compatiblity flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   p   print the partition table
   q   quit without saving changes
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)
　
　ａ　－　將active的partition，設為非active
　ｃ　－　
　ｄ　－　刪除一筆partition記錄
  ｌ　－  列出本程程式所能辨認的partition代碼
　ｍ　－  列出可用的指令
　ｎ　－  新增一筆partition記錄
　ｐ　－　列出目前在硬碟上的partition記錄
　ｑ　－  離開本程式而不更動partition內容
　ｔ　－  修改某一個partition的類別
　ｕ　－  改變硬碟資料的顯示方式
　ｖ　－  查核partition記錄
　ｗ　－  將partition寫入硬碟
　ｘ　－  一些較低階的編輯功能


  以下是增加一個linux partition及一個swap partition過程：


１．　查看目前硬碟分配情形


Command (m for help): p

Disk /dev/hda: 16 heads, 63 sectors, 826 cylinders
Units = cylinders of 1008 * 512 bytes

   Device Boot  Begin   Start     End  Blocks   Id  System
/dev/hda1   *       1       1      53   26680+   4  DOS 16-bit <32M
/dev/hda2          54      54     521  235872   83  Linux native


２．　加入新的linux partition


Command (m for help): n

Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (522-826): 522
Last cylinder or +size or +sizeM or +sizeK (522-826): +8M

Command (m for help): p

Disk /dev/hda: 16 heads, 63 sectors, 826 cylinders
Units = cylinders of 1008 * 512 bytes

   Device Boot  Begin   Start     End  Blocks   Id  System
/dev/hda1   *       1       1      53   26680+   4  DOS 16-bit <32M
/dev/hda2          54      54     521  235872   83  Linux native
/dev/hda3         522     522     538    8568   83  Linux native


上面是新增一個8 Mega的partition，由於這個partition是用來作
swap用，而linux fdisk對新增的partition一律假定為linux native
(type 0x83)，所以必須再將這個partition改為linux swap(type
0x82)，方法如下：


Command (m for help): t

Partition number (1-4): 3
Hex code (type L to list codes): 82
Changed system type of partition 3 to 82 (Linux swap)

Command (m for help): p

Disk /dev/hda: 16 heads, 63 sectors, 826 cylinders
Units = cylinders of 1008 * 512 bytes

   Device Boot  Begin   Start     End  Blocks   Id  System
/dev/hda1   *       1       1      53   26680+   4  DOS 16-bit <32M
/dev/hda2          54      54     521  235872   83  Linux native
/dev/hda3         522     522     538    8568   82  Linux swap


現在要繼續新增一個存放linux檔案系統的partition，在這�是將
剩餘空間全分配給linux：


Command (m for help): n

Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 4
First cylinder (539-826): 539
Last cylinder or +size or +sizeM or +sizeK (539-826): 826

Command (m for help): p

Disk /dev/hda: 16 heads, 63 sectors, 826 cylinders
Units = cylinders of 1008 * 512 bytes

   Device Boot  Begin   Start     End  Blocks   Id  System
/dev/hda1   *       1       1      53   26680+   4  DOS 16-bit <32M
/dev/hda2          54      54     521  235872   83  Linux native
/dev/hda3         522     522     538    8568   82  Linux swap
/dev/hda4         539     539     826  145152   83  Linux native

３．　最後將修改完成的partition寫回硬碟，這一部分即可告一段落

Command (m for help): w

The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.



附錄：　本書開發環境


一、　安裝部分

      Slackware在boot disk上所提供的核心都內含selection功能
      ，而mouse這個device指向/dev/cua0，即第一個com port，
      因此畫面的擷取相當容易。

　　　１．　找一片DOS磁片，把selection、vi等您須要的程式用
　　　　　　'cp'指令複製到該磁片上，剩餘的空間用來存放所擷
            取的畫面。

      ２．　root disk載入後，找一個VC簽入，建立一個目錄如
            'msdos'，把剛才做好的磁片mount到'msdos'上，再執
            行'/msdos/selection'即可開始擷取畫面。

      ３．　擷取畫面時在畫面左上角double click滑鼠左鍵，mark
            一行，再用左鍵拖到右下角，畫面即可存入buffer。
            切到另一個VC，執行'vi'並按'a'進入append mode，
            將滑鼠移到左上角按右鍵，剛才的畫面即可填入本文
            字檔中，以':wq'指令存檔離開。


二、  執行過程示範部分


      以'openwin'指令進入open look的window manager，在shell
      下有一個'cmdtools'，在這個環境下執行程式的過程，都可用
      滑鼠左鍵mark畫面，再按Ctrl-滑鼠右鍵選'copy'，即可把畫
      面擷取到xclipboard內，再從xclipboard內存檔。

      ＊　全螢幕操作的程式如lynx、mc、setup等，還是必須用
        　'selection'程式擷取畫面。


＊                                        　　　　 　　＊　
＊　　本文除所註明之Slackware範例外，著作權屬陳建業　　＊
＊                                                     ＊
＊　１．　未經作者同意，本文不得任意轉載               ＊
＊　２．　在未經修改條件下，個人可任意使用本文件　　   ＊
＊　３．　在取得作者同意後，歡迎公開陳列本文件         ＊
＊                                                     ＊
＊　　　　　如有任何建議或更正，歡迎email至            ＊
＊             vc0328@tpts1.seed.net.tw    　          ＊
＊                                                     ＊



