. , , ,

,,,

,

7

.. 7-62

..

I.                   

II.                  . . .

III.               2 21, - 40 II).

16 1998 .

. . . DOS. 1.44 .


TOC o "1-3" 1. .............................................................................................................. PAGEREF _Toc422619194 h 4

2. ............................................................................... PAGEREF _Toc422619195 h 8

2.1. . PAGEREF _Toc422619196 h 8

2.2. ................................ PAGEREF _Toc422619197 h 10

2.3. ..................................................... PAGEREF _Toc422619198 h 12

2.4. ............................................ PAGEREF _Toc422619199 h 14

3. - ............................................................... PAGEREF _Toc422619200 h 15

3.1. ................................... PAGEREF _Toc422619201 h 15

3.2. ................................................................................ PAGEREF _Toc422619202 h 17

3.2.1. Frozen............................................................................................................................. PAGEREF _Toc422619203 h 19

3.2.2. Install.............................................................................................................................. PAGEREF _Toc422619204 h 20

3.2.3. Ind................................................................................................................................... PAGEREF _Toc422619205 h 20

3.2.4. .................................................................................................... PAGEREF _Toc422619206 h 26

3.2.5. ........................................................................................................................... PAGEREF _Toc422619207 h 27

4. .............................................................................................................. PAGEREF _Toc422619208 h 28

5. ..................................................................................................... PAGEREF _Toc422619209 h 29

6. ..................................................................................................... PAGEREF _Toc422619210 h 31

6.1. .......................................................................... PAGEREF _Toc422619211 h 31

6.2. ............................................. PAGEREF _Toc422619212 h 31

6.3. ................................................................................. PAGEREF _Toc422619213 h 31

                                                                                                                                             1.     

, , , . , . , : , ( ) .

, , , , . - , , . , , , . 2 10 . . - , .

, , , , , . [7]:

1.      

2.      

3.       e-mail) .)

4.      

5.      

6.      

. , . , - , .

( Business Software Alliance 98% ) , 200$ . , , , - .

, , . : , , . , , . , , , . , . , .

: , , -. ( , .. - , , , , .

, , , ( ) . , , , ( ) , , , ( ) , . - , , ( , , , ), . . , , ! , , : ( ), , , .

, . , , .. , , .. . , , . , ( ) : , , , .

                                                                   2.     

2.1.  

, ( ) () , .

(. 2.1). [7]


. STYLEREF 1 s 2. SEQ . * ARABIC s 1 1.

, . , () .

, .

/ .

, .

.

.

, - . , , , , . , .

, , , .

, . , , , , , . , , , , . , ( ), , , .

, .

2.2.  

:

-          

-          

. , :

-          

-          

-          

-          

.

. [4] (, , .) , , , . . -, , . -, , , ( ) , , , , . , , . ( EXE-), EXE.

, , , . SNAPSHOT INTRUDER. , , ( EXE-, , ).

, , , .

, :

-          

-          

-          

2.3.  

, , .

:

-         

-          try and buy), , );

-         

( ) , .

, :

-         

-         

-         

. , . , , . , .

:

-         

-          ;

-         

, , , .

.

() . . , , . , . , . , , .

, , , , .

2.4.  

, . 2.1 2.3, .

. , , . 2.2.

, . 2.2, . . , DOS Exec. .

. 2.3, . . ( ), . .

                                          3.     

3.1.  

. - . (Fortran - FORmula TRANslator ) , (Lisp LISt Processing ) , (Prolog PRO LOGic) .. , . . , .

:

-         

-         

(Assembler). , :

1)       Basic), (Pascal), (). , .

2)      


3.2.  

:

1)       Frozen - , .

Frozen

Install

Ind

Task

Install

Ind

Task


2)       Install, , , (Task), Ind.

Install

Ind

Task

Ind

Task


3)       Ind, , . , Task. Task .

Ind

Task

Task


.

3.2.1.      Frozen.

Frozen . 80 ( ). DOS 1.44 0 79, , . , ( 1.44 80), . ( 512 , ) . , . Frozen . Copyright KES_Company, 1998. Install, Task.

3.2.2.      Install.

, Frozen Install.

Install Ind :

1)         Install , Frozen;

2)        

, Install . . Install , , . . , , ( Frozen) . Ind Install . Ind.

3.2.3.      Ind.

Ind . , . . , - (, ), .. ( , ).

, , , .

.

, Ind:

1)       FDDCount ();

2)       FDDType ;

3)       BaseMemory ;

4)       ExtMemory ( 1 );

5)       BIOSData ROM-BIOS;

6)       CPUType ;

7)       CPUFeature , ;

8)       VESAVersion VBE (VESA BIOS Extension);

9)       VideoMemory ;

10)   VESAOEMString .

.

.

BIOS 0:0410h , . . POST (Power-On Self-Test), ROM-, . 6-7 , .

, .

CMOS. , - 70h 71h. CMOS . 70h , . 71h. CMOS , , . 10h , 15h-16h 17h-18h ( 30h-31h).

ROM-BIOS.

ROM-BIOS ASCII BIOS F000:FFF5 8 .

, .

Pentium , [14].

Intel 8086/8088 , 12-15 FLAGS . FLAGS AX. :

PUSHF

POP AX

12-15 FLAGS:

AND AX,0FFFh

PUSH AX

POPF

, FLAGS. FLAGS AX, 0F000h, 0F000h:

PUSHF

POP AX

AND AX,0F000h

CMP AX,0F000h

JE this_8086

12-15 , Intel 8086/8088, .

, .

Intel 80286, , 12-15 FLAGS , .

, Intel 80386 , EFLAGS 18. Intel 80486 . Intel 80386.

Intel 80486 21 EFLAGS. Intel Pentium Intel CPUID.

Intel ( Pentium ) CPUID, . :

CPUID MACRO

DB 0Fh

DB 0A2h

ENDM

CPUID, EAX 1:

MOV EAX,1

CPUID

EAX , , EDX , , (feature flags). (EAX, EDX) CPUType (EAX) CPUFeature (EDX) , Pentium. CPUFeature , CPUType :

CPUType

1

Intel 8086/8088

2

Intel 80286

3

Intel 80386

4

Intel 80486

VBE, .

.

MOV AX, 4F00h

ES:DI 256, VBE2

INT 10h

, . VBE, , 64 , ASCIIZ, .

.

, ( ) . , , , upgrade. .

. - (, (Motherboard), (FDD) ..) , . - (!) . , , .

FDD

FDDCount

FDDType

RAM

BaseMemory

ExtMemory

BIOS

,

BIOSData

CPU

CPUType

CPUFeature

Video

VESAVersion

VideoMemory

VESAOEMString

.

, . , . XOR 0ABh. , , . , , . . , . , (Copy) , . , , , , . . , DOS ( , ), (Move) .

.

(Task) Ind . ( Task Ind) XOR 0A5h.

3.2.4.     

:

1)       Install Ind;

2)       Ind Task.

. . , ( ) , . . . , . JMP. . , . ( DOS 4Ah) , . .

3.2.5.      .

, , 80, / 1 80 , . . , 6.3.

                                                                                                                                                  4.     

1)      

2)      

3)      

4)      

5)       , .

                                                                                                                                    5.     

1) IBM PC / . . .. . - .: . ., 1992. - 447 .: .

2) i486. , , . - .: -Ȼ, 1993. - 240 .

3) i486. ( 4- ). 1. . 2. . 3. . 4. . - ., , 1993. - . 382, . 54

4) MS-DOS. .: ܻ, 1992. - 176 .

5) IBM PC: . ., - .: ; , 1992. - 352 .: .

6) IBM PC. - .: -Ȼ, 1996. - 288 .

7)

8)

9)

10) IBM PC XT. : . . - 2- ., . - .: . 1991. - 336 .: .

11) PC PS/2: . . - .: , 1992. - 319 ., .

12)

13) MS-DOS. - . 2, . . - .: , , 1995. - 382 ., .

14)

15)

16) B ProGroup: .., .., .., .., .. . IBM PC/XT/AT PS/2. - : , 1995. - 224 . - ( ).

17) B Programmers Group: .., .., .., .., .. . - .: , , 1992. - 192 .: . - ( )

                                                                                                                                6.     

6.1.  

1)        3.5 1.44 , .

6.2.  

1)               DOS 6.22.

2)              

6.3.  

, .

1)       ngmd.mac.)

;

out_ngmd MACRO byte

LOCAL @Ok

mov AH,byte

call OutFDC

jnc @Ok

FatalError

@Ok:

ENDM

;

in_ngmd MACRO Mem

LOCAL @Ok

push AX

call InFDC

jnc @Ok

jmp @ErrFatal

@Ok: IFNB

mov Mem,AL

ENDIF

pop AX

ENDM

;

WaitInt MACRO

LOCAL @Ok

call _WaitInt

jnc @Ok

FatalError

@Ok:

ENDM

;

FatalError MACRO

jmp @ErrFatal

ENDM

;

; :

; D

; HDS

; NCN

ngmdSeek MACRO D,HDS,NCN

LOCAL @Ok

mov DL,D

mov DH,HDS

mov CH,NCN

shl DH,2

or DL,DH

call _ngmdSeek

jnc @Ok

FatalError

@Ok:

ENDM

;

; D

; HDS ()

; NCN

; R  

; Buf -

ngmdRead MACRO D,HDS,NCN,R,Buf

mov DL,D

mov DH,HDS

mov CH,NCN

mov CL,R

mov AX,DS

mov ES,AX

lea DI,Buf

call _ngmdRead

ENDM

;

; D

; HDS ()

; NCN

; R  

; Buf -

ngmdWrite MACRO D,HDS,NCN,R,Buf

mov DL,D

mov DH,HDS

mov CH,NCN

mov CL,R

mov AX,DS

mov ES,AX

lea DI,Buf

call _ngmdWrite

ENDM

2)    Frozen, . ( frozen.asm.)

; 8h

Old_8h dd 0

;

RtCounter dw 0

; 8h (Timer)

;

Int_8h PROC

push AX

cmp CS:RtCounter,0

je New08IRet

dec CS:RtCounter

New08IRet:

;

push DS

mov AX,40h ; BIOS

mov DS,AX

add WORD PTR DS:[6Ch],1

adc WORD PTR DS:[6Eh],0

cmp WORD PTR DS:[6Eh],0018h

jne New08Time

cmp WORD PTR DS:[6Ch],00B0h

jne New08Time

mov BYTE PTR DS:[70h],1

mov WORD PTR DS:[6Ch],0

mov WORD PTR DS:[6Eh],0

New08Time: pop DS

mov AL,20h

out 20h,AL

jmp SHORT $+2

pop AX

iret

Int_8h ENDP

;

f_Int0Eh db 0

; 0Eh

Old_0Eh dd 0

; 0Eh

;

Int_0Eh PROC

push AX

mov CS:f_Int0Eh,1

mov AL,20h

out 20h,AL

jmp SHORT $+2

pop AX

iret

Int_0Eh ENDP

Main PROC

; (skip)

; ES

xor AX,AX

mov ES,AX

; 8h (Timer)

GetIntVec 8h,CS:Old_8h

; 8h

SetIntVec 8h

; 0Eh ( )

GetIntVec 0Eh,CS:Old_0Eh

; 0Eh

SetIntVec 0Eh

;

xor AX,AX ;500 /

mov DX,03F7h ;CCR

out DX,AL

jmp SHORT $+2

;

call _ngmdReset

;

lea SI,FormatBuf

mov BYTE PTR DS:[SI],4Dh ; FORMAT

mov BYTE PTR DS:[SI+1],0 ; 0, A:

mov BYTE PTR DS:[SI+2],2 ; 512

mov BYTE PTR DS:[SI+3],18 ;

mov BYTE PTR DS:[SI+4],108 ; GAP3

mov BYTE PTR DS:[SI+5],066h ;-

add SI,2

mov CX,18

xor AX,AX

PrepForFormat:

inc AL

add SI,4

mov BYTE PTR DS:[SI],80 ;

mov BYTE PTR DS:[SI+1],0 ;

mov BYTE PTR DS:[SI+2],AL ;

mov BYTE PTR DS:[SI+3],2 ;

loop PrepForFormat

; A:

; - 0

; - 80

ngmdSeek 0,0,80

push DS

pop ES

mov AL,4Ah

mov CX,18*4

lea DI,FormatBuf

add DI,6

; DMA

call SetDMA

; -

mov CX,6

lea SI,FormatBuf

cld

FormatTableHeader:

lodsb

out_ngmd AL

loop FormatTableHeader

;

WaitInt

in_ngmd ST0

REPT 6

in_ngmd

ENDM

mov AH,ST0

and AH,11000000b

or AH,AH

jz @Ok1

@ErrFatal:

;

mov AH,9

lea DX,MesErrFatal

int 21h

jmp @MotorOff

@Ok1:

call _ngmdReset

ngmdWrite 0,0,80,1,Sector

@MotorOff:

;

call _ngmdReset

;

mov DX,3F2h

mov AL,0Ch

out DX,AL

mov AX,0

mov ES,AX

; 0Eh

RestoreIntVec 0Eh

; 8h

RestoreIntVec 8h

; (skip)

Main ENDP

3)       DMA. ( frozen.asm install.asm.)

;

;

; :

; AH

; :

; CF = 1 -

; CF = 0 -

OutFDC PROC

push AX

push BX

push CX

push DX

mov DX,3F4h

mov BL,2

xor CX,CX

OutFDC1: in AL,DX

and AL,11000000b

cmp AL,10000000b

je OutFDC2

loop OutFDC1

dec BL

jnz OutFDC1

stc

jmp SHORT OutFDCRet

OutFDC2: inc DX

mov AL,AH

out DX,AL

jmp SHORT $+2

mov BX,29

call WaitTimer2

clc

OutFDCRet:

pop DX

pop CX

pop BX

pop AX

ret

OutFDC ENDP

;

;

; :

; AL

; CF = 1 -

; CF = 0 -

InFDC PROC

push BX

push CX

push DX

mov DX,3F4h

InFDC0: mov BL,2

xor CX,CX

InFDC1: in AL,DX

and AL,11000000b

cmp AL,11000000b

je InFDC2

loop InFDC1

dec BL

jnz InFDC1

stc

jmp SHORT InFDCRet

InFDC2: inc DX

in AL,DX

mov BX,29

call WaitTimer2

clc

InFDCRet:

pop DX

pop CX

pop BX

ret

InFDC ENDP

; DMA

;

; :

; AL

; AL = 4Ah

; AL = 46h

; ES:DI -  

; CX

SetDMA PROC

push AX

push CX

cli

push AX

mov AL,00000110b

out 0Ah,AL

jmp SHORT $+2

pop AX

out 0Ch,AL

jmp SHORT $+2

out 0Bh,AL

jmp SHORT $+2

push CX

mov AX,ES

mov CL,4

rol AX,CL

mov CH,AL

and AL,0F0h

add AX,DI

adc CH,0

out 4,AL

jmp SHORT $+2

mov AL,AH

out 4,AL

jmp SHORT $+2

mov AL,CH

and AL,0Fh

out 81h,AL

jmp SHORT $+2

pop AX

dec AX

out 5,AL

jmp SHORT $+2

mov AL,AH

