3 * Trampoline.S Derived from Setup.S by Linus Torvalds
5 * 4 Jan 1997 Michael Chastain: changed to gnu as.
7 * Entry: CS:IP point to the start of our code, we are
8 * in real mode with no stack, but the rest of the
9 * trampoline page to make our stack and everything else
12 * In fact we don't actually need a stack so we don't
15 * We jump into the boot/compressed/head.S code. So you'd
16 * better be running a compressed kernel image or you
19 * On entry to trampoline_data, the processor is in real mode
20 * with 16-bit addressing and 16-bit data. CS has some value
21 * and IP is zero. Thus, data addresses need to be absolute
22 * (no relocation) and are taken with regard to r_base.
24 * If you work on this file, check the object module with objdump
25 * --full-contents --reloc to make sure there are no relocation
26 * entries except for the gdt one..
29 #include <linux/linkage.h>
30 #include <asm/segment.h>
37 ENTRY(trampoline_data)
40 mov %cs, %ax # Code and data in the same place
43 mov $1, %bx # Flag an SMP trampoline
44 cli # We should be safe anyway
46 movl $0xA5A5A5A5, trampoline_data - r_base
47 # write marker for master knows we're running
49 lidt idt_48 - r_base # load idt with 0, 0
50 lgdt gdt_48 - r_base # load gdt with whatever is appropriate
53 inc %ax # protected mode (PE) bit
54 lmsw %ax # into protected mode
57 ljmpl $__KERNEL_CS, $0x00100000
58 # jump to startup_32 in arch/i386/kernel/head.S
61 .word 0 # idt limit = 0
62 .word 0, 0 # idt base = 0L
65 .word 0x0800 # gdt limit = 2048, 256 GDT entries
66 .long gdt_table-__PAGE_OFFSET # gdt base = gdt (first SMP CPU)
68 .globl SYMBOL_NAME(trampoline_end)
69 SYMBOL_NAME_LABEL(trampoline_end)