靠,這個任務可真長,拖拖拉拉的快幾個月了,,中間停下來學別的去了就把linux的事放下了,,直到見到了RAlf Brown' Interrupt List,,,不過這次裝的結果怎樣,自己的目的始終就是學習linux,,下一步就是要更多更努力的學習,,還有網路部分,爭取把linux1.0的網路部分安到0.11上 :>
我感謝下午的自己沒像往常那麼懶,,拆機箱把硬碟由slAve換到mAster,其實linux0.11的核心並不需要怎麼修改就可以用了,,當然是從結果上看 :>
這兩天鬱悶主要是因為硬碟是slAve,mAster的是塊壞的,導致像port 0x1f1發reset返回是7f,總是不對,,換過來後就好多了
其實就是改了if (drive>1 || heAd>15)
panic("Trying to write bAd sector");
因為硬碟大了heAd肯定會大於15,,而且硬碟要用NORMAL mode,,可我不明白,NORMAL的不是只能訪問520(還是512)mb的硬碟範圍嗎,,而我的minix分區明顯已經超過了,,,,要繼續學習!!
linux0.11的execve()只能執行那種最老的A.out的檔案,開始的時候/bin/sh拷的是rh9裡的bAsh,,是ELF格式的,導致無法用
再學習東西的時候一定要筆記,,要不過不了多久就會鬱悶第2遍.
前幾天查的RAlf Brown' Interrupt List中和IDE相關的部分:
-----------------------------------------------------------------------------
zmba,您好!
是我錯了,原來看linux0.11並不明白其目的在於通過0.11而瞭解核心,瞭解現在的核心,,當時就這樣過去了,,又是一次機會,被放過去了....
RAlf Brown' Interrupt List:
----------R12--------------------------------
CMOS 12h - IBM - HARD DISK DATA
Notes: A PC with a single type 2 (20 Mb ST-225) hard disk will have 20h in
byte 12h
some PCs utilizing external disk controller ROMs will use type 0 to
disable ROM BIOS (e.g. Zenith 248 with Plus HardCard).
Bitfields for IBM hard disk data:
Bit(s) Description (Table C0014)
7-4 First Hard Disk Drive
00 No drive
01-0Eh Hard drive Type 1-14
0Fh Hard Disk Type 16-255
(actual Hard Drive Type is in CMOS RAM 19h)
3-0 Second Hard Disk Drive Type
(same as first except extrnded type will be found in 1Ah).
----------R12--------------------------------
CMOS 12h - IBM PS/2 - SECOND FIXED DISK DRIVE TYPE (00-FFh)
SeeAlso: CMOS 11h"IBM PS/2"
Copied from Ralf Brown's Interrupt List
heAd sect cyl wpcom lzone ctl
磁頭數 每磁軌扇區數 柱面數 寫前預補償柱面號 磁頭著陸區柱面號 控制位元組
03F6 rW FIXED disk controller data register (see #P0871)
Copied from Ralf Brown's Interrupt List
Bitfields for fixed disk controller data register:
Bit(s) Description (Table P0871)
7-4 reserved
3 =0 reduce write current
=1 head select 3 enable
2 disk reset enable
1 disk initialization disable
0 reserved
SeeAlso: #P0862,#P0872
Bitfields for hard disk controller:
Bit(s) Description (Table P0872)
6 FIXED DISK write gate
5 FIXED DISK head select 3 / reduced write current
4 FIXED DISK head select 2
3 FIXED DISK head select 1
2 FIXED DISK head select 0
1 FIXED DISK drive 1 select
0 FIXED DISK drive 0 select
SeeAlso: #P0871
Copied from Ralf Brown's Interrupt List
Bitfields for diskette controller main status register:
Bit(s) Description (Table P0865)
7 =1 RQM data register is ready
=0 no access is permitted
6 =1 transfer is from controller to system
=0 transfer is from system to controller
5 non-DMA mode
4 diskette controller is busy
3 drive 3 busy (reserved on PS/2)
2 drive 2 busy (reserved on PS/2)
1 drive 1 busy (= drive is in seek mode)
0 drive 0 busy (= drive is in seek mode)
SeeAlso: #P0862
Copied from Ralf Brown's Interrupt List
Bitfields for Hard Disk Controller error register:
Bit(s) Description (Table P0512)
---diagnostic mode errors---
7 which drive failed (0 = master, 1 = slave)
6-3 reserved
2-0 error code
001 no error detected
010 formatter device error
011 sector buffer error
100 ECC circuitry error
101 controlling microprocessor error
---operation mode---
7 bad block detected
6 uncorrectable ECC error
5 reserved
4 ID found
3 reserved
2 command aborted prematurely
1 track 000 not found
0 DAM not found (always 0 for CP-3022)
SeeAlso: #P0513,#P0514
Bitfields for hard disk controller drive/head specifier:
Bit(s) Description (Table P0513)
7 =1
6 LBA mode enabled, rather than default CHS mode
5 =1
4 drive select (0 = drive 0, 1 = drive 1)
3-0 head select bits (CHS mode)
logical block address, bits 27-24 (LBA mode)
SeeAlso: #P0512,#P0514
Bitfields for hard disk controller status register:
Bit(s) Description (Table P0514)
7 controller is executing a command
6 drive is ready
5 write fault
4 seek complete
3 sector buffer requires servicing
2 disk data read successfully corrected
1 index - set to 1 each disk revolution
0 previous command ended in an error
SeeAlso: #P0512,#P0515
(Table P0515)
Values for hard disk controller command codes:
Command Spec Type Proto Description class:
00h opt nondata NOP
08h device reset
1xh opt nondata recalibrate 1
20h req PIOin read sectors with retry 1
21h req PIOin read sectors without retry 1
22h req PIOin read long with retry 1
23h req PIOin read long without retry 1
30h req PIOout write sectors with retry 2
31h req PIOout write sectors without retry 2
32h req PIOout write long with retry 2
33h req PIOout write long without retry 2
3Ch IDE opt PIOout write verify 3
40h req nondata read verify sectors with retry 1
41h req nondata read verify sectors without retry 1
50h req vend format track 2
7xh req nondata seek 1
8xh IDE vendor vend vendor unique 3
90h req nondata execute drive diagnostics 1
91h req nondata initialize drive parameters 1
92h opt PIOout download microcode
94h E0h IDE opt nondata standby immediate 1
95h E1h IDE opt nondata idle immediate 1
96h E2h IDE opt nondata standby 1
97h E3h IDE opt nondata idle 1
98h E5h IDE opt nondata check power mode 1
99h E6h IDE opt nondata set sleep mode 1
9Ah IDE vendor vend vendor unique 1
A0h ATAPI packet command
A1h ATAPI opt PIOin ATAPI Identify (see #P0524)
B0h SMART opt Self Mon., Analysis, Rept. Tech. (see #P0527)
C0h-C3h IDE vendor vend vendor unique 2
C4h IDE opt PIOin read multiple 1
C5h IDE opt PIOout write multiple 3
C6h IDE opt nondata set multiple mode 1
C7h ATA-4 Read DMA O/Q
C8h IDE opt DMA read DMA with retry 1
C9h IDE opt DMA read DMA without retry 1
CAh IDE opt DMA write DMA with retry 3
CBh IDE opt DMA write DMA w/out retry 3
CCh ATA-4 Write DMA O/Q
DAh get media status
DBh ATA-2 opt vend acknowledge media chng [Removable]
DCh ATA-2 opt vend Boot / Post-Boot [Removable]
DDh ATA-2 opt vend Boot / Pre-Boot (ATA-2) [Removable]
DEh ATA-2 opt vend door lock [Removable]
DFh ATA-2 opt vend door unlock [Removable]
E0h-E3h (second half of commands 94h-96h)
E4h IDE opt PIOin read buffer 1
E5h-E6h (second half of commands 98h-99h)
E8h IDE opt PIOout write buffer 2
E9h IDE opt PIOout write same 3
EAh ATA-3 opt Secure Disable [Security Mode]
EAh ATA-3 opt Secure Lock [Security Mode]
EAh ATA-3 opt Secure State [Security Mode]
EAh ATA-3 opt Secure Enable WriteProt [Security Mode]
EBh ATA-3 opt Secure Enable [Security Mode]
EBh ATA-3 opt Secure Unlock [Security Mode]
ECh IDE req PIOin identify drive 1 (see #P0516)
EDh ATA-2 opt nondata media eject [Removable]
EEh ATA-3 opt identify device DMA (see #P0516)
EFh IDE opt nondata set features 1 (see #P0535)
F0h-F4h IDE vend EATA standard
F1h Security Set Password
F2h Security Unlock
F3h Security Erase Prepare
F4h Security Erase Unit
F5h-FFh IDE vendor vend vendor unique 4
F5h Security Freeze Lock
F6h Security Disable Password
SeeAlso: #P0512,#P0514
Copied from Ralf Brown's Interrupt List
致
禮!
uty
zmba@tom.com
2005-05-12
------------------------------------------------------------------------------------------