🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: cn.bbs.comp.program
1 messages
1 total messages Started by ikoo Wed, 12 Aug 1998 00:00
Defining Services
#363
Author: ikoo
Date: Wed, 12 Aug 1998 00:00
33 lines
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.

--
�� ��Դ:���������� BBS bbs.nease.net��[FROM: 202.96.133.195]
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads