00001 
00002 
00003 
00004 
00005 
00006         .globl  ap_trampoline_start,ap_trampoline_end
00007         .text
00008         .code16
00009 ap_trampoline_start:
00010         cli
00011         cld
00012 
00013         movw    %cs,%ax         
00014         movw    %ax,%ds
00015         movw    %ax,%es
00016         movw    %ax,%ss
00017 
00018         
00019         mov     $0x31,%al 
00020         mov     $0xe9,%dx
00021         outb    %al,%dx
00022         
00023         lgdt    ap_trampoline_gdt_limit - ap_trampoline_start
00024         movl    %cr0,%eax
00025         orl     $0x1,%eax
00026         movl    %eax,%cr0       
00027 
00028 .code32
00029         .byte 0x66
00030         ljmp    $0x08,$(ap_trampoline_32 - ap_trampoline_start)         
00031 
00032 ap_trampoline_32:
00033         mov     $0x32,%al 
00034         mov     $0xe9,%dx
00035         outb    %al,%dx
00036 
00037         mov     $0x10,%ax
00038         mov     %ax,%ds
00039         mov     %ax,%es
00040         mov     %ax,%fs
00041         mov     %ax,%gs
00042         mov     %ax,%ss
00043 
00044         
00045         mov     ap_trampoline_spl - ap_trampoline_start,%edi
00046 ap_spl:
00047         
00048         
00049 
00050         mov     $1,%eax      
00051         xchgl   (%edi),%eax
00052         cmp     $0,%eax
00053         je      ap_spl
00054         
00055 
00056         mov     $0x30,%al 
00057         mov     $0xe9,%dx
00058         outb    %al,%dx
00059                 
00060         mov     ap_trampoline_stackptr - ap_trampoline_start,%ebx
00061         mov     %ebx,%esp
00062         add     $0x1000,%ebx
00063         mov     %ebx,ap_trampoline_stackptr - ap_trampoline_start
00064 
00065         mov     $0x31,%al 
00066         mov     $0xe9,%dx
00067         outb    %al,%dx
00068 
00069         
00070         mov     $0,%eax
00071         mov     ap_trampoline_spl - ap_trampoline_start,%edi
00072         xchgl   (%edi),%eax
00073         
00074 
00075         mov     $0x33,%al 
00076         mov     $0xe9,%dx
00077         outb    %al,%dx
00078 
00079         mov     ap_trampoline_epoint,%eax
00080         call    *%eax
00081 1:
00082         hlt
00083         jmp     1b              
00084 
00085         
00086 ap_trampoline_stackptr:
00087         .long   0x10000         
00088 ap_trampoline_epoint:
00089         .long   c_ap_boot
00090 
00091 ap_trampoline_spl:
00092         .long   0
00093 ap_gdt:
00094         .long ubixGDT
00095         
00096         
00097 ap_trampoline_gdt:
00098         .word   0
00099 ap_trampoline_gdt_limit:
00100         .word   128     
00101 ap_trampoline_gdt_base:
00102         .long   0x20000         
00103 
00104 
00105 ap_trampoline_end: