;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; RDOS operating system ; Copyright (C) 1988-2011, Leif Ekblad ; ; This program is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation; either version 2 of the License, or ; (at your option) any later version. The only exception to this rule ; is for commercial usage in embedded systems. For information on ; usage in commercial embedded systems, contact embedded@rdos.net ; ; This program is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with this program; if not, write to the Free Software ; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ; ; The author of this program may be contacted at leif@rdos.net ; ; discbase.ASM ; Basic disc server ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; include ..\serv.def include ..\serv.inc include ..\user.def include ..\user.inc .386p vfs_cmd_struc STRUC fc_op DD ? fc_handle DD ? fc_buf DD ?,? fc_size DD ? fc_eflags DD ? fc_eax DD ? fc_ebx DD ? fc_ecx DD ? fc_edx DD ? fc_esi DD ? fc_edi DD ? vfs_cmd_struc ENDS ;;;;;;;;; INTERNAL PROCEDURES ;;;;;;;;;;; _TEXT segment use32 word public 'CODE' assume cs:_TEXT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; NAME: LocalCmd ; ; DESCRIPTION: Run command ; ; PARAMETERS: EDI Msg data ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; extern LowCmd:near LocalCmd Proc near push edi mov ebx,edi add edi,SIZE vfs_cmd_struc push ecx mov esi,esp call LowCmd pop ecx pop edi ; mov ebx,[edi].fc_handle ReplyVfsPost ret LocalCmd Endp ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; NAME: LocalReadSector ; ; DESCRIPTION: Read sector ; ; PARAMETERS: EDI Msg data ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; extern LowReadSector:near LocalRead Proc near push edx mov ebx,[edi].fc_handle MapVfsCmdBuf mov ebx,edx pop edx ; push ebx call LowReadSector mov [edi].fc_eax,eax pop edx ; mov ebx,[edi].fc_handle UnmapVfsCmdBuf ; mov ebx,[edi].fc_handle ReplyVfsCmd ret LocalRead Endp ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; NAME: LocalWriteSector ; ; DESCRIPTION: Write sector ; ; PARAMETERS: EDI Msg data ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; extern LowWriteSector:near LocalWrite Proc near push edx mov ebx,[edi].fc_handle MapVfsCmdBuf mov ebx,edx pop edx ; push ebx call LowWriteSector mov [edi].fc_eax,eax pop edx ; mov ebx,[edi].fc_handle UnmapVfsCmdBuf ; mov ebx,[edi].fc_handle ReplyVfsCmd ret LocalWrite Endp ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; NAME: WaitForMsg ; ; DESCRIPTION: Wait for msg ; ; PARAMETERS: EBX Handle ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; public WaitForMsg_ Unused Proc near ret Unused Endp msgtab: m00 DD OFFSET Unused m01 DD OFFSET Unused m02 DD OFFSET Unused m03 DD OFFSET Unused m04 DD OFFSET Unused m05 DD OFFSET Unused m06 DD OFFSET Unused m07 DD OFFSET Unused m08 DD OFFSET Unused m09 DD OFFSET Unused m10 DD OFFSET Unused m11 DD OFFSET Unused m12 DD OFFSET Unused m13 DD OFFSET Unused m14 DD OFFSET Unused m15 DD OFFSET LocalCmd m16 DD OFFSET LocalRead m17 DD OFFSET LocalWrite WaitForMsg_ Proc near push ebx push ecx push edx push esi push edi push ebp ; xor eax,eax WaitForVfsCmd jc wfmDone ; mov edi,edx mov [edi].fc_handle,ebx mov eax,[edi].fc_eax mov ebx,[edi].fc_ebx mov ecx,[edi].fc_ecx mov esi,[edi].fc_esi mov ebp,[edi].fc_op mov edx,[edi].fc_edx shl ebp,2 call dword ptr [ebp].msgtab mov eax,1 wfmDone: pop ebp pop edi pop esi pop edx pop ecx pop ebx ret WaitForMsg_ Endp _TEXT ends END