Linux: where is the “real” segmentation error handler?

If I read / write / go to the ummapped address, i.e.

.text
    .global _start
_start:
     movl   $1,%edx
     jmp     *%edx

this causes a segmentation error.

I wonder what is the actual part of the system (kernel) that intercepts read / write to non-displayable addresses (how?) And emits a "user mode" signal?

+3
source share
3 answers

Everything comes from a table of architecture traps. This is usually called entry.S (divided by x86 between entry_32 and entry_64.S) and has an assembler binding that performs a series of actions (depending on the configuration) before the header in the C code of the kernel itself.

, page_fault general_protection , , force_sig_info, , , send_signal (kernel/signal.c).

+4

. , x86 :

do_page_fault: linux/arch/x86/mm/fault.c  
0

PowerPC, " E" (, ), 0x300 ( ) 0x400 ( .) / , MMU , CPU 0x300 0x400, .

0

Source: https://habr.com/ru/post/1711157/


All Articles