?????9 - PowerPoint PPT Presentation

1 / 36
About This Presentation
Title:

?????9

Description:

?????? ?????. ?????9 ?????? ?-Linux. ?????9 ?????? ?-Linux. 21 (c) ??? ??? 2003. ???? ?????? ... ???? ??'? ????? ?? debuggers, ???? ?????? breakpoint ... – PowerPoint PPT presentation

Number of Views:27
Avg rating:3.0/5.0
Slides: 37
Provided by: ErezH
Category:
Tags: debuggers

less

Transcript and Presenter's Notes

Title: ?????9


1
?????? ?????
  • ?????9 ?????? ?-Linux

2
???? ??????
  • ???? ??????? ?-Linux
  • ?????? ?-IA32
  • ???? ???????
  • ???? ??????? (IDT)
  • ????? ???????
  • ????? ?-IDT ?-Linux
  • ????? ??????? ?-Linux
  • ????? ???????
  • ????? ??????? ?????
  • ?????? ???????
  • ???? ??????

3
???? ??????? ?-Linux (1)
  • ????? ??? ??? ????? ????? ????? ????? ????? ?????
    ?? ?????? ??????
  • ???? ????? ?????? ???? ?? ???? ?????? ?????? ????
    ??? ????? ?????? ??????
  • ?????? ??? ?????? ?????? ????Interrupt Service
    Routine.
  • ?-Linux ?? ????? ?? ?????? ????, ??? ????? ?????.
  • ????? ????? ?????? ?????? ????? ??? ???? ?????
  • ?????? ????? ??? ?????? ????? ?????? ????? ?????
    ????? ??-??? ????? ?? ????? ?? ???? ?????

4
???? ??????? ?-Linux (2)
  • ????? ???? ????? ????? ?????? ?????? ?????? ???
    ??? ????? ?? ???? ?????? ?? ?????? ???? ?????? ??
    ???? ?????? ?????? ??????
  • ?????? ????? ????? ?-0 ????? ??????
  • ??????? IA32 ?? 256 ???? ??????
  • ???????? 0-255
  • ???? ?????? ???? ?? ????? ?????? (interrupt
    vector)
  • ?????? ????? ??????, ?????? ?????? ?????? ?? ???
    ?????? ??????
  • ???? ????? ????? ??????? ??????

5
???? ??????? ?-Linux (3)
  • ????? ???? ?? ?? ?????? ??????? ?????? ??? ?????
    ?? ?? ??? ?????? ?????? ????
  • ????? ???? ????? ????? ?? ????? ????? ??????
  • ???? ???? ?????? ??????, ????? ???? ?????? ??????
    ???? ?????? (????? ????? ????? ???? ?????? ?????
    ??????)
  • ????? ????? ????? ????? ????? ?????????, ??? ???
    ???? ????? ????
  • ????? (nesting)- ?????? ?????? ????? ???? ??????
    ???? ?????? ?????
  • ?????? ????? ??????, ???? ?????? ?????? ????
    ??????? ????? ??-?????

6
???? ??????? ?-Linux (4)
  • ?????? ??????? ?-Linux ??? ????? ??????? ??
    ?????? ????
  • ?????? ?? ????? ????? ????? ???? ?????? (Kernel
    Control Path)
  • ?????? ???? ?????? ?? ????? ????? ??????? ??? ???
    ???? ????? ???? ?????? ???? ??????? ?? ???????
    (??????? ?????)
  • ????? ?????? ???? ????? ?????? ?? ?????? ??????
  • ?? ?? ?????? ??? ??? ?????? ?????
  • ????? ?????? ????? ???? ?-Kernel Mode ???? ?????
    ??????? ??? ????? ???? ?????? ??????
  • ?????? ?????? ??? ????? ??????? ?? ????? ??? ????
    ?-Kernel Mode

7
?????? ?-IA32 Interrupts
  • ?????? ?? ????? ????? ????????? ?"? ????? ?????
    ????????
  • ???? ?????? ?????? (masking) ?"? ??? ?-Interrupt
    Flag (IF), ??????? ??????
  • ????? ????? ???? ?????? ?? ??????? ?????
  • ?????? ?????? cli ?-sti ?????? ??????? ?? ??????
    ?"? ????? ?????? ???? IF
  • ????? ????? ?????? ????? ?????? ????? ?????
    ???????
  • ?????? ??????? ?? ?????? ??????
  • ?????? NMI Non-Maskable Interrupts
  • ?????? ?????? ?? ????? ????? ???????, ???? ?????
    ???

8
?????? ?-IA32 Interrupts (2)
  • ??????? ?? ????? ??????? ??? ?????? ?????? ????
    ??? ???? (Advanced Programmable Interrupt
    Controller APIC)

????
????
IRQ0
APIC
?????
IRQ7
????? ???
IRQ11
????
9
?????? ?-IA32 Interrupts (3)
  • ?? ???? ????? ????? ????? ????? ???? ??? IRQ
    (Interrupt ReQuest) ???? ????? ?????? ?? ???
    ??????? ???? ????? ?????
  • ???? 16-24 ???? ????? ???????? IRQ0-IRQ15/IRQ23
  • ???? ???? ??? ?????? ????? ?? (IRQ Sharing)
  • ? ????? ?????? ????? ????? ????? ?? ??????? ?????
    ????? ??
  • ???? ??? ??????? ????? ????? ????? ?????, ???
    ????? ??? ????? ????? ???? ??? ?????
  • ???? ?????? ?????? ???? ?? IRQn ???? ??????.
  • ???? ???, n32

10
?????? ?-IA32 exceptions
  • ?????? ?????????? (??????), ??? ?????? ?"? ?????
    ?????? ?????? ????? ?????? ???? ??? ?"? ??????
    ????????
  • ???? ?????? ???? ???????
  • ????? ????? ?? ??????
  • Faults ??????? ????? ??????? ?????? ??????
    ?????? ??????? ????
  • ????? ????? ?-0
  • ????? ????? ????? ?????? ??? ?? ?? ?????? ?????
    ?? ?????, ??? ???? ???? ????
  • Traps ?????? ????? ????? ?"? ?????? ???????
    ????, ??? ?????? ?? ??? ?????? ??????
  • ???? ??"? ????? ?? debuggers, ???? ??????
    breakpoint
  • ????? ????? ????? ?????? ??? ?? ????? ??????
    ????? ?-trap
  • Aborts ??????? ????? ?????? ?????? ??????
    ??????? ????
  • ????? ?????? ????? ??????? ?? ??????? ???? ?????
    ????? ???? Machine Check ?????? ????? ?????
    ?????? ???????

11
programmed exceptions
  • ?????? ???????? (programmed exceptions) ?? ??????
    ????? (software interrupts) ?? ??? ?? traps
    ??????? ?????? ?????? ?????
  • ??? ???? ????? ???????? ??????
  • ?????, ?-Linux ?????? int 0x80 ????? ??????? ?????

12
Interrupt Descriptor Table (1)
  • ?????? ?-IA32 ??? ????? ????? ????? ??????
    ?????? ????? ??? ???? ?????? Interrupt
    Descriptor Table (IDT)
  • ?????? ?????, idtr, ????? ????? ?-IDT
  • ???? ?"? ????? ?????? ???? ??????, ?????? ?????
    lidt
  • ?-IDT ?? ????? ???? ?? ????? ?????
  • ??"? 256 ??????
  • ?? ????? ????? 8 ????
  • ?? ????? ????? interrupt descriptor

13
Interrupt Descriptor Table (2)
  • ????? ?????
  • ???? ??? ??????
  • ????? ???? ?????? (segmentoffset)
  • DPL ??? CPL ??????? ????? ???? ??????
  • ??? ?????? ???? ????? ??????? ??????? (??????
    ?????, debugging), ??????? ?????? ?????
  • ??? ?? ?????? ????? (???? ????? ?????)
  • 3 ???? ?????? ?-IDT
  • Interrupt Gate ??????? ?????
  • ??? ?-IF ????? ???????? ????? ?????? ??? ????? ??
  • Trap Gate ???????
  • ??? ????? ?-IF ????? ?????? ?????? ??? ????? ??
  • Task Gate ????? ????? ?????? ?????? ??????
  • ??? ?? ???? ?????? ?-Linux, ?? ?????? ???? ???????

