2014-03-03 94 views
0
mov  ah, 0x02    ; read floppy sector function 
    mov  al, 1     ; read 1 sector 
    mov  ch, 1     ; we are reading the second sector past us, so its still on track 1 
    mov  cl, 2     ; sector to read (The second sector) 
    mov  dh, 0     ; head number 
    mov  dl, 0     ; drive number. Remember Drive 0 is floppy drive. 
    int  0x13     ; call BIOS - Read the sector 

上閱讀這是例子代碼:http://www.brokenthorn.com/Resources/OSDev5.html從扇區軟盤

我真的不明白這個部分:

 mov  ch, 1     ; we are reading the second sector past us, so its still on track 1 
     mov  cl, 2     ; sector to read (The second sector) 

好了,所以第一個扇區是引導扇區(扇區0)。因此後,該部門是部門1

所以它不應該是?:

mov ch, 0  ;First track 
mov cl, 1  ;second sector on first track 

回答

2

扇區數爲1型,而磁道數是從0開始的。 Int13是這樣的時髦。

http://stanislavs.org/helppc/int_13-2.html

+0

謝謝!該教程沒有提到這一點。但快速檢查維基百科會解決我的困惑。 http://en.wikipedia.org/wiki/Cylinder-head-sector –