2010-10-01 11:21:55 +02:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;; ;;
|
2012-03-15 13:41:29 +01:00
|
|
|
|
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
|
2010-10-01 11:21:55 +02:00
|
|
|
|
;; Distributed under terms of the GNU General Public License ;;
|
|
|
|
|
;; ;;
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
|
|
|
|
$Revision$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;**********************************************************
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>D (ATAPI)
|
|
|
|
|
;**********************************************************
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Mario79,<Lrz>
|
|
|
|
|
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
MaxRetr equ 10
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; (<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
|
|
|
|
BSYWaitTime equ 1000 ;2
|
|
|
|
|
NoTickWaitTime equ 0xfffff
|
|
|
|
|
CDBlockSize equ 2048
|
|
|
|
|
;********************************************
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;********************************************
|
|
|
|
|
ReadCDWRetr:
|
|
|
|
|
;-----------------------------------------------------------
|
|
|
|
|
; input : eax = block to read
|
|
|
|
|
; ebx = destination
|
|
|
|
|
;-----------------------------------------------------------
|
|
|
|
|
pushad
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov eax, [CDSectorAddress]
|
|
|
|
|
mov ebx, [CDDataBuf_pointer]
|
2010-10-01 11:21:55 +02:00
|
|
|
|
call cd_calculate_cache
|
2012-03-08 09:33:38 +01:00
|
|
|
|
xor edi, edi
|
|
|
|
|
add esi, 8
|
2010-10-01 11:21:55 +02:00
|
|
|
|
inc edi
|
|
|
|
|
.hdreadcache:
|
|
|
|
|
; cmp dword [esi+4],0 ; empty
|
|
|
|
|
; je .nohdcache
|
2012-03-08 09:33:38 +01:00
|
|
|
|
cmp [esi], eax ; correct sector
|
2010-10-01 11:21:55 +02:00
|
|
|
|
je .yeshdcache
|
|
|
|
|
.nohdcache:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
add esi, 8
|
2010-10-01 11:21:55 +02:00
|
|
|
|
inc edi
|
|
|
|
|
dec ecx
|
|
|
|
|
jnz .hdreadcache
|
|
|
|
|
call find_empty_slot_CD_cache ; ret in edi
|
|
|
|
|
|
|
|
|
|
push edi
|
|
|
|
|
push eax
|
|
|
|
|
call cd_calculate_cache_2
|
2012-03-08 09:33:38 +01:00
|
|
|
|
shl edi, 11
|
|
|
|
|
add edi, eax
|
|
|
|
|
mov [CDDataBuf_pointer], edi
|
2010-10-01 11:21:55 +02:00
|
|
|
|
pop eax
|
|
|
|
|
pop edi
|
|
|
|
|
|
|
|
|
|
call ReadCDWRetr_1
|
2012-03-08 09:33:38 +01:00
|
|
|
|
cmp [DevErrorCode], 0
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jne .exit
|
|
|
|
|
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [CDDataBuf_pointer], ebx
|
2010-10-01 11:21:55 +02:00
|
|
|
|
call cd_calculate_cache_1
|
2012-03-08 09:33:38 +01:00
|
|
|
|
lea esi, [edi*8+esi]
|
|
|
|
|
mov [esi], eax ; sector number
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; mov dword [esi+4],1 ; hd read - mark as same as in hd
|
|
|
|
|
.yeshdcache:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov esi, edi
|
|
|
|
|
shl esi, 11;9
|
2010-10-01 11:21:55 +02:00
|
|
|
|
push eax
|
|
|
|
|
call cd_calculate_cache_2
|
2012-03-08 09:33:38 +01:00
|
|
|
|
add esi, eax
|
2010-10-01 11:21:55 +02:00
|
|
|
|
pop eax
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov edi, ebx;[CDDataBuf_pointer]
|
|
|
|
|
mov ecx, 512;/4
|
2010-10-01 11:21:55 +02:00
|
|
|
|
cld
|
|
|
|
|
rep movsd ; move data
|
|
|
|
|
.exit:
|
|
|
|
|
popad
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
ReadCDWRetr_1:
|
|
|
|
|
pushad
|
|
|
|
|
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov ECX, MaxRetr
|
2010-10-01 11:21:55 +02:00
|
|
|
|
@@NextRetr:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;*************************************************
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
|
|
|
|
|
;* ChannelNumber - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>; *
|
|
|
|
|
;* DiskNumber - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>; *
|
|
|
|
|
;* CDSectorAddress - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> CDDataBuf. *
|
|
|
|
|
;*************************************************
|
|
|
|
|
;ReadCD:
|
|
|
|
|
push ecx
|
|
|
|
|
; pusha
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; mov [CDBlockSize],2048 ;2352
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
call clear_packet_buffer
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Read CD
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [PacketCommand], byte 0x28;0xBE
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov AX, word [CDSectorAddress+2]
|
|
|
|
|
xchg AL, AH
|
|
|
|
|
mov word [PacketCommand+2], AX
|
|
|
|
|
mov AX, word [CDSectorAddress]
|
|
|
|
|
xchg AL, AH
|
|
|
|
|
mov word [PacketCommand+4], AX
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; mov eax,[CDSectorAddress]
|
|
|
|
|
; mov [PacketCommand+2],eax
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [PacketCommand+8], byte 1
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; mov [PacketCommand+9],byte 0xF8
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
call SendPacketDatCommand
|
|
|
|
|
pop ecx
|
|
|
|
|
; ret
|
|
|
|
|
|
|
|
|
|
; cmp [DevErrorCode],0
|
2012-03-08 09:33:38 +01:00
|
|
|
|
test eax, eax
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jz @@End_4
|
|
|
|
|
|
2012-03-08 09:33:38 +01:00
|
|
|
|
or ecx, ecx ;{SPraid.simba} (for cd load)
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jz @@End_4
|
|
|
|
|
dec ecx
|
|
|
|
|
|
2012-03-08 09:33:38 +01:00
|
|
|
|
cmp [timer_ticks_enable], 0
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jne @f
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov eax, NoTickWaitTime
|
2010-10-01 11:21:55 +02:00
|
|
|
|
.wait:
|
|
|
|
|
dec eax
|
|
|
|
|
; test eax,eax
|
|
|
|
|
jz @@NextRetr
|
|
|
|
|
jmp .wait
|
|
|
|
|
@@:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> 2,5 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; mov EAX,[timer_ticks]
|
|
|
|
|
; add EAX,50 ;250
|
|
|
|
|
;@@Wait:
|
|
|
|
|
; call change_task
|
|
|
|
|
; cmp EAX,[timer_ticks]
|
|
|
|
|
; ja @@Wait
|
|
|
|
|
loop @@NextRetr
|
|
|
|
|
@@End_4:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov dword [DevErrorCode], eax
|
2010-10-01 11:21:55 +02:00
|
|
|
|
popad
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> PIO
|
|
|
|
|
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
|
|
|
|
|
|
|
|
|
MaxCDWaitTime equ 1000 ;200 ;10 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
uglobal
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
PacketCommand:
|
|
|
|
|
rb 12 ;DB 12 DUP (?)
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;CDDataBuf DB 4096 DUP (0)
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;CDBlockSize DW ?
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
CDSectorAddress:
|
|
|
|
|
DD ?
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
TickCounter_1 DD 0
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
WURStartTime DD 0
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
CDDataBuf_pointer dd 0
|
|
|
|
|
endg
|
|
|
|
|
;****************************************************
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ATAPI <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2048 <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
|
|
|
|
|
;* ChannelNumber - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>; *
|
|
|
|
|
;* DiskNumber - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>; *
|
|
|
|
|
;* PacketCommand - 12-<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>; *
|
|
|
|
|
;* CDBlockSize - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. *
|
|
|
|
|
; return eax DevErrorCode
|
|
|
|
|
;****************************************************
|
|
|
|
|
SendPacketDatCommand:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
xor eax, eax
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; mov byte [DevErrorCode],al
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> CHS
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov byte [ATAAddressMode], al
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ATA-<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov byte [ATAFeatures], al
|
|
|
|
|
mov byte [ATASectorCount], al
|
|
|
|
|
mov byte [ATASectorNumber], al
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [ATAHead], al
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; mov AX,[CDBlockSize]
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [ATACylinder], CDBlockSize
|
|
|
|
|
mov [ATACommand], 0A0h
|
2010-10-01 11:21:55 +02:00
|
|
|
|
call SendCommandToHDD_1
|
2012-03-08 09:33:38 +01:00
|
|
|
|
test eax, eax
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; cmp [DevErrorCode],0 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
jnz @@End_8 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov DX, [ATABasePortAddr]
|
|
|
|
|
add DX, 7 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1<EFBFBD>7h
|
|
|
|
|
mov ecx, NoTickWaitTime
|
2010-10-01 11:21:55 +02:00
|
|
|
|
@@WaitDevice0:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
cmp [timer_ticks_enable], 0
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jne @f
|
|
|
|
|
dec ecx
|
|
|
|
|
; test ecx,ecx
|
|
|
|
|
jz @@Err1_1
|
|
|
|
|
jmp .test
|
|
|
|
|
@@:
|
|
|
|
|
call change_task
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov EAX, [timer_ticks]
|
|
|
|
|
sub EAX, [TickCounter_1]
|
|
|
|
|
cmp EAX, BSYWaitTime
|
2010-10-01 11:21:55 +02:00
|
|
|
|
ja @@Err1_1 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
.test:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
in AL, DX
|
|
|
|
|
test AL, 80h ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> BSY
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jnz @@WaitDevice0
|
2012-03-08 09:33:38 +01:00
|
|
|
|
test AL, 1 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ERR
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jnz @@Err6
|
2012-03-08 09:33:38 +01:00
|
|
|
|
test AL, 08h ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> DRQ
|
2011-07-22 20:08:47 +02:00
|
|
|
|
jz @@WaitDevice0
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
cli
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov DX, [ATABasePortAddr]
|
|
|
|
|
mov AX, [PacketCommand]
|
|
|
|
|
out DX, AX
|
|
|
|
|
mov AX, [PacketCommand+2]
|
|
|
|
|
out DX, AX
|
|
|
|
|
mov AX, [PacketCommand+4]
|
|
|
|
|
out DX, AX
|
|
|
|
|
mov AX, [PacketCommand+6]
|
|
|
|
|
out DX, AX
|
|
|
|
|
mov AX, [PacketCommand+8]
|
|
|
|
|
out DX, AX
|
|
|
|
|
mov AX, [PacketCommand+10]
|
|
|
|
|
out DX, AX
|
2010-10-01 11:21:55 +02:00
|
|
|
|
sti
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov DX, [ATABasePortAddr]
|
|
|
|
|
add DX, 7 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1<EFBFBD>7h
|
|
|
|
|
mov ecx, NoTickWaitTime
|
2010-10-01 11:21:55 +02:00
|
|
|
|
@@WaitDevice1:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
cmp [timer_ticks_enable], 0
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jne @f
|
|
|
|
|
dec ecx
|
|
|
|
|
; test ecx,ecx
|
|
|
|
|
jz @@Err1_1
|
|
|
|
|
jmp .test_1
|
|
|
|
|
@@:
|
|
|
|
|
call change_task
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov EAX, [timer_ticks]
|
|
|
|
|
sub EAX, [TickCounter_1]
|
|
|
|
|
cmp EAX, MaxCDWaitTime
|
2010-10-01 11:21:55 +02:00
|
|
|
|
ja @@Err1_1 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
.test_1:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
in AL, DX
|
|
|
|
|
test AL, 80h ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> BSY
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jnz @@WaitDevice1
|
2012-03-08 09:33:38 +01:00
|
|
|
|
test AL, 1 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ERR
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jnz @@Err6_temp
|
2012-03-08 09:33:38 +01:00
|
|
|
|
test AL, 08h ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> DRQ
|
2011-07-22 20:08:47 +02:00
|
|
|
|
jz @@WaitDevice1
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov EDI, [CDDataBuf_pointer];0x7000 ;CDDataBuf
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov DX, [ATABasePortAddr];<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1x0h
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
xor ecx, ecx
|
|
|
|
|
mov CX, CDBlockSize
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> 16-<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
shr CX, 1;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> 2
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
cli
|
|
|
|
|
cld
|
|
|
|
|
rep insw
|
|
|
|
|
sti
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
@@End_8:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
xor eax, eax
|
2010-10-01 11:21:55 +02:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
@@Err1_1:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
xor eax, eax
|
2010-10-01 11:21:55 +02:00
|
|
|
|
inc eax
|
|
|
|
|
ret
|
|
|
|
|
; mov [DevErrorCode],1
|
|
|
|
|
; ret
|
|
|
|
|
@@Err6_temp:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov eax, 7
|
2010-10-01 11:21:55 +02:00
|
|
|
|
ret
|
|
|
|
|
; mov [DevErrorCode],7
|
|
|
|
|
; ret
|
|
|
|
|
@@Err6:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov eax, 6
|
2010-10-01 11:21:55 +02:00
|
|
|
|
ret
|
|
|
|
|
; mov [DevErrorCode],6
|
|
|
|
|
;@@End_8:
|
|
|
|
|
; ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;***********************************************
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ATAPI <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, *
|
|
|
|
|
;* <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
|
|
|
|
|
;* ChannelNumber - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>; *
|
|
|
|
|
;* DiskNumber - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>; *
|
|
|
|
|
;* PacketCommand - 12-<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. *
|
|
|
|
|
;***********************************************
|
|
|
|
|
SendPacketNoDatCommand:
|
|
|
|
|
pushad
|
2012-03-08 09:33:38 +01:00
|
|
|
|
xor eax, eax
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; mov byte [DevErrorCode],al
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> CHS
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov byte [ATAAddressMode], al
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ATA-<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov byte [ATAFeatures], al
|
|
|
|
|
mov byte [ATASectorCount], al
|
|
|
|
|
mov byte [ATASectorNumber], al
|
|
|
|
|
mov word [ATACylinder], ax
|
|
|
|
|
mov byte [ATAHead], al
|
|
|
|
|
mov [ATACommand], 0A0h
|
2010-10-01 11:21:55 +02:00
|
|
|
|
call SendCommandToHDD_1
|
|
|
|
|
; cmp [DevErrorCode],0 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
test eax, eax
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jnz @@End_9 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov DX, [ATABasePortAddr]
|
|
|
|
|
add DX, 7 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1<EFBFBD>7h
|
2010-10-01 11:21:55 +02:00
|
|
|
|
@@WaitDevice0_1:
|
|
|
|
|
call change_task
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov EAX, [timer_ticks]
|
|
|
|
|
sub EAX, [TickCounter_1]
|
|
|
|
|
cmp EAX, BSYWaitTime
|
2010-10-01 11:21:55 +02:00
|
|
|
|
ja @@Err1_3 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
in AL, DX
|
|
|
|
|
test AL, 80h ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> BSY
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jnz @@WaitDevice0_1
|
2012-03-08 09:33:38 +01:00
|
|
|
|
test AL, 1 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ERR
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jnz @@Err6_1
|
2012-03-08 09:33:38 +01:00
|
|
|
|
test AL, 08h ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> DRQ
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jz @@WaitDevice0_1
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; cli
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov DX, [ATABasePortAddr]
|
|
|
|
|
mov AX, word [PacketCommand]
|
|
|
|
|
out DX, AX
|
|
|
|
|
mov AX, word [PacketCommand+2]
|
|
|
|
|
out DX, AX
|
|
|
|
|
mov AX, word [PacketCommand+4]
|
|
|
|
|
out DX, AX
|
|
|
|
|
mov AX, word [PacketCommand+6]
|
|
|
|
|
out DX, AX
|
|
|
|
|
mov AX, word [PacketCommand+8]
|
|
|
|
|
out DX, AX
|
|
|
|
|
mov AX, word [PacketCommand+10]
|
|
|
|
|
out DX, AX
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; sti
|
2012-03-08 09:33:38 +01:00
|
|
|
|
cmp [ignore_CD_eject_wait], 1
|
2010-10-01 11:21:55 +02:00
|
|
|
|
je @@clear_DEC
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov DX, [ATABasePortAddr]
|
|
|
|
|
add DX, 7 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1<EFBFBD>7h
|
2010-10-01 11:21:55 +02:00
|
|
|
|
@@WaitDevice1_1:
|
|
|
|
|
call change_task
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov EAX, [timer_ticks]
|
|
|
|
|
sub EAX, [TickCounter_1]
|
|
|
|
|
cmp EAX, MaxCDWaitTime
|
2010-10-01 11:21:55 +02:00
|
|
|
|
ja @@Err1_3 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
in AL, DX
|
|
|
|
|
test AL, 80h ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> BSY
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jnz @@WaitDevice1_1
|
2012-03-08 09:33:38 +01:00
|
|
|
|
test AL, 1 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ERR
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jnz @@Err6_1
|
2012-03-08 09:33:38 +01:00
|
|
|
|
test AL, 40h ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> DRDY
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jz @@WaitDevice1_1
|
|
|
|
|
@@clear_DEC:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
and [DevErrorCode], 0
|
2010-10-01 11:21:55 +02:00
|
|
|
|
popad
|
|
|
|
|
ret
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
@@Err1_3:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
xor eax, eax
|
2010-10-01 11:21:55 +02:00
|
|
|
|
inc eax
|
|
|
|
|
jmp @@End_9
|
|
|
|
|
@@Err6_1:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov eax, 6
|
2010-10-01 11:21:55 +02:00
|
|
|
|
@@End_9:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [DevErrorCode], eax
|
2010-10-01 11:21:55 +02:00
|
|
|
|
popad
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;****************************************************
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
|
|
|
|
|
;* ChannelNumber - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (1 <EFBFBD><EFBFBD><EFBFBD> 2); *
|
|
|
|
|
;* DiskNumber - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (0 <EFBFBD><EFBFBD><EFBFBD> 1); *
|
|
|
|
|
;* ATAFeatures - "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"; *
|
|
|
|
|
;* ATASectorCount - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>; *
|
|
|
|
|
;* ATASectorNumber - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>; *
|
|
|
|
|
;* ATACylinder - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>; *
|
|
|
|
|
;* ATAHead - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>; *
|
|
|
|
|
;* ATAAddressMode - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (0-CHS, 1-LBA); *
|
|
|
|
|
;* ATACommand - <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
|
|
|
|
|
;* <EFBFBD> ATABasePortAddr - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> HDD; *
|
|
|
|
|
;* <EFBFBD> DevErrorCode - <EFBFBD><EFBFBD><EFBFBD><EFBFBD>. *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> DevErrorCode <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> eax *
|
|
|
|
|
;****************************************************
|
|
|
|
|
SendCommandToHDD_1:
|
|
|
|
|
; pushad
|
|
|
|
|
; mov [DevErrorCode],0 not need
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
cmp [ATAAddressMode], 1
|
2010-10-01 11:21:55 +02:00
|
|
|
|
ja @@Err2_4
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov BX, [ChannelNumber]
|
|
|
|
|
cmp BX, 1
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jb @@Err3_4
|
2012-03-08 09:33:38 +01:00
|
|
|
|
cmp BX, 2
|
2010-10-01 11:21:55 +02:00
|
|
|
|
ja @@Err3_4
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
dec BX
|
2012-03-08 09:33:38 +01:00
|
|
|
|
shl BX, 1
|
|
|
|
|
movzx ebx, bx
|
|
|
|
|
mov AX, [ebx+StandardATABases]
|
|
|
|
|
mov [ATABasePortAddr], AX
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> HDD <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov DX, [ATABasePortAddr]
|
|
|
|
|
add DX, 6 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov AL, [DiskNumber]
|
|
|
|
|
cmp AL, 1 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2010-10-01 11:21:55 +02:00
|
|
|
|
ja @@Err4_4
|
2012-03-08 09:33:38 +01:00
|
|
|
|
shl AL, 4
|
|
|
|
|
or AL, 10100000b
|
|
|
|
|
out DX, AL
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
inc DX
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov eax, [timer_ticks]
|
|
|
|
|
mov [TickCounter_1], eax
|
|
|
|
|
mov ecx, NoTickWaitTime
|
2010-10-01 11:21:55 +02:00
|
|
|
|
@@WaitHDReady_2:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
cmp [timer_ticks_enable], 0
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jne @f
|
|
|
|
|
dec ecx
|
|
|
|
|
; test ecx,ecx
|
|
|
|
|
jz @@Err1_4
|
|
|
|
|
jmp .test
|
|
|
|
|
@@:
|
|
|
|
|
call change_task
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov eax, [timer_ticks]
|
|
|
|
|
sub eax, [TickCounter_1]
|
|
|
|
|
cmp eax, BSYWaitTime;300 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 3 <EFBFBD><EFBFBD><EFBFBD>.
|
2010-10-01 11:21:55 +02:00
|
|
|
|
ja @@Err1_4 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
.test:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
in AL, DX
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> BSY
|
2012-03-08 09:33:38 +01:00
|
|
|
|
test AL, 80h
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jnz @@WaitHDReady_2
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> DRQ
|
2012-03-08 09:33:38 +01:00
|
|
|
|
test AL, 08h
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jnz @@WaitHDReady_2
|
|
|
|
|
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
cli
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov DX, [ATABasePortAddr]
|
2010-10-01 11:21:55 +02:00
|
|
|
|
inc DX ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov AL, [ATAFeatures]
|
|
|
|
|
out DX, AL
|
2010-10-01 11:21:55 +02:00
|
|
|
|
inc DX ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov AL, [ATASectorCount]
|
|
|
|
|
out DX, AL
|
2010-10-01 11:21:55 +02:00
|
|
|
|
inc DX ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov AL, [ATASectorNumber]
|
|
|
|
|
out DX, AL
|
2010-10-01 11:21:55 +02:00
|
|
|
|
inc DX ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov AX, [ATACylinder]
|
|
|
|
|
out DX, AL
|
2010-10-01 11:21:55 +02:00
|
|
|
|
inc DX ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov AL, AH
|
|
|
|
|
out DX, AL
|
2010-10-01 11:21:55 +02:00
|
|
|
|
inc DX ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov AL, [DiskNumber]
|
|
|
|
|
shl AL, 4
|
|
|
|
|
cmp [ATAHead], 0Fh;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2010-10-01 11:21:55 +02:00
|
|
|
|
ja @@Err5_4
|
2012-03-08 09:33:38 +01:00
|
|
|
|
or AL, [ATAHead]
|
|
|
|
|
or AL, 10100000b
|
|
|
|
|
mov AH, [ATAAddressMode]
|
|
|
|
|
shl AH, 6
|
|
|
|
|
or AL, AH
|
|
|
|
|
out DX, AL
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov AL, [ATACommand]
|
2010-10-01 11:21:55 +02:00
|
|
|
|
inc DX ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
out DX, AL
|
2010-10-01 11:21:55 +02:00
|
|
|
|
sti
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; mov [DevErrorCode],0
|
|
|
|
|
@@End_10:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
xor eax, eax
|
2010-10-01 11:21:55 +02:00
|
|
|
|
ret
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
@@Err1_4:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
xor eax, eax
|
2010-10-01 11:21:55 +02:00
|
|
|
|
inc eax
|
|
|
|
|
; mov [DevErrorCode],1
|
|
|
|
|
ret
|
|
|
|
|
@@Err2_4:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov eax, 2
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; mov [DevErrorCode],2
|
|
|
|
|
ret
|
|
|
|
|
@@Err3_4:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov eax, 3
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; mov [DevErrorCode],3
|
|
|
|
|
ret
|
|
|
|
|
@@Err4_4:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov eax, 4
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; mov [DevErrorCode],4
|
|
|
|
|
ret
|
|
|
|
|
@@Err5_4:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov eax, 5
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; mov [DevErrorCode],5
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
ret
|
|
|
|
|
; sti
|
|
|
|
|
; popad
|
|
|
|
|
|
|
|
|
|
;*************************************************
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
|
|
|
|
|
;* ChannelNumber - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>; *
|
|
|
|
|
;* DiskNumber - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. *
|
|
|
|
|
;*************************************************
|
|
|
|
|
WaitUnitReady:
|
|
|
|
|
pusha
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov EAX, [timer_ticks]
|
|
|
|
|
mov [WURStartTime], EAX
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
call clear_packet_buffer
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> TEST UNIT READY
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [PacketCommand], word 00h
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov ecx, NoTickWaitTime
|
2010-10-01 11:21:55 +02:00
|
|
|
|
@@SendCommand:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
call SendPacketNoDatCommand
|
2012-03-08 09:33:38 +01:00
|
|
|
|
cmp [timer_ticks_enable], 0
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jne @f
|
2012-03-08 09:33:38 +01:00
|
|
|
|
cmp [DevErrorCode], 0
|
2010-10-01 11:21:55 +02:00
|
|
|
|
je @@End_11
|
|
|
|
|
dec ecx
|
|
|
|
|
; cmp ecx,0
|
|
|
|
|
jz .Error
|
|
|
|
|
jmp @@SendCommand
|
|
|
|
|
@@:
|
|
|
|
|
call change_task
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
cmp [DevErrorCode], 0
|
2010-10-01 11:21:55 +02:00
|
|
|
|
je @@End_11
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov EAX, [timer_ticks]
|
|
|
|
|
sub EAX, [WURStartTime]
|
|
|
|
|
cmp EAX, MaxCDWaitTime
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jb @@SendCommand
|
|
|
|
|
.Error:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>-<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [DevErrorCode], 1
|
2010-10-01 11:21:55 +02:00
|
|
|
|
@@End_11:
|
|
|
|
|
popa
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;*************************************************
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
|
|
|
|
|
;* ChannelNumber - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>; *
|
|
|
|
|
;* DiskNumber - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. *
|
|
|
|
|
;*************************************************
|
|
|
|
|
prevent_medium_removal:
|
|
|
|
|
pusha
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
call clear_packet_buffer
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [PacketCommand], byte 0x1E
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [PacketCommand+4], byte 11b
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
call SendPacketNoDatCommand
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov eax, ATAPI_IDE0_lock
|
|
|
|
|
add eax, [cdpos]
|
2010-10-01 11:21:55 +02:00
|
|
|
|
dec eax
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [eax], byte 1
|
2010-10-01 11:21:55 +02:00
|
|
|
|
popa
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;*************************************************
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
|
|
|
|
|
;* ChannelNumber - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>; *
|
|
|
|
|
;* DiskNumber - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. *
|
|
|
|
|
;*************************************************
|
|
|
|
|
allow_medium_removal:
|
|
|
|
|
pusha
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
call clear_packet_buffer
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [PacketCommand], byte 0x1E
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [PacketCommand+4], byte 00b
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
call SendPacketNoDatCommand
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov eax, ATAPI_IDE0_lock
|
|
|
|
|
add eax, [cdpos]
|
2010-10-01 11:21:55 +02:00
|
|
|
|
dec eax
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [eax], byte 0
|
2010-10-01 11:21:55 +02:00
|
|
|
|
popa
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;*************************************************
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
|
|
|
|
|
;* ChannelNumber - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>; *
|
|
|
|
|
;* DiskNumber - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. *
|
|
|
|
|
;*************************************************
|
|
|
|
|
LoadMedium:
|
|
|
|
|
pusha
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
call clear_packet_buffer
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> START/STOP UNIT
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [PacketCommand], word 1Bh
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [PacketCommand+4], word 00000011b
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
call SendPacketNoDatCommand
|
|
|
|
|
popa
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;*************************************************
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
|
|
|
|
|
;* ChannelNumber - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>; *
|
|
|
|
|
;* DiskNumber - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. *
|
|
|
|
|
;*************************************************
|
|
|
|
|
EjectMedium:
|
|
|
|
|
pusha
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
call clear_packet_buffer
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> START/STOP UNIT
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [PacketCommand], word 1Bh
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [PacketCommand+4], word 00000010b
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
call SendPacketNoDatCommand
|
|
|
|
|
popa
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;*************************************************
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
|
|
|
|
|
;* ChannelNumber - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>; *
|
|
|
|
|
;* DiskNumber - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. *
|
|
|
|
|
;*************************************************
|
|
|
|
|
align 4
|
|
|
|
|
check_ATAPI_device_event:
|
|
|
|
|
pusha
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov eax, [timer_ticks]
|
|
|
|
|
sub eax, [timer_ATAPI_check]
|
|
|
|
|
cmp eax, 100
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jb .end_1
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov al, [DRIVE_DATA+1]
|
|
|
|
|
and al, 11b
|
|
|
|
|
cmp al, 10b
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jz .ide3
|
|
|
|
|
.ide2_1:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov al, [DRIVE_DATA+1]
|
|
|
|
|
and al, 1100b
|
|
|
|
|
cmp al, 1000b
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jz .ide2
|
|
|
|
|
.ide1_1:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov al, [DRIVE_DATA+1]
|
|
|
|
|
and al, 110000b
|
|
|
|
|
cmp al, 100000b
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jz .ide1
|
|
|
|
|
.ide0_1:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov al, [DRIVE_DATA+1]
|
|
|
|
|
and al, 11000000b
|
|
|
|
|
cmp al, 10000000b
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jz .ide0
|
|
|
|
|
.end:
|
|
|
|
|
|
|
|
|
|
sti
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov eax, [timer_ticks]
|
|
|
|
|
mov [timer_ATAPI_check], eax
|
2010-10-01 11:21:55 +02:00
|
|
|
|
.end_1:
|
|
|
|
|
popa
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.ide3:
|
|
|
|
|
cli
|
2012-03-08 09:33:38 +01:00
|
|
|
|
cmp [ATAPI_IDE3_lock], 1
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jne .ide2_1
|
2012-03-08 09:33:38 +01:00
|
|
|
|
cmp [IDE_Channel_2], 0
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jne .ide1_1
|
2012-03-08 09:33:38 +01:00
|
|
|
|
cmp [cd_status], 0
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jne .end
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [IDE_Channel_2], 1
|
2010-10-01 11:21:55 +02:00
|
|
|
|
call reserve_ok2
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [ChannelNumber], 2
|
|
|
|
|
mov [DiskNumber], 1
|
|
|
|
|
mov [cdpos], 4
|
2010-10-01 11:21:55 +02:00
|
|
|
|
call GetEvent_StatusNotification
|
2012-03-08 09:33:38 +01:00
|
|
|
|
cmp [CDDataBuf+4], byte 1
|
2010-10-01 11:21:55 +02:00
|
|
|
|
je .eject_ide3
|
|
|
|
|
call syscall_cdaudio.free
|
|
|
|
|
jmp .ide2_1
|
|
|
|
|
.eject_ide3:
|
|
|
|
|
call .eject
|
|
|
|
|
call syscall_cdaudio.free
|
|
|
|
|
jmp .ide2_1
|
|
|
|
|
|
|
|
|
|
.ide2:
|
|
|
|
|
cli
|
2012-03-08 09:33:38 +01:00
|
|
|
|
cmp [ATAPI_IDE2_lock], 1
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jne .ide1_1
|
2012-03-08 09:33:38 +01:00
|
|
|
|
cmp [IDE_Channel_2], 0
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jne .ide1_1
|
2012-03-08 09:33:38 +01:00
|
|
|
|
cmp [cd_status], 0
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jne .end
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [IDE_Channel_2], 1
|
2010-10-01 11:21:55 +02:00
|
|
|
|
call reserve_ok2
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [ChannelNumber], 2
|
|
|
|
|
mov [DiskNumber], 0
|
|
|
|
|
mov [cdpos], 3
|
2010-10-01 11:21:55 +02:00
|
|
|
|
call GetEvent_StatusNotification
|
2012-03-08 09:33:38 +01:00
|
|
|
|
cmp [CDDataBuf+4], byte 1
|
2010-10-01 11:21:55 +02:00
|
|
|
|
je .eject_ide2
|
|
|
|
|
call syscall_cdaudio.free
|
|
|
|
|
jmp .ide1_1
|
|
|
|
|
.eject_ide2:
|
|
|
|
|
call .eject
|
|
|
|
|
call syscall_cdaudio.free
|
|
|
|
|
jmp .ide1_1
|
|
|
|
|
|
|
|
|
|
.ide1:
|
|
|
|
|
cli
|
2012-03-08 09:33:38 +01:00
|
|
|
|
cmp [ATAPI_IDE1_lock], 1
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jne .ide0_1
|
2012-03-08 09:33:38 +01:00
|
|
|
|
cmp [IDE_Channel_1], 0
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jne .end
|
2012-03-08 09:33:38 +01:00
|
|
|
|
cmp [cd_status], 0
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jne .end
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [IDE_Channel_1], 1
|
2010-10-01 11:21:55 +02:00
|
|
|
|
call reserve_ok2
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [ChannelNumber], 1
|
|
|
|
|
mov [DiskNumber], 1
|
|
|
|
|
mov [cdpos], 2
|
2010-10-01 11:21:55 +02:00
|
|
|
|
call GetEvent_StatusNotification
|
2012-03-08 09:33:38 +01:00
|
|
|
|
cmp [CDDataBuf+4], byte 1
|
2010-10-01 11:21:55 +02:00
|
|
|
|
je .eject_ide1
|
|
|
|
|
call syscall_cdaudio.free
|
|
|
|
|
jmp .ide0_1
|
|
|
|
|
.eject_ide1:
|
|
|
|
|
call .eject
|
|
|
|
|
call syscall_cdaudio.free
|
|
|
|
|
jmp .ide0_1
|
|
|
|
|
|
|
|
|
|
.ide0:
|
|
|
|
|
cli
|
2012-03-08 09:33:38 +01:00
|
|
|
|
cmp [ATAPI_IDE0_lock], 1
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jne .end
|
2012-03-08 09:33:38 +01:00
|
|
|
|
cmp [IDE_Channel_1], 0
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jne .end
|
2012-03-08 09:33:38 +01:00
|
|
|
|
cmp [cd_status], 0
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jne .end
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [IDE_Channel_1], 1
|
2010-10-01 11:21:55 +02:00
|
|
|
|
call reserve_ok2
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [ChannelNumber], 1
|
|
|
|
|
mov [DiskNumber], 0
|
|
|
|
|
mov [cdpos], 1
|
2010-10-01 11:21:55 +02:00
|
|
|
|
call GetEvent_StatusNotification
|
2012-03-08 09:33:38 +01:00
|
|
|
|
cmp [CDDataBuf+4], byte 1
|
2010-10-01 11:21:55 +02:00
|
|
|
|
je .eject_ide0
|
|
|
|
|
call syscall_cdaudio.free
|
|
|
|
|
jmp .end
|
|
|
|
|
.eject_ide0:
|
|
|
|
|
call .eject
|
|
|
|
|
call syscall_cdaudio.free
|
|
|
|
|
jmp .end
|
|
|
|
|
|
|
|
|
|
.eject:
|
|
|
|
|
call clear_CD_cache
|
|
|
|
|
call allow_medium_removal
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [ignore_CD_eject_wait], 1
|
2010-10-01 11:21:55 +02:00
|
|
|
|
call EjectMedium
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [ignore_CD_eject_wait], 0
|
2010-10-01 11:21:55 +02:00
|
|
|
|
ret
|
|
|
|
|
iglobal
|
|
|
|
|
timer_ATAPI_check dd 0
|
|
|
|
|
ATAPI_IDE0_lock db 0
|
|
|
|
|
ATAPI_IDE1_lock db 0
|
|
|
|
|
ATAPI_IDE2_lock db 0
|
|
|
|
|
ATAPI_IDE3_lock db 0
|
|
|
|
|
ignore_CD_eject_wait db 0
|
|
|
|
|
endg
|
|
|
|
|
;*************************************************
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
|
|
|
|
|
;* ChannelNumber - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>; *
|
|
|
|
|
;* DiskNumber - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. *
|
|
|
|
|
;*************************************************
|
|
|
|
|
GetEvent_StatusNotification:
|
|
|
|
|
pusha
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [CDDataBuf_pointer], CDDataBuf
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
call clear_packet_buffer
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [PacketCommand], byte 4Ah
|
|
|
|
|
mov [PacketCommand+1], byte 00000001b
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [PacketCommand+4], byte 00010000b
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [PacketCommand+7], byte 8h
|
|
|
|
|
mov [PacketCommand+8], byte 0h
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
call SendPacketDatCommand
|
|
|
|
|
popa
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;*************************************************
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> TOC
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
|
|
|
|
|
;* ChannelNumber - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>; *
|
|
|
|
|
;* DiskNumber - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. *
|
|
|
|
|
;*************************************************
|
|
|
|
|
Read_TOC:
|
|
|
|
|
pusha
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [CDDataBuf_pointer], CDDataBuf
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
call clear_packet_buffer
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [PacketCommand], byte 0x43
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [PacketCommand+2], byte 1
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov [PacketCommand+7], byte 0xFF
|
|
|
|
|
mov [PacketCommand+8], byte 0h
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
call SendPacketDatCommand
|
|
|
|
|
popa
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;*************************************************
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *
|
|
|
|
|
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
|
|
|
|
|
;* ChannelNumber - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>; *
|
|
|
|
|
;* DiskNumber - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. *
|
|
|
|
|
;*************************************************
|
|
|
|
|
;ReadCapacity:
|
|
|
|
|
; pusha
|
|
|
|
|
;; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; call clear_packet_buffer
|
|
|
|
|
;; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; mov [CDBlockSize],8
|
|
|
|
|
;; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> READ CAPACITY
|
|
|
|
|
; mov [PacketCommand],word 25h
|
|
|
|
|
;; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; call SendPacketDatCommand
|
|
|
|
|
; popa
|
|
|
|
|
; ret
|
|
|
|
|
|
|
|
|
|
clear_packet_buffer:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
and [PacketCommand], dword 0
|
|
|
|
|
and [PacketCommand+4], dword 0
|
|
|
|
|
and [PacketCommand+8], dword 0
|
2010-10-01 11:21:55 +02:00
|
|
|
|
ret
|