Article View: cn.bbs.comp.program
Article #363Defining Services
From: ikoo
Date: Wed, 12 Aug 1998 00:00
Date: Wed, 12 Aug 1998 00:00
33 lines
2338 bytes
2338 bytes
Defining Services
A virtual device defines its service by using the BeginProc and EndProc macros and
the Service or Async_Service options. The macros mark the start and end of the
procedure code for the service. The options identify the procedure as a service. The
following example shows the definition for the service VSAMPLED_Get_Version:
BeginProc VSAMPLED_Get_Version, Service
mov ax,030ah
clc
ret
EndProc VSAMPLED_Get_Version
The Async_Service option is for services that can be called asynchronously, that is,
during processing of an interrupt. Asynchronous services must be re-entrant and must
not call VMM or virtual device services that are not also asynchronous.
The VMM and standard virtual devices use two calling conventions for their services:
register-based and 32-bit C-language based. These calling conventions specify the
spelling for the service name, the method for passing parameters and returning values,
and the registers to preserve.
For register-based services, the service name should not begin with an underscore(_).
All the parameters are passed in registers, and results are returned in register.
Typically, the service preserves all registers it does not explicitly use to return values in.
For C-language-based services, the service name must begin with an underscore(_).
All parameters are passed as 32-bit vlaues on the stack. Results (if any) are returned in
the EAX register(for 32-bit values), ot the EAX and EDX registers(for 64-bit values).
The service preserves the EBX,ES,FS, and GS registers as well as the ESI and EDI
registers. Only the flags and the EAX,ECX, and EDX registers are modified.
--
[m[1;34m�� ��Դ:���������� BBS bbs.nease.net��[FROM: 202.96.133.195][m
Technical Details
Message-ID:
<3Q4QHa$SfC@bbs.nease.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: fc86e,e40311828972f1d,start X-Google-Attributes: gidfc86e,public From: ikoo.bbs@bbs.nease.net (ikoo) Subject: Defining Services Date: 1998/08/12 Message-ID: <3Q4QHa$SfC@bbs.nease.net> X-Deja-AN: 380488486 X-Filename: Program/M.902933844.A X-Complaints-To: usenet@news.nease.net X-Trace: news.nease.net 902934926 2837 202.96.152.195 (12 Aug 1998 15:15:26 GMT) Organization: Net Ease NNTP-Posting-Date: 12 Aug 1998 15:15:26 GMT Newsgroups: cn.bbs.comp.program,