-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserv.inc
More file actions
387 lines (326 loc) · 10.1 KB
/
serv.inc
File metadata and controls
387 lines (326 loc) · 10.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; RDOS operating system
; Copyright (C) 1988-2025, Leif Ekblad
;
; MIT License
;
; Permission is hereby granted, free of charge, to any person obtaining a copy
; of this software and associated documentation files (the "Software"), to deal
; in the Software without restriction, including without limitation the rights
; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
; copies of the Software, and to permit persons to whom the Software is
; furnished to do so, subject to the following conditions:
;
; The above copyright notice and this permission notice shall be included in all
; copies or substantial portions of the Software.
;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
; SOFTWARE.
;
; The author of this program may be contacted at leif@rdos.net
;
; SERV.INC
; Server gate macros
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ServGate MACRO gate_nr
db 55h
db 67h
db 9Ah
dd gate_nr
dw 4
db 5Dh
ENDM
;;;;;;;;;; REGISTRATION / HOOKS ;;;;;;;;;;;
TestServ MACRO
ServGate test_serv_nr
ENDM
;;;;;;;;; VFS ;;;;;;;;;;;;;;;;;;
; IN AX Thread ID
ServSignal MACRO
ServGate serv_signal_nr
ENDM
; OUT EBX VFS handle
GetVfsHandle MACRO
ServGate get_vfs_handle_nr
ENDM
; IN EBX VFS handle
IsVfsActive MACRO
ServGate is_vfs_active_nr
ENDM
; IN EBX VFS handle
IsVfsBusy MACRO
ServGate is_vfs_busy_nr
ENDM
; IN EBX VFS handle
; OUT AH Disc #
; OUT AL Part #
GetVfsDiscPart MACRO
ServGate get_vfs_disc_part_nr
ENDM
; IN EBX VFS handle
; OUT EDX:EAX Sectors
GetVfsSectors MACRO
ServGate get_vfs_sectors_nr
ENDM
; IN EBX VFS handle
; OUT EDX:EAX Start sector
GetVfsStartSector MACRO
ServGate get_vfs_start_sector_nr
ENDM
; IN EBX VFS handle
; OUT AX Bytes per sector
GetVfsBytesPerSector MACRO
ServGate get_vfs_bytes_per_sector_nr
ENDM
; IN EBX VFS handle
; OUT EAX Part type
GetVfsPartType MACRO
ServGate get_vfs_part_type_nr
ENDM
; IN EBX VFS handle
; IN EDX IO buffer
StartVfsIoServer MACRO
ServGate start_vfs_io_serv_nr
ENDM
; IN EBX VFS handle
StopVfsIoServer MACRO
ServGate stop_vfs_io_serv_nr
ENDM
; IN EBX VFS handle
; IN ESI FS type
; IN EDX:EAX Start sector
; IN EDI:ESI Sector count
; OUT EBX Partition handle
ServLoadPart MACRO
ServGate serv_load_part_nr
ENDM
; IN EBX VFS handle
ServInitParts MACRO
ServGate vfs_init_parts_nr
ENDM
; IN EBX VFS handle
ServPartsDone MACRO
ServGate vfs_parts_done_nr
ENDM
; IN EBX VFS handle
ServStartPart MACRO
ServGate serv_start_part_nr
ENDM
; IN EBX VFS handle
ServStopPart MACRO
ServGate serv_stop_part_nr
ENDM
; IN EBX VFS handle
ServDisablePart MACRO
ServGate serv_disable_part_nr
ENDM
; IN EBX VFS handle
ServClosePart MACRO
ServGate serv_close_part_nr
ENDM
; IN EBX VFS handle
ServFormatPart MACRO
ServGate serv_format_part_nr
ENDM
; IN EBX VFS handle
; OUT EBX Req handle
CreateVfsReq MACRO
ServGate create_vfs_req_nr
ENDM
; IN EBX Req handle
CloseVfsReq MACRO
ServGate close_vfs_req_nr
ENDM
; IN EBX Req handle
; IN EDX:EAX Start sector
; IN ECX Sector count
; OUT EBX Req #
AddVfsSectors MACRO
ServGate add_vfs_sectors_nr
ENDM
; IN EBX Req handle
; IN EDX:EAX Start sector
; IN ECX Sector count
; OUT EBX Req #
LockVfsSectors MACRO
ServGate lock_vfs_sectors_nr
ENDM
; IN EBX Req handle
; IN EDX:EAX Start sector
; IN ECX Sector count
; OUT EBX Req #
ZeroVfsSectors MACRO
ServGate zero_vfs_sectors_nr
ENDM
; IN EBX Req handle
; IN EAX Req #
RemoveVfsSectors MACRO
ServGate remove_vfs_sectors_nr
ENDM
; IN EBX Req handle
; IN EAX Req #
; OUT EDX Offset to buffer
MapVfsReq MACRO
ServGate map_vfs_req_nr
ENDM
; IN EBX Req handle
; IN EAX Req #
UnmapVfsReq MACRO
ServGate unmap_vfs_req_nr
ENDM
; IN EBX Req handle
; IN EDX:EAX Start sector
; IN ECX Sector count
WriteVfsSectors MACRO
ServGate write_vfs_sectors_nr
ENDM
; IN EBX Req handle
StartVfsReq MACRO
ServGate start_vfs_req_nr
ENDM
; IN EBX Req handle
IsVfsReqDone MACRO
ServGate is_vfs_req_done_nr
ENDM
; IN AX Req handle
; IN BX Wait handle
; IN ECX Object ID
AddWaitForVfsReq MACRO
ServGate add_wait_for_vfs_req_nr
ENDM
; IN EBX VFS handle
; OUT EDX Cmd
WaitForVfsCmd MACRO
ServGate wait_for_vfs_cmd_nr
ENDM
; IN EBX VFS handle
ReplyVfsCmd MACRO
ServGate reply_vfs_cmd_nr
ENDM
; IN EBX VFS handle
; IN EDX Flat block address
ReplyVfsBlockCmd MACRO
ServGate reply_vfs_block_cmd_nr
ENDM
; IN EBX VFS handle
ReplyVfsDataCmd MACRO
ServGate reply_vfs_data_cmd_nr
ENDM
; IN EBX VFS handle
; IN EDI Flat block address
; OUT EDX Flat buf address
MapVfsCmdBuf MACRO
ServGate map_vfs_cmd_buf_nr
ENDM
; IN EBX VFS handle
; IN EDI Flat block address
; IN EDX Flat buf address
UnmapVfsCmdBuf MACRO
ServGate unmap_vfs_cmd_buf_nr
ENDM
; IN EBX VFS handle
; IN EDX Flat address
ServNotifyVfsMsg MACRO
ServGate notify_vfs_msg_nr
ENDM
; OUT EDX Flat address
CreateServShareBlock MACRO
ServGate create_serv_share_block_nr
ENDM
; IN EDX Flat address
FreeServShareBlock MACRO
ServGate free_serv_share_block_nr
ENDM
; IN EDX Flat address
; OUT EDX Flat address
GrowServShareBlock MACRO
ServGate grow_serv_share_block_nr
ENDM
; IN EDX Flat address
; OUT EDX Flat address
ForkServShareBlock MACRO
ServGate fork_serv_share_block_nr
ENDM
; IN EDX Flat address
; OUT ES selector
ServToSystemShareBlock MACRO
ServGate serv_to_system_share_block_nr
ENDM
; IN EBX VFS handle
; IN EDX File info
; OUT BX Kernel handle
ServOpenVfsFile MACRO
ServGate serv_open_file_nr
ENDM
; IN EBX VFS handle
; IN EDX Current ptr
ServWaitVfsIoServer MACRO
ServGate serv_wait_io_serv_nr
ENDM
; IN BX Kernel handle
ServUpdateVfsFile MACRO
ServGate serv_update_file_nr
ENDM
; IN BX Kernel handle
ServCloseVfsFile MACRO
ServGate serv_close_file_nr
ENDM
; IN EBX VFS handle
; OUT EAX Req count
; OUT EBX Wait count
; OUT ECX Block count
; OUT EDX Phys count
ServVfsFileInfo MACRO
ServGate serv_file_info_nr
ENDM
; IN BX Kernel handle
; IN EDX:EAX Position
; IN ECX Size
ServNotifyVfsFileReq MACRO
ServGate serv_notify_file_req_nr
ENDM
; IN BX Kernel handle
; IN ESI Req index
; IN EDX:EAX Sector position
; IN ECX Sector count
; IN ES:EDI Sector buffer
; OUT ECX Sector count
ServVfsFileReadReq MACRO
ServGate serv_file_read_req_nr
ENDM
; IN BX Kernel handle
; IN ESI Req index
; IN EDX:EAX Sector position
; IN ECX Sector count
; IN ES:EDI Sector buffer
; OUT ECX Sector count
ServVfsFileWriteReq MACRO
ServGate serv_file_write_req_nr
ENDM
; IN BX Kernel handle
; IN EDX Req #
; IN ESI Offset sector
; IN ECX Sector count
ServUpdateVfsFileReq MACRO
ServGate serv_update_file_req_nr
ENDM
; IN BX Kernel handle
; IN EDX Req #
ServDisableVfsFileReq MACRO
ServGate serv_disable_file_req_nr
ENDM
; IN BX Kernel handle
; IN EDX Req #
ServFreeVfsFileReq MACRO
ServGate serv_free_file_req_nr
ENDM
; IN EBX Kernel handle
ReplyVfsPost MACRO
ServGate reply_vfs_post_nr
ENDM