14
??????? ?? ?????? ????? ?-IDT
DPL ????? ???? ?????? segoffs ??? ?????? (gate) ?????
0 divide_error trap 0
3 int3 trap 3
0 general_protection trap 13
0 timer interrupt 32
0 disk interrupt 43
3 system_call trap 128
?????? ???? ?????
?? ?????? ???? ?????
15
????? ?-IDT ?-Linux (1)
  • ???? ?-IDT ??????? ????? ?"? ?-BIOS
  • Linux ?????? ?? ?? ?????, ???? ??????.
  • ?????, ?????? ???????? setup_idt() ??????? ?? ??
    ??????? ????? ????? ????? ???? ?????
  • Interrupt Gate
  • ????? ????? ignore_int()
  • ???? ?? ?????? ????? "Unknown Interrupt" ?? ????
    ?????? ?????? ?? ????? ????? ?????? ????? (????
    ??? ?? ???? ?????)
  • DPL0
  • setup_idt() ?-ignore_int() ??????? ??????? ?????
    ?????? arch/i386/kernel/head.S
  • ???? ??????, ???? ???? ?? ?-IDT ????? ?? ???????
    ???????? ?????? ??????? ???????? ??????? ???????
  • ????? ????? ?????? ????? ????? ???? ?? ????? ???
    ????? drivers

16
????? ?-IDT ?-Linux (2)
  • ????? ????? ????? ???? ????????? ?????, ????????
    ????? ?????? arch/i386/kernel/traps.c
  • set_intr_gate(n, addr)
  • ?????? ?????? ??????? ?????
  • ????? interrupt gate ?????? n ?????, ?? DPL0
    ?????? ???? ????? kcsaddr (kcs ????? ?? ?-code
    segment ?? ??????)
  • set_system_gate(n, addr)
  • ????? system gate (trap gate ?????? ?????? ?????)
    ?????? n ?????
  • ????? kcsaddr, DPL3
  • ????? ????? ?????? ??????? ????? ?? ?????? ???
    ?????? ?????
  • ????? ??????? debugging ??????? 128 (0x80)
    ??????? ??????? ?????
  • set_trap_gate(n,addr)
  • ????? trap gate ?????? n ?????, ?? ????? kcsaddr
    ?-DPL0
  • ????? ?????? ???????

17
????? ?-IDT ?-Linux (3)
  • ???????? trap_init(), ??????? ????? ??????
    arch/i386/kernel/traps.c, ????? ??? ??????? ?????
    ?? ???? ?-IDT. ???? ??? ?????????
  • set_trap_gate(0, divide_error)
  • ...
  • set_system_gate(4, overflow)
  • ...
  • set_trap_gate(6, invalid_op)
  • ...
  • set_trap_gate(13, general_protection)
  • set_intr_gate(14, page_fault)
  • set_trap_gate(16, coprocessor_error)
  • ...
  • set_system_gate(128, system_call)

18
????? ??????? ?-Linux (1)
  • ???? ??? ???????? ???? ??????? ??? ????? -
    hardware error code
  • ????, ???? ????? ?????? ???? ??? ??????
  • ??? ?????? ?? ???? ????? ??????
  • handler_name
  • pushl 0 / only if no handler error code /
  • pushl do_handler_name / C handler function /
  • jmp error_code
  • ????? error_code ????? ?? ??? ?????? ??????
    ??????? ???? ?????? ??????? (-1) ?????? ??
    ????????? ????? ?????? (????? ?-SAVE_ALL)
  • ?????, error_code ???? ????? ?-do_handler_name ??
    ???????? hardware error code, ?????? ??????
    ????????? (???? struct pt_regs ).
  • ???? ????? ?????? ???????, error_code ?????? ??
    ???????? ?? ????? ??????? ???????? ??????
    ?-ret_from_exception ????? ??????

