mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-11-28 03:39:35 +03:00
Load/eject CD/DVD device tray moved from sysfn 70 to sysfn 24 (see sysfunc*),
because these actions do not involve file system. git-svn-id: svn://kolibrios.org@588 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
8df29f7be6
commit
379dd4d36d
@ -1462,6 +1462,34 @@ dd 533
|
||||
* <20>।¢ à¨â¥«ì® 㦮 ®¯à¥¤¥«¨âì ¡ §®¢ë© ¯®àâ CD ¢ë§®¢®¬
|
||||
¯®¤äãªæ¨¨ 3 äãªæ¨¨ 21.
|
||||
|
||||
======================================================================
|
||||
========== ”ãªæ¨ï 24, ¯®¤äãªæ¨ï 4 - ¨§¢«¥çì «®â®ª ¯à¨¢®¤ ¤¨áª . ============
|
||||
======================================================================
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 24 - ®¬¥à äãªæ¨¨
|
||||
* ebx = 4 - ®¬¥à ¯®¤äãªæ¨¨
|
||||
* ecx = ®¬¥à CD/DVD-¤¨áª (®â 0=Primary Master ¤® 3=Secondary Slave)
|
||||
‚®§¢à é ¥¬®¥ § 票¥:
|
||||
* <20>¨ç¥£® ¥ ¢®§¢à é ¥âáï.
|
||||
‡ ¬¥ç ¨ï:
|
||||
* ”ãªæ¨ï ¯®¤¤¥à¦¨¢ ¥âáï ⮫쪮 ¤«ï ATAPI ãáâனá⢠(CD ¨ DVD).
|
||||
* <20>ਠ¨§¢«¥ç¥¨¨ «®âª ¯à®¨§¢®¤¨âáï à §¡«®ª¨à®¢ª àã箣® ã¯à ¢«¥¨ï ¬¥å ¨§¬®¬ «®âª .
|
||||
* <20>ਠ¨§¢«¥ç¥¨¨ «®âª ª®¤ ¯à®¨§¢®¤¨â ®ç¨áâªã ªíè ᮮ⢥âáâ¢ãî饣® ãáâனá⢠.
|
||||
* <20>ਬ¥à®¬ ¨á¯®«ì§®¢ ¨ï äãªæ¨¨ ï¥âáï ¯à¨«®¦¥¨¥ CD_tray.
|
||||
|
||||
======================================================================
|
||||
========== ”ãªæ¨ï 24, ¯®¤äãªæ¨ï 5 - § £à㧨âì «®â®ª ¯à¨¢®¤ ¤¨áª . ===========
|
||||
======================================================================
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 24 - ®¬¥à äãªæ¨¨
|
||||
* ebx = 5 - ®¬¥à ¯®¤äãªæ¨¨
|
||||
* ecx = ®¬¥à CD/DVD-¤¨áª (®â 0=Primary Master ¤® 3=Secondary Slave)
|
||||
‚®§¢à é ¥¬®¥ § 票¥:
|
||||
* <20>¨ç¥£® ¥ ¢®§¢à é ¥âáï.
|
||||
‡ ¬¥ç ¨ï:
|
||||
* ”ãªæ¨ï ¯®¤¤¥à¦¨¢ ¥âáï ⮫쪮 ¤«ï ATAPI ãáâனá⢠(CD ¨ DVD)
|
||||
* <20>ਬ¥à®¬ ¨á¯®«ì§®¢ ¨ï äãªæ¨¨ ï¥âáï ¯à¨«®¦¥¨¥ CD_tray.
|
||||
|
||||
======================================================================
|
||||
============== ”ãªæ¨ï 25 - ãáâ ®¢¨âì £à®¬ª®áâì SBPro. ==============
|
||||
======================================================================
|
||||
@ -4129,7 +4157,7 @@ Architecture Software Developer's Manual, Volume 3, Appendix B);
|
||||
<EFBFBD>ਠ¯¥à¢®¬ ®¡à 饨¨ ¯®¤äãªæ¨© 0,1,5,7 ª ãáâனá⢠¬ ATAPI (CD ¨ DVD)
|
||||
¯à®¨§¢®¤¨âáï ¡«®ª¨à®¢ª àã箣® ã¯à ¢«¥¨ï ¬¥å ¨§¬®¬ «®âª . <20>â® á¢ï§ ®
|
||||
á «£®à¨â¬®¬ ªíè¨à®¢ ¨ï ¤ ëå ¯®«ãç¥ëå ®â ¯à¨¢®¤ . <20> §¡«®ª¨à®¢ª
|
||||
¯à®¨§¢®¤¨âáï ®¡à 饨¥¬ ¯®¤äãªæ¨¥© 10 ª ᮮ⢥âáâ¢ãî饬ã ãáâனáâ¢ã.
|
||||
¯à®¨§¢®¤¨âáï ®¡à 饨¥¬ äãªæ¨¨ 24.4 ª ᮮ⢥âáâ¢ãî饬ã ãáâனáâ¢ã.
|
||||
|
||||
======================================================================
|
||||
= ”ãªæ¨ï 70, ¯®¤äãªæ¨ï 0 - ç⥨¥ ä ©« á ¯®¤¤¥à¦ª®© ¤«¨ëå ¨¬ñ. =
|
||||
@ -4489,66 +4517,6 @@ Architecture Software Developer's Manual, Volume 3, Appendix B);
|
||||
* <20>®¤¨â¥«ìáª ï ¯ ¯ª ¤®«¦ 㦥 áãé¥á⢮¢ âì.
|
||||
* …᫨ ¯ ¯ª 㦥 áãé¥áâ¢ã¥â, äãªæ¨ï § ¢¥àè¨âáï ãá¯¥è® (eax=0).
|
||||
|
||||
======================================================================
|
||||
========== ”ãªæ¨ï 70, ¯®¤äãªæ¨ï 10 - ¨§¢«¥çì «®â®ª ¯à¨¢®¤ ¤¨áª . ============
|
||||
======================================================================
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 70 - ®¬¥à äãªæ¨¨
|
||||
* ebx = 㪠§ â¥«ì ¨ä®à¬ 樮ãî áâàãªâãàã
|
||||
”®à¬ â ¨ä®à¬ 樮®© áâàãªâãàë:
|
||||
* +0: dword: 10 = ®¬¥à ¯®¤äãªæ¨¨
|
||||
* +4: dword: 0 (§ १¥à¢¨à®¢ ®)
|
||||
* +8: dword: 0 (§ १¥à¢¨à®¢ ®)
|
||||
* +12 = +0xC: dword: 0 (§ १¥à¢¨à®¢ ®)
|
||||
* +16 = +0x10: dword: 0 (§ १¥à¢¨à®¢ ®)
|
||||
* +20 = +0x14: ASCIIZ-¨¬ï ¯ ¯ª¨, ¯à ¢¨« ä®à¬¨à®¢ ¨ï ¨¬ñ 㪠§ ë ¢
|
||||
®¡é¥¬ ®¯¨á ¨¨
|
||||
¨«¨
|
||||
* +20 = +0x14: db 0
|
||||
* +21 = +0x15: dd 㪠§ ⥫ì ASCIIZ-áâபã á ¨¬¥¥¬ ¯ ¯ª¨
|
||||
‚®§¢à é ¥¬®¥ § 票¥:
|
||||
* <20>¨ç¥£® ¥ ¢®§¢à é ¥âáï.
|
||||
‡ ¬¥ç ¨ï:
|
||||
* ”ãªæ¨ï ¯®¤¤¥à¦¨¢ ¥âáï ⮫쪮 ¤«ï ATAPI ãáâனá⢠(CD ¨ DVD).
|
||||
* <20>ਠ¨§¢«¥ç¥¨¨ «®âª ¯à®¨§¢®¤¨âáï à §¡«®ª¨à®¢ª àã箣® ã¯à ¢«¥¨ï ¬¥å ¨§¬®¬ «®âª .
|
||||
* <20>ਠ¨§¢«¥ç¥¨¨ «®âª ª®¤ ¯à®¨§¢®¤¨â ®ç¨áâªã ªíè ᮮ⢥âáâ¢ãî饣® ãáâனá⢠.
|
||||
* <20>ãâì ¢¢®¤¨âáï ¢ áâ ¤ à⮬ ¤«ï 70 äãªæ¨¨ ¢¨¤¥. „«ï à ¡®â®á¯®á®¡®á⨠¬®¦®
|
||||
®£à ¨ç¨âìáï ¯ãâﬨ ¢¨¤ :
|
||||
db '/cd0/1/',0
|
||||
db '/cd1/1/',0
|
||||
db '/cd2/1/',0
|
||||
db '/cd3/1/',0
|
||||
* <20>ਬ¥à®¬ ¨á¯®«ì§®¢ ¨ï äãªæ¨¨ ï¥âáï ¯à¨«®¦¥¨¥ CD_tray.
|
||||
|
||||
======================================================================
|
||||
========== ”ãªæ¨ï 70, ¯®¤äãªæ¨ï 11 - § £à㧨âì «®â®ª ¯à¨¢®¤ ¤¨áª . ===========
|
||||
======================================================================
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 70 - ®¬¥à äãªæ¨¨
|
||||
* ebx = 㪠§ â¥«ì ¨ä®à¬ 樮ãî áâàãªâãàã
|
||||
”®à¬ â ¨ä®à¬ 樮®© áâàãªâãàë:
|
||||
* +0: dword: 11 = ®¬¥à ¯®¤äãªæ¨¨
|
||||
* +4: dword: 0 (§ १¥à¢¨à®¢ ®)
|
||||
* +8: dword: 0 (§ १¥à¢¨à®¢ ®)
|
||||
* +12 = +0xC: dword: 0 (§ १¥à¢¨à®¢ ®)
|
||||
* +16 = +0x10: dword: 0 (§ १¥à¢¨à®¢ ®)
|
||||
* +20 = +0x14: ASCIIZ-¨¬ï ¯ ¯ª¨, ¯à ¢¨« ä®à¬¨à®¢ ¨ï ¨¬ñ 㪠§ ë ¢
|
||||
®¡é¥¬ ®¯¨á ¨¨
|
||||
¨«¨
|
||||
* +20 = +0x14: db 0
|
||||
* +21 = +0x15: dd 㪠§ ⥫ì ASCIIZ-áâபã á ¨¬¥¥¬ ¯ ¯ª¨
|
||||
‚®§¢à é ¥¬®¥ § 票¥:
|
||||
* <20>¨ç¥£® ¥ ¢®§¢à é ¥âáï.
|
||||
‡ ¬¥ç ¨ï:
|
||||
* ”ãªæ¨ï ¯®¤¤¥à¦¨¢ ¥âáï ⮫쪮 ¤«ï ATAPI ãáâனá⢠(CD ¨ DVD)
|
||||
* <20>ãâì ¢¢®¤¨âáï ¢ áâ ¤ à⮬ ¤«ï 70 äãªæ¨¨ ¢¨¤¥. „«ï à ¡®â®á¯®á®¡®á⨠¬®¦®
|
||||
®£à ¨ç¨âìáï ¯ãâﬨ ¢¨¤ :
|
||||
db '/cd0/1/',0
|
||||
db '/cd1/1/',0
|
||||
db '/cd2/1/',0
|
||||
db '/cd3/1/',0
|
||||
* <20>ਬ¥à®¬ ¨á¯®«ì§®¢ ¨ï äãªæ¨¨ ï¥âáï ¯à¨«®¦¥¨¥ CD_tray.
|
||||
|
||||
======================================================================
|
||||
=== ”ãªæ¨ï 71, ¯®¤äãªæ¨ï 1 - ãáâ ®¢¨âì § £®«®¢®ª ®ª ¯à®£à ¬¬ë. ==
|
||||
======================================================================
|
||||
|
@ -1445,6 +1445,34 @@ Remarks:
|
||||
* Previously CD base port must be defined by call to
|
||||
subfunction 3 of function 21.
|
||||
|
||||
======================================================================
|
||||
================ Function 24, subfunction 4 - eject tray of disk drive. ==============
|
||||
======================================================================
|
||||
Parameters:
|
||||
* eax = 24 - function number
|
||||
* ebx = 4 - subfunction number
|
||||
* ecx = position of CD/DVD-drive (from 0=Primary Master to 3=Secondary Slave)
|
||||
Returned value:
|
||||
* Nothing comes back.
|
||||
Remarks:
|
||||
* The function is supported only for ATAPI devices (CD and DVD).
|
||||
* At extract of a tray is made deblocking of handle mechanism of a tray.
|
||||
* At extract of a tray the code makes clearing the cache of the appropriate device.
|
||||
* An example of usage of the function is the application CD_tray.
|
||||
|
||||
======================================================================
|
||||
============== Function 24, subfunction 5 - load tray of disk drive. =================
|
||||
======================================================================
|
||||
Parameters:
|
||||
* eax = 24 - function number
|
||||
* ebx = 5 - subfunction number
|
||||
* ecx = position of CD/DVD-drive (from 0=Primary Master to 3=Secondary Slave)
|
||||
Returned value:
|
||||
* Nothing comes back.
|
||||
Remarks:
|
||||
* The function is supported only for ATAPI devices (CD and DVD).
|
||||
* An example of usage of the function is the application CD_tray.
|
||||
|
||||
======================================================================
|
||||
=================== Function 25 - set SBPro volume. ==================
|
||||
======================================================================
|
||||
@ -4077,7 +4105,7 @@ For CD-drives due to hardware limitations only subfunctions
|
||||
with code 2.
|
||||
At the first call subfunctions 0,1,5,7 to devices ATAPI (CD and DVD) the locking
|
||||
of handle mechanism of a tray is made. It is connected to algorithm of caching
|
||||
given obtained from a drive. Deblocking is made by call subfunction 10
|
||||
given obtained from a drive. Deblocking is made by call function 24.4
|
||||
to the appropriate device.
|
||||
|
||||
======================================================================
|
||||
@ -4433,64 +4461,6 @@ Remarks:
|
||||
* The parent folder must already exist.
|
||||
* If target folder already exists, function returns success (eax=0).
|
||||
|
||||
======================================================================
|
||||
================ Function 70, subfunction 10 - eject tray of disk drive. ==============
|
||||
======================================================================
|
||||
Parameters:
|
||||
* eax = 70 - function number
|
||||
* ebx = pointer to the information structure
|
||||
Format of the information structure:
|
||||
* +0: dword: 10 = subfunction number
|
||||
* +4: dword: 0 (reserved)
|
||||
* +8: dword: 0 (reserved)
|
||||
* +12 = +0xC: dword: 0 (reserved)
|
||||
* +16 = +0x10: dword: 0 (reserved)
|
||||
* +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
|
||||
given in the general description
|
||||
or
|
||||
* +20 = +0x14: db 0
|
||||
* +21 = +0x15: dd pointer to ASCIIZ-string with folder name
|
||||
Returned value:
|
||||
* Nothing comes back.
|
||||
Remarks:
|
||||
* The function is supported only for ATAPI devices (CD and DVD).
|
||||
* At extract of a tray is made deblocking of handle mechanism of a tray.
|
||||
* At extract of a tray the code makes clearing the cache of the appropriate device.
|
||||
* The path is standard for 70 functions. For serviceability it is possible to be limited to paths:
|
||||
db '/cd0/1/',0
|
||||
db '/cd1/1/',0
|
||||
db '/cd2/1/',0
|
||||
db '/cd3/1/',0
|
||||
* An example of usage of the function is the application CD_tray.
|
||||
|
||||
======================================================================
|
||||
============== Function 70, subfunction 11 - load tray of disk drive. =================
|
||||
======================================================================
|
||||
Parameters:
|
||||
* eax = 70 - function number
|
||||
* ebx = pointer to the information structure
|
||||
Format of the information structure:
|
||||
* +0: dword: 11 = subfunction number
|
||||
* +4: dword: 0 (reserved)
|
||||
* +8: dword: 0 (reserved)
|
||||
* +12 = +0xC: dword: 0 (reserved)
|
||||
* +16 = +0x10: dword: 0 (reserved)
|
||||
* +20 = +0x14: ASCIIZ-name of folder, the rules of names forming are
|
||||
given in the general description
|
||||
or
|
||||
* +20 = +0x14: db 0
|
||||
* +21 = +0x15: dd pointer to ASCIIZ-string with folder name
|
||||
Returned value:
|
||||
* Nothing comes back.
|
||||
Remarks:
|
||||
* The function is supported only for ATAPI devices (CD and DVD).
|
||||
* The path is standard for 70 functions. For serviceability it is possible to be limited to paths:
|
||||
db '/cd0/1/',0
|
||||
db '/cd1/1/',0
|
||||
db '/cd2/1/',0
|
||||
db '/cd3/1/',0
|
||||
* An example of usage of the function is the application CD_tray.
|
||||
|
||||
======================================================================
|
||||
========== Function 71, subfunction 1 - set window caption. ==========
|
||||
======================================================================
|
||||
|
@ -388,8 +388,6 @@ fs_RamdiskServices:
|
||||
dd 0
|
||||
dd fs_RamdiskDelete
|
||||
dd fs_RamdiskCreateFolder
|
||||
dd fs_NotImplemented
|
||||
dd fs_NotImplemented
|
||||
fs_NumRamdiskServices = ($ - fs_RamdiskServices)/4
|
||||
|
||||
fs_OnFloppy:
|
||||
@ -421,8 +419,6 @@ fs_FloppyServices:
|
||||
dd 0
|
||||
dd fs_FloppyDelete
|
||||
dd fs_FloppyCreateFolder
|
||||
dd fs_NotImplemented
|
||||
dd fs_NotImplemented
|
||||
fs_NumFloppyServices = ($ - fs_FloppyServices)/4
|
||||
|
||||
fs_OnHd0:
|
||||
@ -496,8 +492,6 @@ fs_HdServices:
|
||||
dd 0
|
||||
dd fs_HdDelete
|
||||
dd fs_HdCreateFolder
|
||||
dd fs_NotImplemented
|
||||
dd fs_NotImplemented
|
||||
fs_NumHdServices = ($ - fs_HdServices)/4
|
||||
|
||||
;*******************************************************
|
||||
@ -579,8 +573,6 @@ fs_CdServices:
|
||||
dd 0
|
||||
dd fs_NotImplemented
|
||||
dd fs_NotImplemented
|
||||
dd fs_EjectDeviceTray
|
||||
dd fs_LoadDeviceTray
|
||||
fs_NumCdServices = ($ - fs_CdServices)/4
|
||||
|
||||
;*******************************************************
|
||||
|
@ -489,17 +489,6 @@ fs_CdGetFileInfo:
|
||||
pop edi
|
||||
xor eax, eax
|
||||
ret
|
||||
;----------------------------------------------------------------
|
||||
fs_EjectDeviceTray:
|
||||
call clear_CD_cache
|
||||
call allow_medium_removal
|
||||
call EjectMedium
|
||||
ret
|
||||
;----------------------------------------------------------------
|
||||
fs_LoadDeviceTray:
|
||||
call LoadMedium
|
||||
ret
|
||||
;----------------------------------------------------------------
|
||||
|
||||
cd_find_lfn:
|
||||
mov [cd_appl_data],0
|
||||
|
@ -4957,10 +4957,48 @@ align 4
|
||||
|
||||
syscall_cdaudio: ; CD
|
||||
|
||||
cmp eax, 4
|
||||
jb .audio
|
||||
jz .eject
|
||||
cmp eax, 5
|
||||
jnz .ret
|
||||
.load:
|
||||
call .reserve
|
||||
call LoadMedium
|
||||
call .free
|
||||
ret
|
||||
.eject:
|
||||
call .reserve
|
||||
call clear_CD_cache
|
||||
call allow_medium_removal
|
||||
call EjectMedium
|
||||
call .free
|
||||
ret
|
||||
.audio:
|
||||
call sys_cd_audio
|
||||
mov [esp+36],eax
|
||||
.ret:
|
||||
ret
|
||||
|
||||
.reserve:
|
||||
call reserve_cd
|
||||
mov eax, ebx
|
||||
shr eax, 1
|
||||
and eax, 1
|
||||
inc eax
|
||||
mov [ChannelNumber], eax
|
||||
mov eax, ebx
|
||||
and eax, 1
|
||||
mov [DiskNumber], eax
|
||||
call reserve_cd_channel
|
||||
inc ebx
|
||||
mov [cdpos], ebx
|
||||
ret
|
||||
.free:
|
||||
call free_cd_channel
|
||||
and [cd_status], 0
|
||||
ret
|
||||
|
||||
align 4
|
||||
|
||||
syscall_delramdiskfile: ; DelRamdiskFile
|
||||
|
@ -55,49 +55,20 @@ still:
|
||||
|
||||
button:
|
||||
mcall 17 ; 17 - получить идентификатор нажатой кнопки
|
||||
cmp ah,2
|
||||
jne b3
|
||||
mov dword [load_tray.name],cd0
|
||||
jmp b5.1
|
||||
b3:
|
||||
cmp ah,3
|
||||
jne b4
|
||||
mov dword [load_tray.name],cd1
|
||||
jmp b5.1
|
||||
b4:
|
||||
cmp ah,4
|
||||
jne b5
|
||||
mov dword [load_tray.name],cd2
|
||||
jmp b5.1
|
||||
b5:
|
||||
cmp ah,5
|
||||
jne b6
|
||||
mov dword [load_tray.name],cd3
|
||||
.1:
|
||||
mcall 70, load_tray
|
||||
jmp red
|
||||
; êíîïêè 2,3,4,5 - load tray CD0/CD1/CD2/CD3
|
||||
movzx ecx, ah
|
||||
sub ecx, 2
|
||||
cmp ecx, 3
|
||||
ja b6
|
||||
mcall 24,5
|
||||
jmp red
|
||||
b6:
|
||||
cmp ah,6
|
||||
jne b7
|
||||
mov dword [eject_tray.name],cd0
|
||||
jmp b9.1
|
||||
b7:
|
||||
cmp ah,7
|
||||
jne b8
|
||||
mov dword [eject_tray.name],cd1
|
||||
jmp b9.1
|
||||
b8:
|
||||
cmp ah,8
|
||||
jne b9
|
||||
mov dword [eject_tray.name],cd2
|
||||
jmp b9.1
|
||||
b9:
|
||||
cmp ah,9
|
||||
jne b1
|
||||
mov dword [eject_tray.name],cd3
|
||||
.1:
|
||||
mcall 70, eject_tray
|
||||
jmp red
|
||||
; êíîïêè 6,7,8,9 - eject tray CD0/CD1/CD2/CD3
|
||||
sub ecx, 4
|
||||
cmp ecx, 3
|
||||
ja b1
|
||||
mcall 24,4
|
||||
jmp red
|
||||
b1:
|
||||
cmp ah, 1 ; если НЕ нажата кнопка с номером 1,
|
||||
jne still ; вернуться
|
||||
@ -160,27 +131,6 @@ header db ' ATAPI Device Tray Control',0
|
||||
text3 db 'eject eject eject eject',0
|
||||
text2 db 'load load load load',0
|
||||
text1 db '/cd0/ /cd1/ /cd2/ /cd3/',0
|
||||
cd0: db '/cd0/1/',0
|
||||
cd1: db '/cd1/1/',0
|
||||
cd2: db '/cd2/1/',0
|
||||
cd3: db '/cd3/1/',0
|
||||
;---------------------------------------------------------------------
|
||||
load_tray:
|
||||
.subfunction dd 11
|
||||
.rezerv dd 0
|
||||
.rezerv1 dd 0
|
||||
.rezerv2 dd 0
|
||||
.rezerv3 dd 0
|
||||
db 0
|
||||
.name: dd cd0
|
||||
|
||||
eject_tray:
|
||||
.subfunction dd 10
|
||||
.rezerv dd 0
|
||||
.rezerv1 dd 0
|
||||
.rezerv2 dd 0
|
||||
.rezerv3 dd 0
|
||||
db 0
|
||||
.name: dd cd0
|
||||
|
||||
I_END: ; метка конца программы
|
||||
|
Loading…
Reference in New Issue
Block a user