forked from KolibriOS/kolibrios
sysfunction 70 cleaning
git-svn-id: svn://kolibrios.org@6464 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
1d995e8c33
commit
ee14b53b33
@ -455,16 +455,12 @@ SendCommandToHDD_1:
|
||||
cmp [ATAAddressMode], 1
|
||||
ja @@Err2_4
|
||||
; Проверить корректность номера канала
|
||||
mov bx, [ChannelNumber]
|
||||
cmp bx, 1
|
||||
jb @@Err3_4
|
||||
|
||||
cmp bx, 2
|
||||
movzx ebx, [ChannelNumber]
|
||||
dec ebx
|
||||
cmp ebx, 1
|
||||
ja @@Err3_4
|
||||
; Установить базовый адрес
|
||||
dec bx
|
||||
shl ebx, 2
|
||||
movzx ebx, bx
|
||||
mov eax, [cdpos]
|
||||
dec eax
|
||||
shr eax, 2
|
||||
|
@ -1144,15 +1144,37 @@ dyndisk_handler:
|
||||
jmp file_system_lfn.maindir_noesi
|
||||
.haspartition:
|
||||
; 12. The fs operation has specified some partition.
|
||||
; 12a. Store parameters for callback functions.
|
||||
push edx
|
||||
push ecx
|
||||
; 12b. Store callback functions.
|
||||
push dyndisk_cleanup
|
||||
push fs_dyndisk
|
||||
mov edi, esp
|
||||
; 12c. Let the procedure from fs_lfn.inc do the job.
|
||||
jmp file_system_lfn.found2
|
||||
xor eax, eax
|
||||
lodsb
|
||||
sub eax, '0'
|
||||
jz .dyndisk_cleanup
|
||||
cmp eax, 10
|
||||
jnc .dyndisk_cleanup
|
||||
mov ecx, eax
|
||||
lodsb
|
||||
cmp eax, '/'
|
||||
jz @f
|
||||
test eax, eax
|
||||
jnz .dyndisk_cleanup
|
||||
dec esi
|
||||
@@:
|
||||
cmp byte [esi], 0
|
||||
jnz @f
|
||||
test ebp, ebp
|
||||
jz @f
|
||||
mov esi, ebp
|
||||
xor ebp, ebp
|
||||
@@:
|
||||
jmp fs_dyndisk
|
||||
|
||||
.dyndisk_cleanup:
|
||||
pop esi
|
||||
pop edx
|
||||
mov dword [esp+32], ERROR_FILE_NOT_FOUND
|
||||
jmp .cleanup_esi
|
||||
|
||||
.access_denied:
|
||||
; 13. Fail the operation with the appropriate code.
|
||||
mov dword [esp+32], ERROR_ACCESS_DENIED
|
||||
@ -1168,17 +1190,12 @@ dyndisk_handler:
|
||||
; 15. Return.
|
||||
ret
|
||||
|
||||
; This is a callback for cleaning up things called from file_system_lfn.found2.
|
||||
dyndisk_cleanup:
|
||||
mov esi, [edi+8]
|
||||
mov edx, [edi+12]
|
||||
jmp dyndisk_handler.cleanup_esi
|
||||
|
||||
; This is a callback for enumerating partitions called from
|
||||
; file_system_lfn.maindir in the case of inserted media.
|
||||
; It just increments eax until DISK.NumPartitions reached and then
|
||||
; cleans up.
|
||||
fs_dyndisk_next:
|
||||
mov ecx, [esp+8]
|
||||
cmp eax, [ecx+DISK.NumPartitions]
|
||||
jae .nomore
|
||||
inc eax
|
||||
@ -1203,6 +1220,7 @@ fs_dyndisk_next_nomedia:
|
||||
clc
|
||||
ret
|
||||
.nomore:
|
||||
mov ecx, [esp+8]
|
||||
pusha
|
||||
mov esi, ecx
|
||||
call disk_dereference
|
||||
@ -1210,13 +1228,11 @@ fs_dyndisk_next_nomedia:
|
||||
stc
|
||||
ret
|
||||
|
||||
; This is a callback for doing real work with selected partition.
|
||||
; Currently this is just placeholder, since no file systems are supported.
|
||||
; edi = esp -> {dd fs_dyndisk, dd dyndisk_cleanup, dd pointer to DISK, dd media object}
|
||||
; esp -> {dd pointer to DISK, dd media object}
|
||||
; ecx = partition number, esi+ebp = ASCIIZ name
|
||||
fs_dyndisk:
|
||||
dec ecx ; convert to zero-based partition index
|
||||
pop edx edx edx ; edx = pointer to DISK, dword [esp] = NULL or edx
|
||||
pop edx ; edx = pointer to DISK, dword [esp] = NULL or edx
|
||||
; If the driver does not support insert notifications and we are the only fs
|
||||
; operation with this disk, ask the driver whether the media
|
||||
; was inserted/removed/changed. Otherwise, assume that media status is valid.
|
||||
|
@ -46,7 +46,7 @@ FindHDD_2:
|
||||
add [DeviceNumber], sizeof.HD_DATA
|
||||
shl byte [ebx+DRIVE_DATA], 2
|
||||
FindHDD_1:
|
||||
DEBUGF 1, "K : Channel %d ",[ChannelNumber]:2
|
||||
DEBUGF 1, "K : Channel %d ",[ChannelNumber]:1
|
||||
DEBUGF 1, "Disk %d\n",[DiskNumber]:1
|
||||
push ebx ecx
|
||||
call ReadHDD_ID
|
||||
@ -83,17 +83,14 @@ FindHDD_1:
|
||||
|
||||
add [ebx+DRIVE_DATA], byte 2
|
||||
;--------------------------------------
|
||||
.Print_Device_Name:
|
||||
.Print_Device_Name:
|
||||
pushad
|
||||
pushfd
|
||||
|
||||
xor ebx, ebx
|
||||
mov bx, [ChannelNumber]
|
||||
movzx ebx, [ChannelNumber]
|
||||
dec ebx
|
||||
shl ebx, 1
|
||||
add bl, [DiskNumber]
|
||||
shl ebx, 1
|
||||
|
||||
call calculate_IDE_device_values_storage
|
||||
;--------------------------------------
|
||||
.copy_dev_name:
|
||||
@ -245,7 +242,7 @@ uglobal
|
||||
; Стандартные базовые адреса каналов 1 и 2
|
||||
StandardATABases dw ?, ? ; 1F0h, 170h
|
||||
; Номер канала
|
||||
ChannelNumber dw ?
|
||||
ChannelNumber db ?
|
||||
; Номер диска
|
||||
DiskNumber db ?
|
||||
DeviceNumber db ?
|
||||
@ -291,16 +288,12 @@ SendCommandToHDD:
|
||||
cmp [ATAAddressMode], 1
|
||||
ja @@Err2
|
||||
; Проверить корректность номера канала
|
||||
mov bx, [ChannelNumber]
|
||||
cmp bx, 1
|
||||
jb @@Err3
|
||||
|
||||
cmp bx, 2
|
||||
movzx ebx, [ChannelNumber]
|
||||
dec ebx
|
||||
cmp ebx, 1
|
||||
ja @@Err3
|
||||
; Установить базовый адрес
|
||||
dec bx
|
||||
shl bx, 1
|
||||
movzx ebx, bx
|
||||
shl ebx, 1
|
||||
mov ax, [ebx+StandardATABases]
|
||||
mov [ATABasePortAddr], ax
|
||||
; Ожидание готовности HDD к приему команды
|
||||
@ -449,16 +442,12 @@ ReadCD_ID:
|
||||
;*************************************************
|
||||
DeviceReset:
|
||||
; Проверить корректность номера канала
|
||||
mov bx, [ChannelNumber]
|
||||
cmp bx, 1
|
||||
jb @@Err3_2
|
||||
|
||||
cmp bx, 2
|
||||
movzx ebx, [ChannelNumber]
|
||||
dec ebx
|
||||
cmp ebx, 1
|
||||
ja @@Err3_2
|
||||
; Установить базовый адрес
|
||||
dec bx
|
||||
shl bx, 1
|
||||
movzx ebx, bx
|
||||
shl ebx, 1
|
||||
mov dx, [ebx+StandardATABases]
|
||||
mov [ATABasePortAddr], dx
|
||||
; Выбрать нужный диск
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -5239,7 +5239,7 @@ syscall_cdaudio:
|
||||
shr eax, 1
|
||||
and eax, 1
|
||||
inc eax
|
||||
mov [ChannelNumber], ax
|
||||
mov [ChannelNumber], al
|
||||
mov eax, ecx
|
||||
and eax, 1
|
||||
mov [DiskNumber], al
|
||||
|
Loading…
Reference in New Issue
Block a user