out 5,AL

jmp SHORT $+2

mov AL,2

out 0Ah,AL

jmp SHORT $+2

sti

pop CX

pop AX

ret

SetDMA ENDP

;

_WaitInt PROC

mov CS:f_Int0Eh,0

mov CS:RtCounter,2000/55 ;2 .

WaitIntLoop:

cmp CS:f_Int0Eh,0

jne WaitIntCF0

cmp CS:RtCounter,0

jne WaitIntLoop

stc

jmp SHORT WaitIntRet

WaitIntCF0: clc

WaitIntRet: ret

_WaitInt ENDP

;

; (Sense Interrupt Status)

Sensl PROC

out_ngmd 00001000b

in_ngmd ST0

in_ngmd

ret

Sensl ENDP

; Seek

; DL

; CH

_ngmdSeek PROC

push AX

out_ngmd 0Fh ;

out_ngmd DL ;

out_ngmd CH ;

WaitInt

Delay 5 ; (225 ms)

call Sensl

mov AL,ST0

and AL,11100000b

cmp AL,00100000b

je @SeekOk

stc

jmp SHORT @SeekRet

@SeekOk: clc

@SeekRet: pop AX

ret

_ngmdSeek ENDP

;

;

; :

; DL

; DH

; CH

; CL

; ES:DI -

_ngmdRead PROC

push DX

;

and DL,00000011b

and DH,00000001b

shl DH,2

or DL,DH

shr DH,2

call _ngmdSeek

; DMA

push CX

mov CX,512

mov AL,46h

call SetDMA

pop CX

out_ngmd 46h ;

out_ngmd DL ;

out_ngmd CH ;

out_ngmd DH ;

out_ngmd CL ;

out_ngmd 2 ;

out_ngmd 18 ;

out_ngmd 108 ;

out_ngmd 0FFh ;

;

WaitInt

REPT 7

in_ngmd

ENDM

pop DX

ret

_ngmdRead ENDP

;

;

; :

; DL

; DH ()

; CH

; CL

; ES:DI -

_ngmdWrite PROC

push DX

;

and DL,00000011b

and DH,00000001b

shl DH,2

or DL,DH

shr DH,2

call _ngmdSeek

; DMA

push CX

mov CX,512

mov AL,4Ah

call SetDMA

pop CX

out_ngmd 45h ;

out_ngmd DL ;

out_ngmd CH ;

out_ngmd DH ;

out_ngmd CL ;

out_ngmd 2 ;

out_ngmd 18 ;

out_ngmd 108 ;

out_ngmd 0FFh ;

;

WaitInt

REPT 7

in_ngmd

ENDM

pop DX

ret

_ngmdWrite ENDP

;

_ngmdReset PROC

;

cli

mov AL,00011000b

mov DX,3F2h

out DX,AL

jmp SHORT $+2

mov BX,29

call WaitTimer2

mov AL,00011100b

out DX,AL

jmp SHORT $+2

sti

;

WaitInt

mov CX,4

mov DL,11000000b

ResetSens:

;

call Sensl

mov AH,ST0

cmp AH,DL

je @Ok3

FatalError

@Ok3: inc DL

loop ResetSens

;

Delay 1000/55

out_ngmd 00000011b ; Specify

out_ngmd 0AFh ; SRT|HUT

out_ngmd 2h ; HLT|ND

mov CX,2

RecalRestart:

cli

out_ngmd 00000111b ; Recalibrate

out_ngmd 0 ; A:

sti

;

WaitInt

;

call Sensl

mov AH,ST0

test AH,00100000b

jz RecalTry

and AH,11000000b

test AH,11000000b

jz RecalCompl

RecalTry:

loop RecalRestart

jmp @ErrFatal

RecalCompl:

;

mov BX,18750

call WaitTimer2

ret

_ngmdReset ENDP

7 .. 7-62 .. I. II.

 

 

 

! , , , .
. , :