() 1,2,4 8, . 8 32 . , 80386: - : ; - : ; - : + ; - : ( ); - : ( ) + ; - : + ( ); - : + ( ) + ; 2.3 , . (, ), . , , / 3. 2.3.1 . 2-1 , 80386. . , ( ) , . 2-1 +------------------------------------------------------------------------------+ | | | 3 +--------------+----------------+----------------------------------------------| | , | 8, 16, 32 | , , , , | | | | , , , , , | | | | , , "",| | | | "", "". | | | | | | | | , , , , | | | | 1, 1, | | | | ( /) | +------------------------------------------------------------------------------+ +------------------------------------------------------------------------------+ | | 1 | , , | | | | , | +--------------+----------------+----------------------------------------------| | | 2 | , | | | | | +--------------+----------------+----------------------------------------------| | | 0-4 | , , , | | , ,| | , , | | | | | +--------------+----------------+----------------------------------------------| | | 1-4 | , , | | | | , , | | | | , , | +--------------+----------------+----------------------------------------------| | | 32 | (. ) | | | | | +--------------+----------------+----------------------------------------------| | | 48 | | | | | 3 +------------------------------------------------------------------------------+ : - 32 , /. - , . .2-7 , . , , , , . , , .. | 5 | 4 | 3 | 2 | 1 | 0 | -1 +------------------------------------------------------------ ---------------- - 2 7 0 +-------+ | |3 | | +-------+ +-----------+ 4 | -------- 31 0 +------------------------+ | | |5 | | | +------------------------+ -------- - 4 - L------- 6 7 0 +-------+ | |7 | | L-------- 7 3 0 +-------+ | | |8 | | | L---+---- +------- ------------------------+ | | | | | | | 9 | | | | | | | +------- ------------------------+ 10 ------- 31 0 +-----------------------+ | | 11 | | +-----------------------+ 47 31 0 +--------------------------------+ | | | 12 | 13 | 14 | +--------------------------------+ +--------------------------------+ 2.3.2 80287 80387 80386 , .2-2. , , , , . , . , . , , . .2-8 , . 2-2 +------------------------------------------------------------------------+ | | | | +------------------------------------------------------------------------+ +------------------------------------------------------------------------+ | | 16,32,64 | , , , | | | | , , , | +--------------+--------------+------------------------------------------| | | 18 | , | | | | | +------------------------------------------------------------------------+ +------------------------------------------------------------------------+ || 32,64 | , , | | | | , , , | +--------------+--------------+------------------------------------------| | | 80 | , , , , | || | , , | | | | , | | | | , , | | | | , | | | | , , , , | | | | , , 2-1,Y*LOG(X+1), | | | | Y*LOG(X), (0.0, , | | | | ..) (80387 , , | | | | , | | | | ). | +------------------------------------------------------------------------+ +-------------------------------------------------------------------+ | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | - 1 | +-------------------------------------------------------------------+ --------------- - 2 79 71 3 0 --------+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | | | | | | | | | | | | | | | | | +-----------------------------------------+ 5 | L-------- 4 ---------------- L------- - 3 31 23 0 +----------------------+ 7 | | | | | | | | +----------------------+ |L---T---L- -- | L-------- 6 L------------- 60 51 0 +--------------------------------------------+ 8 | | | | | | | | +--------------------------------------------+ | +-------------+ +------- --------- | L------ L--------------- 79 62 0 --T-----------T--T---------------------------+ | | | | | +--------------------------------------------+ 9 | L-----T------ L------ 4 --------- | L------------------ L------- - 3 .2-8. 2.3.3 80386 . . 2.3.3.1 80386 , , , SS ESP. PUSH , POP . PUSH ALL , POP ALL . INTER ( ) LEAVE ( ) . ENTER , . LEAVE , . 2.3.3.2 JUMP () . ( 2 ) . , .. ; , . , . ( CS, - EIP). , ; , 2 . () CALL (), RETURN (). , , , , , CS EIP. , ( CS, ). EIP , , CS. , . , , 80386 LOOP ( ). ECX; ECX 1 *., -$k , ECX . , . " ", "", ECX=0 0 . 2.3.3.3 BOUND ( ) 80386 , . 80386 , . 80287 80387 , , , . , , 80386 " ". , . , 80386 , . 80386 , . 3.1 , , 80386, .3-1. ( ; ). 80386; . , . , CR2; . , . ( , ). 47 15 0 +-----------------------------+ | | . | +----------------+------------+ | | | +-----------+----------------+------------+ | | | | L-----------+----------------+------------- +-----------------------------------------+ 31 0 +-------------------------+ | | +-------------------------| | | +-------------------------| | | . +-------------------------| | | | | +-------------------------+ 3.2 80386 , , , 80386 . , ; , , . , , . ( " " ""). , . ; , ( ) . : - , , - . , . , , .. , , . , , . , " ". , . , , . 80386 , . 3.2.1 (TSS) , 80386. , " " . TSS(..3-2) , ; . 80386 TSS, . TSS 80386 . TSS a(ab%,.) , , , , .. TSS , . 80386 TSS, . +--------------------------------------+ | ( ) | . . +--------------------------------------| | | +--------------------------------------| | | +--------------------------------------| | | . . +--------------------------------------| | | +--------------------------------------| +--------------------------------------| | | . . +--------------------------------------| | | . . +--------------------------------------+ 3.2.2 ??????? . . ???????? , 80386 . ???? ????? , ?????, . 80386 ????? ?????? ???????? TSS ?????? , TSS, TR ( ), . TSS, TSS. , . TSS , , TSS, . 17 ( 16 ). 3.3 . (), , , , . , . : , ( "" ""). , . , . , . . , . . . , . . , . . , , , , . 80386 , , . 80386 . 3.3.1 80386 .3-3. , .3-3, , . , , . , . , 80386 32- . : , . . +--------------+ | | | | +--------------+ ---------+-+ +-----------------+ | | +--------+ +--+ ||+->|+--->| +--+ +----T-+ L--------+--------- | | L--------- L--- | | 47 31 0 L----------- 31 0 | | | | +-------------------------------------------+ | | +--------------+ | +-----------+ | 31 0 | | | |--------------------+ | | | +--+ | | +-----------+ |-+------------------+ | |+--------------------------+ 31 | 0 | 31 0 | +----------------+ +---------------------++------------------+| | +-->| +-->| +-- +----------------+ +---------------------++------------------+ , .. . . 32- . , , , . , 80386 . . , , 4. 80386 (, , ) ( 4 ), . , , , . 80386 . 1,5 . , , 80386 ( , ). 3.3.2 , , .. . . , , , . , , . , , , . 80386 , , . 2, 80386 , a.ab.oi%#. . 80386 , . , . . , (, CS). , , , . . , .3-4 . . , 80386 , , . , , . ---------------------+ -----------------------------------------+ | ----------------------------------------+ | | ------------------------------+ | | | ------------------+ | | | | | | | | | +--------------+ | | | | | | +------------------------------| | | +------------------------------| | | +------------------------------+ . , (GDT) (LTD). ( , ). 8192 . , , , GDT, LDT . GDT LDT , . , , GDT. ( ) , , GDT. ' $ g . LDT (LDTR), ( , ) TSS . (. .3-5): 1. , GDT, . 2. , LDT, , LDT, . 3. LDT , . , , . 3.3.3 , , . , . , , . . 80386 4 . . -, -, , . (- 80386, , ). -, 4 . , , "", . 80386 , PG 0 . , , . . , . - 80386 , .3-6. . CR3 80386 ( ) . CR3 , TSS . , ab` -(g-.) 1024 . , 4 , 4 - . .3-6 80386 , . 10 . . 10 , , . 12 , 32- . , , , 80386 32- , , (), . (TLB). , TLB, , . , 98-99% TLB,