How Initializes the system call vectors

The <#1812#> startup_32()<#1812#> code found in /usr/src/linux/boot/head.S starts everything off by calling <#1813#> setup_idt()<#1813#>. This routine sets up an IDT (Interrupt Descriptor Table) with 256 entries. No interrupt entry points are actually loaded by this routine, as that is done only after paging has been enabled and the kernel has been moved to 0xC0000000. An IDT has 256 entries, each 4 bytes long, for a total of 1024 bytes. When <#1814#> start_kernel()<#1814#> (found in /usr/src/linux/init/main.c) is called it invokes <#1815#> trap_init()<#1815#> (found in /usr/src/linux/kernel/traps.c). <#1816#> trap_init()<#1816#> sets up the IDT via the macro <#1817#> set_trap_gate()<#1817#> (found in /usr/include/asm/system.h). <#1818#> trap_init()<#1818#> initializes the interrupt descriptor table as shown in figure~#figintinit#1819>.

#figure1820#
Figure: Initialization of interrupts

At this point the interrupt vector for the system calls is not set up. It is initialized by <#1827#> sched_init()<#1827#> (found in /usr/src/linux/kernel/sched.c). A call to <#1828#> set_system_gate (0x80, &system_call)<#1828#> sets interrupt 0x80 to be a vector to the <#1829#> system_call()<#1829#> entry point.