19
????? ??????? ?-Linux (2)
  • ????? ????? ?????? ?????? ??????? ?????? signal
    ?????? ?????? ??? ????? ????? ??????
  • ??? ?-signal ???? ??-?? ??? ?????? ???????
  • ?????? ???? floating point exception ???? SIGFPE
  • ????? ?-signal ??????? ??????? ?????? force_sig()
    ??????? ????? ?????? kernel/signal.c
  • force_sig(sig_number, current)
  • ???? ????? ?-User Mode, ?????? ???? ??? signal
    ?????? ??, ????? ???? ?-signal ??.

20
????? ??????? ????? ?-Linux
  • ?? ????? ?? ????? ????? ?????? ???? ?????? ????
  • IRQn_interrupt
  • pushl n-256
  • call common_interrupt
  • ?????? ??? ?????? ?????? ???? ??? ?????? ?????
    ??? ?????? ?-common_interrupt, ???? ?????? ???
    ??????? ??? ??????? ???? ????? ??????? ??? ??????
    ???? ??????
  • ????? common_interrupt
  • common_interrupt
  • SAVE_ALL / save registers /
  • call do_IRQ / handle interrupt /
  • jmp ret_from_intr / resume execution /

21
???????? do_IRQ()
????? ??????? ????? ?-Linux
  • ???????? do_IRQ(), ?????? ?-C, ????? ?? ??????
    ?????? ???? ????? ?-APIC ?????? ????????
    handle_IRQ_event() ?????? ?-ISRs
  • ???? ????? arch/i386/kernel/irq.c
  • do_IRQ() ?????? ??????
  • unsigned int do_IRQ(struct pt_regs regs)
  • ?????? regs ????? ???????? ???? ????????? ???????
    ???????, ????? ?? ???? ????? ????? ?? ???? ??????
    (???? ????? orig_eax)
  • ???? ?????? ???? ?????? ???? common_interrupt

22
????? ?-APIC
????? ??????? ????? ?-Linux
  • ???? ????? ????? ?????, ?-APIC ????? ?? ??????
    ?????
  • "????" ????? ????? ?? ?????? ?????? ?? ?????
    ????? ??????
  • ?????? ?????? (????? ?-Linux) ?????? ?-APIC
    ?????? ????? ??? ????? ?? ????? ????? ?????? ??
    ?????? ????? ??? ????? ????? ?????? ????
  • ????? ??, ???? ???????? ?????? ?????, ???? ????
    ???? "??????" (?????? ???? ?????) ??????? ?????
    ??????
  • ??? ???, ???? re-entrancy ???? ?????? ????? ???
    ?????
  • ????? ?????? ??????, ?? ????? ?-APIC ?????? ?? ??
    ????? ????? ?????

23
???????? do_IRQ() (2)
????? ??????? ????? ?-Linux
  • ??? ??????? ?? do_IRQ()
  • ????? ??? ?????? ???????
  • ????? ????? ??????? ?-APIC
  • ????? ????? ????? ?????? ?"? handle_IRQ_event()
  • ISR Interrupt Service Routine (????? ?????)
  • ????? ??? ?????? ??????? ?-APIC
  • ????? ?????? ??????? (????? ?????)

24
????? ?-ISRs (1)
????? ??????? ????? ?-Linux
  • ?? ISR ????? ????-??? ???? ????? ????? ??????
    ?????? ????? ??????
  • ISR ???? ?????? ???? ?? ??? ???? ?????
  • ISR ???? ????? ???? ???? ?????? ??????? ?????
  • ??? ???????? ?-Handle_IRQ_event() ????? ??? ?????
    ?????? ?? ISRs ???? ????? ?????? ???????.
  • ??? ??? ??-ISRs ??????? ????? ???? ???? ??????
  • ????? handle_IRQ_event() ?????? ?? ?? ?-ISRs
    ??????? ???? ?????? ??????? ??? ??? ??.
  • ????? ?? ??????? ????? ????? ??????

25
????? ?-ISRs (2)
????? ??????? ????? ?-Linux
  • ???????? handle_IRQ_event() ????? ?????
  • ?????? ?????? ????? ??? ?? ????? ??? ????
    SA_INTERRUPT
  • ????? ?? ?? ?????? ?? ?-ISR ?????? ??????
  • ?????? ?? ?-ISRs ??????? ??? ??? ??
  • ????? ?? ??????? ???? ?????

