FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
MS-DOS-kernel/kernel/memdisk.asm at master · Programuserbash/MS-DOS-kernel · GitHub
Programuserbash
/
MS-DOS-kernel
Public
forked from
FDOS/kernel
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
MS-DOS-kernel
/
kernel
/
memdisk.asm
Copy path
More file actions
More file actions
Latest commit
History
History
History
79 lines (74 loc) · 2.53 KB
Breadcrumbs
MS-DOS-kernel
/
kernel
/
memdisk.asm
Copy path
File metadata and controls
79 lines (74 loc) · 2.53 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
; File:
; memdisk.asm
; Description:
; Query for memdisk provided config.sys parameters
;
; DOS-C
; Copyright (c) 2011
; FreeDOS
; All Rights Reserved
;
; This file is part of DOS-C.
;
; DOS-C 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, or (at your option) any later version.
;
; DOS-C 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.
;
;
; requires 386+ registers, check LoL->CPU >=3 prior to calling (or use 386 build)
%include
"segs.inc"
segment INIT_TEXT
CPU
386
;*********************************************************************
;
; query_memdisk() based on similar subroutine in Eric Auer's public domain getargs.asm which is based on IFMEMDSK
; input: drive (in AL) to query if memdisk provided disk
; output: a far * to a memdiskinfo structure as defined by memdisk (see config.c)
; struct memdiskinfo FAR * query_memdisk(UBYTE drive);
global
_query_memdisk
_query_memdisk:
; save registers, assumes enough space on stack & valid stack frame setup, ax & dx return values
push
es
push
di
push
ebx
push
ecx
push
edx
; we only care about high word
push
eax
; we only care about high word
mov
edx
,
53490000h
; magic3 +
mov
dl
,
al
; drive number (only argument, assumed to be in AL)
mov
eax
,
454d0800h
; magic1 + AH=8 (get geometry)
mov
ecx
,
444d0000h
; magic2
mov
ebx
,
3f4b0000h
; magic4
int
13h
; BIOS DISK API
shr
eax
,
16
; ignore AX
shr
ebx
,
16
; ignore BX
shr
ecx
,
16
; ignore CX (geometry C/S)
shr
edx
,
16
; ignore DX (geometry H in DH)
cmp
ax
,
4d21h
; magic5
jnz
nomemdisk
cmp
cx
,
4d45h
; magic6
jnz
nomemdisk
cmp
dx
,
4944h
; magic7
jnz
nomemdisk
cmp
bx
,
4b53h
; magic8
jnz
nomemdisk
jmp
cleanup
nomemdisk:
xor
di
,
di
; return NULL;
mov
es
,
di
cleanup:
pop
eax
pop
edx
mov
ax
,
di
; return MK_FP(es, di);
mov
dx
,
es
pop
ecx
pop
ebx
pop
di
pop
es
retn
Back
|
FazBrowse Home
|
New Git URL