GAS LISTING /tmp/ccoOyDM1.s page 1 1 # 1 "/var/www/html/boot/syslinux/memdisk/start32.S" 1 /* ----------------------------------------------------------------------- 1 ... 0 0 2 * 3 * Copyright 2003-2009 H. Peter Anvin - All Rights Reserved 4 * Copyright 2009 Intel Corporation; author: H. Peter Anvin 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 9 * Boston MA 02110-1301, USA; either version 2 of the License, or 10 * (at your option) any later version; incorporated herein by reference. 11 * 12 * ----------------------------------------------------------------------- */ 13 14 /* 15 * Simple stub to get us to the right point in the 32-bit code; 16 * this module must be linked first 17 */ 18 19 .section ".init", "ax" 20 .globl _start 21 _start: 22 /* Zero the bss */ 23 0000 FC cld 24 0001 BF000000 movl $__bss_start, %edi 24 00 25 0006 B9000000 movl $__bss_end, %ecx 25 00 26 000b 29F9 subl %edi, %ecx 27 000d 31C0 xorl %eax, %eax 28 000f C1E902 shrl $2, %ecx 29 0012 F3AB rep ; stosl 30 31 /* Set up the protected-mode IDT and the interrupt jump buffers */ 32 0014 BF000000 movl $idt, %edi 32 00 33 0019 B8000800 movl $ijb, %eax 33 00 34 001e BB000000 movl $0xee000000, %ebx /* Interrupt gate */ 34 EE 35 0023 668CCB movw %cs, %bx /* Target segment */ 36 37 /* Make the IDT */ 38 0026 B9000100 movl $256, %ecx 38 00 39 1: 40 002b AB stosl 41 002c AB stosl 42 002d 895FFA movl %ebx, -6(%edi) 43 0030 83C008 addl $8, %eax 44 0033 E2F6 loop 1b 45 46 /* 47 * Each entry in the interrupt jump buffer contains the following GAS LISTING /tmp/ccoOyDM1.s page 2 48 * instructions: 49 * 50 * 60 pushal 51 * b0xx movb $xx, %al # interrupt number 52 * e9xxxxxxxx jmp handle_interrupt 53 */ 54 0035 B860B000 movl $0xe900b060, %eax 54 E9 55 003a B9000100 movl $256, %ecx 55 00 56 1: 57 003f 8907 movl %eax, (%edi) 58 0041 05000001 addl $(1 << 16), %eax 58 00 59 0046 BAFEFFFF movl $handle_interrupt-8, %edx 59 FF 60 004b 29FA subl %edi, %edx 61 004d 895704 movl %edx, 4(%edi) 62 0050 83C708 addl $8, %edi 63 0053 E2EA loop 1b 64 65 #if __SIZEOF_POINTER__ == 4 66 0055 0F011D00 lidtl idt_ptr 66 000000 67 #elif __SIZEOF_POINTER__ == 8 68 lidt idt_ptr 69 #else 70 #error "unsupported architecture" 71 #endif 72 73 /* Save arguments, switch stacks */ 74 005c 89E0 movl %esp, %eax /* Pointer to arguments */ 75 005e BC001001 movl $__stack_end, %esp 75 00 76 77 0063 E8FCFFFF call setup 77 FF 78 0068 FF250000 jmp *(rm_args) /* First argument is return */ 78 0000 79 80 .section ".text","ax" 81 .globl intcall 82 .type intcall, @function 83 intcall: 84 0000 FF250400 jmp *(rm_args+1*4) /* Intcall is argument 1 */ 84 0000 85 .size intcall, .-intcall 86 87 .type handle_interrupt, @function 88 handle_interrupt: 89 0006 FF251000 jmp *(rm_args+4*4) /* Interrupt pointer is argument 4 */ 89 0000 90 .size handle_interrupt, .-handle_interrupt 91 92 .section ".rodata","a" 93 idt_ptr: 94 0000 FF07 .word 8*256-1 GAS LISTING /tmp/ccoOyDM1.s page 3 95 0002 00000000 .long idt 96 0006 0000 .word 0 97 98 .section ".bss.large","aw" 99 .balign 2048 100 idt: 101 0000 00000000 .space 8*256 101 00000000 101 00000000 101 00000000 101 00000000 102 ijb: 103 0800 00000000 .space 8*256 103 00000000 103 00000000 103 00000000 103 00000000 104 105 __stack: 106 1000 00000000 .space 65536 106 00000000 106 00000000 106 00000000 106 00000000 107 __stack_end: GAS LISTING /tmp/ccoOyDM1.s page 4 DEFINED SYMBOLS /var/www/html/boot/syslinux/memdisk/start32.S:21 .init:0000000000000000 _start /var/www/html/boot/syslinux/memdisk/start32.S:100 .bss.large:0000000000000000 idt /var/www/html/boot/syslinux/memdisk/start32.S:102 .bss.large:0000000000000800 ijb /var/www/html/boot/syslinux/memdisk/start32.S:88 .text:0000000000000006 handle_interrupt /var/www/html/boot/syslinux/memdisk/start32.S:93 .rodata:0000000000000000 idt_ptr /var/www/html/boot/syslinux/memdisk/start32.S:107 .bss.large:0000000000011000 __stack_end /var/www/html/boot/syslinux/memdisk/start32.S:83 .text:0000000000000000 intcall /var/www/html/boot/syslinux/memdisk/start32.S:105 .bss.large:0000000000001000 __stack UNDEFINED SYMBOLS __bss_start __bss_end setup rm_args