26
????? ?????? ??????? ?????
  • ????? ??????? ????? ??????? ?????? ????? ??? ??
  • ?????, ??????? ????? ?????? (IF ????) ??????
    ?????? ?????? ?????
  • ????? ???? ????? ?????? ??????? ?????? ????
    ????? ?????? ?????? ??????? ?????
  • ????? ????????
  • ????? ?????? ?????? ?????? ????? (???? ?????
    ?????)
  • ???, ????? ????? ???????? ?? ??????? ??????
    ??????? ??????

27
????? ?????? ?????? ??????? ?????
  • critical ?????? ?????? ????? ???????
    ???????????? ??? ??????? ???????
  • ????? ????? ?? ?-APIC
  • ????? ?-ISR ?? ????? ???? ??????? ???? ?????
    ????? ????? ?????? ?? ??????. ????? ????? ?????
    ?-ISR ????? ????? ????? ????? ???? ????? ?? ?????
    ???? ?????? ???? ???????
  • noncritical ?????? ??? ????? ??? ?????? ??????,
    ?? ??? ???? ?????? ???????
  • ????? ????? ??? ???? ????? ????? ?? ????? ??????
    ?-ISR ?? ?????? ???? ?????? ?????? ??????
    ??????? (??? ?? ???? ?? ????? ???????) ??? ????
    ????? ????? ??????
  • noncritical deferred ?????? ??? ???? ?????
    ?????? ??????, ?? ?? ????? ?????, ??? ????????
    ?????? ?????? ??????
  • ????? ????? ????? ????? ????? ??????? ?????
    ????? ?????? ?????? ?????? ?? ????? ??????.
  • ?????? ??? ??????? ?????? ?? ?????? ???????
    (deferrable functions) ?????? ?????

28
???? ?????? ??????? ?-Linux
  • Softirq ?????? ?????, ???? ?? ?????? ??????
  • ??????? ??????? ?-softirq ????? ????? ??????
    ?????? ???? ?????? ????? (re-entrant)
  • Tasklet ??????? ??????, ?????? ????
  • ??? ?? tasklet ???? ???? ????? ?????? ???????
    ????? ???? ????? ???? ????? re-entrant
  • Bottom Halves tasklets ??????? ?????
  • ?? ?-bottom halves ?????? ??? ????? ????, ?????,
    ??? bottom halves (????? ?? ??? ????) ?? ???????
    ?????? ??????? ?????
  • ????? ????? ????????? ?????? ?????? ?????? ?????

29
????? ?????? ??????? ?-Linux
  • ??? ???? ????, ??????? ???????? ??????? ?????
    ?????
  • ?? ????? ???? ?? ?????? ?????? ???? ???? ??????
  • ?????? ?? ?? ?????? ??????? ?????? ??????? ???
    ????? ????
  • ????? do_IRQ() (??? ?????? ????)
  • ???? ????? ??? ????? (kernel thread) ?????. ???
    ?? ?? ??????? ????? ??? ???? ????? ??????
    ???????? ????? ?? ?????? ??????? ??????
    ?-do_softirq()
  • ????? ???? ????? ??? ???? ?????? ??????? ???????
  • ?? ???? ksoftirqd_CPUn ???? ???? ???? n
  • ???? ????? ??? ?? ?? ????? ????? "ps ax"
  • ....

30
?????? ?????? ?????? ?????? (1)
  • ???? ??? ????? ???? ?????? ?????? ???? ?????
    ?????? ????? (????? ?? ?????) ?-Linux
  • ??? ????? ??????? ???? ????? ??? ????? ??????
  • ?? ??????? ?????? ????? ?? 32 ???, ???? ?????
    segment registers
  • ????? ?? ???? ?"???" ?? ?????? ?????? ????? ????
    ??? ???? ?????? ??? ??? ????? ????
  • ????? ??????? ????? ?"? ?????? RESTORE_ALL, ?????
    ???? ??? ????? ?? ?? ???? ????? ??? ??? ?????

31
????? ????? ????? ????? ????? ????? ???????
????? ??????? ?????? ?-User Mode (?? ?????? ????? ???????) ????? ??????? ?????? ?-User Mode (?? ?????? ????? ???????) ????? ??????? ?????? ?-User Mode (?? ?????? ????? ???????) ss
????? ??????? ?????? ?-User Mode (?? ?????? ????? ???????) ????? ??????? ?????? ?-User Mode (?? ?????? ????? ???????) ????? ??????? ?????? ?-User Mode (?? ?????? ????? ???????) esp
??? ?????? ?????? ??? ?????? ?????? ??? ?????? ?????? eflags
????? ???? ???? ?????? ????? ???? ???? ?????? ????? ???? ???? ?????? cs
????? ???? ???? ?????? ????? ???? ???? ?????? ????? ???? ???? ?????? eip
hardware error code (?? 0 ?? ???) ???? ? (-1) ???? ?????? ???? 256 ???? ????? ?????? orig_eax
???? ????????? ????? ?????? ??? ?????? ?"? ????? error_code ???? ????????? ????? ?????? ??? ?????? ?"? ?????? SAVE_ALL (???? ?????? ?????, ??? eax ???? ????? ?? ???? ??????) ???? ????????? ????? ?????? ??? ?????? ?"? ?????? SAVE_ALL (???? ?????? ?????, ??? eax ???? ????? ?? ???? ??????) es
???? ????????? ????? ?????? ??? ?????? ?"? ????? error_code ???? ????????? ????? ?????? ??? ?????? ?"? ?????? SAVE_ALL (???? ?????? ?????, ??? eax ???? ????? ?? ???? ??????) ???? ????????? ????? ?????? ??? ?????? ?"? ?????? SAVE_ALL (???? ?????? ?????, ??? eax ???? ????? ?? ???? ??????) ds
???? ????????? ????? ?????? ??? ?????? ?"? ????? error_code ???? ????????? ????? ?????? ??? ?????? ?"? ?????? SAVE_ALL (???? ?????? ?????, ??? eax ???? ????? ?? ???? ??????) ???? ????????? ????? ?????? ??? ?????? ?"? ?????? SAVE_ALL (???? ?????? ?????, ??? eax ???? ????? ?? ???? ??????) eax
???? ????????? ????? ?????? ??? ?????? ?"? ????? error_code ???? ????????? ????? ?????? ??? ?????? ?"? ?????? SAVE_ALL (???? ?????? ?????, ??? eax ???? ????? ?? ???? ??????) ???? ????????? ????? ?????? ??? ?????? ?"? ?????? SAVE_ALL (???? ?????? ?????, ??? eax ???? ????? ?? ???? ??????) ebp
???? ????????? ????? ?????? ??? ?????? ?"? ????? error_code ???? ????????? ????? ?????? ??? ?????? ?"? ?????? SAVE_ALL (???? ?????? ?????, ??? eax ???? ????? ?? ???? ??????) ???? ????????? ????? ?????? ??? ?????? ?"? ?????? SAVE_ALL (???? ?????? ?????, ??? eax ???? ????? ?? ???? ??????) edi
???? ????????? ????? ?????? ??? ?????? ?"? ????? error_code ???? ????????? ????? ?????? ??? ?????? ?"? ?????? SAVE_ALL (???? ?????? ?????, ??? eax ???? ????? ?? ???? ??????) ???? ????????? ????? ?????? ??? ?????? ?"? ?????? SAVE_ALL (???? ?????? ?????, ??? eax ???? ????? ?? ???? ??????) esi
???? ????????? ????? ?????? ??? ?????? ?"? ????? error_code ???? ????????? ????? ?????? ??? ?????? ?"? ?????? SAVE_ALL (???? ?????? ?????, ??? eax ???? ????? ?? ???? ??????) ???? ????????? ????? ?????? ??? ?????? ?"? ?????? SAVE_ALL (???? ?????? ?????, ??? eax ???? ????? ?? ???? ??????) edx
???? ????????? ????? ?????? ??? ?????? ?"? ????? error_code ???? ????????? ????? ?????? ??? ?????? ?"? ?????? SAVE_ALL (???? ?????? ?????, ??? eax ???? ????? ?? ???? ??????) ???? ????????? ????? ?????? ??? ?????? ?"? ?????? SAVE_ALL (???? ?????? ?????, ??? eax ???? ????? ?? ???? ??????) ecx
???? ????????? ????? ?????? ??? ?????? ?"? ????? error_code ???? ????????? ????? ?????? ??? ?????? ?"? ?????? SAVE_ALL (???? ?????? ?????, ??? eax ???? ????? ?? ???? ??????) ???? ????????? ????? ?????? ??? ?????? ?"? ?????? SAVE_ALL (???? ?????? ?????, ??? eax ???? ????? ?? ???? ??????) ebx
32
?????? ?????? ?????? ?????? (3)
  • ???? ????? ?? ??????? (????? ssesp, eflags
    ?-cseip) ???? ????? ??????? ?"? ?????
  • ssesp ???? ?? ?? ?????? ?????? ???? ??????
    ???????
  • ??? ??????? ??????? ??????? ???? ?????? ????
    ??????
  • ????? ???? ????? ????? orig_eax, ???? "??? ????"
    ????? ???? ??????? ??? ??? ??????, ?????? ?????
  • ?????? ?????? ????? ??????? ?????, ??????
    SAVE_ALL ???? ?? ???? ??? ?????????, ??? ??????
    ????? ??????
  • ?????? ??????, ?????? ????? ??? ???? ?????????
    ?"? ????? error_code

33
?????? ?????? ?????? ?????? (4)
  • ?????? RESTORE_ALL
  • popl ebx
  • ..
  • popl es
  • addl 4, esp
  • iret
  • ?? ???? ????? ?????? ????? ?????? ?????? ???????
    ???? ????? ?? ????? ??????, ?? ??? ?????? ???? ??
    ??????? ??????? ????? ???? ?????? ?-RESTORE_ALL
  • ???? ???? ????? ?????? ?????? ????? ??????
    ??????? ???, ?????? ?-C, ??????? ???????. ???????
    ??? ??????? ????? ?????? ??????? ???? ??????
    ?-RESTORE_ALL

????? ?????? ???? ????????? ????? ??????
????? orig_eax
????? ??? ??????? ?????
34
????? ???? ???? ????? ???????
  • ??????, ???? ?????? ?????? ????? ?????? ??? ????
    ????? ????
  • ????, ????? ?????? ???? ???? ?? ???? ??? ????
    ?????? ??????
  • ?? ???? ?????? ??? ????? ????? ??????? ?? ??????
    ???? ?????
  • ?-Linux ?? ???? ???? ????? ???? ???? ????? ??????
    ??????????
  • ????? ???, ?? ?????? ?? ????? ????? ???? ???????
    ????? ???? need_resched ????? ??????
  • ????? ?????? ??????, ???? ????? ?-User Mode,
    ?????? ?? ???? ?????? ????
  • ????? ????, ?? ?????? ?? ?????? ???? signal
    ?????? ?? ???? ????? ?-User Mode

35
???? ????? ??????? (1)
  • ??????? ?????? ??????, ?? ????? ????? ?? ????
    ????????? ????? ??????, ???? iret ?????? ??????
    ????? ??????? ?????? ??????
  • ???, ???? ??, ?? ???? ???? ??????
  • ??? ?????? ?????? ?? ??, ?? ?????? ?? ???????
    ????? ????????
  • ??? ???? ?????? ???? ?? ??, ?????? ?-schedule()
  • ??? ?? signals ??????? - ?? ???? ??? ?????
    (??????? do_signal())
  • ??? ???? ?????? ??? ?????? ???? ???
  • ?- ret_from_exception- ???? ???? ????? ??????
  • ?-ret_from_intr ???? ???? ????? ?????? ?????
  • ?-ret_from_sys_call ???? ???? ????? ??????
    ?????
  • ????? ???? ??? ?????? ?? ??????? ???????, ??? ??
    ?????? ?-RESTORE_ALL ?????, ?????? ?????? ???? ???

36
???? ????? ??????? (2)
ret_from_exception
ret_from_intr
ret_from_sys_call
????? ???????
??
??? ?? ???? ?????? ?????
schedule()
??
??
??
??? ?? signals ????????
??
RESTORE_ALL
do_signal()
??
Write a Comment
User Comments (0)
About PowerShow.com