1 FILE_LICENCE ( GPL_ANY )
3 #define BZI_LOAD_HIGH_ADDR 0x100000
8 .section ".prefix", "ax", @progbits
12 /*****************************************************************************
16 * We place our prefix (i.e. our .prefix and .text16.early sections)
17 * within the bzImage real-mode portion which gets loaded at
18 * 1000:0000, and our payload (i.e. everything else) within the
19 * bzImage protected-mode portion which gets loaded at 0x100000
26 .byte -1 /* Allow for initial "boot sector" */
27 .section ".zinfo.fixup", "a", @progbits /* Compressor fixups */
37 .section ".zinfo.fixup", "a", @progbits /* Compressor fixups */
52 /* Manually specify a two-byte jmp instruction here rather
53 * than leaving it up to the assembler.
55 .byte 0xeb, ( setup - header )
57 .byte 'H', 'd', 'r', 'S'
59 .word 0x0207 /* 2.07 */
65 .word version_string - 0x200
69 .byte 0x01 /* LOADED_HIGH */
102 hardware_subarch_data:
103 .byte 0, 0, 0, 0, 0, 0, 0, 0
108 /*****************************************************************************
115 /* Fix up code segment */
120 /* Set up stack just below 0x7c00 and clear direction flag */
126 /* Retrieve command-line pointer */
127 movl cmd_line_ptr, %edx
131 /* Set up %es:%di to point to command line */
137 /* Find length of command line */
144 /* Make space for command line on stack */
150 /* Copy command line to stack */
159 /* Store new command-line pointer */
163 /* Calculate maximum relocation address */
164 movl ramdisk_image, %ebp
167 orl $0xffffffff, %ebp /* Allow arbitrary relocation if no initrd */
173 call install_prealloc
175 /* Set up real-mode stack */
179 /* Jump to .text16 segment */
183 .section ".text16", "awx", @progbits
185 /* Retrieve initrd pointer and size */
186 movl ramdisk_image, %ebp
187 movl ramdisk_size, %ecx
189 /* Set up %ds for access to .data16 */
192 /* Store command-line pointer */
193 movl %edx, cmdline_phys
195 /* Store initrd pointer and size */
196 movl %ebp, initrd_phys
197 movl %ecx, initrd_len
203 popl %ecx /* discard */
208 /* Boot next device */
211 /*****************************************************************************
213 * Open payload (called by libprefix)
217 * %esi : Buffer for copy of image source (or zero if no buffer available)
218 * %ecx : Expected offset within buffer of first payload block
220 * %esi : Valid image source address (buffered or unbuffered)
221 * %ecx : Actual offset within buffer of first payload block
225 .section ".text16.early", "awx", @progbits
229 /* Our payload will always end up at BZI_LOAD_HIGH_ADDR */
230 movl $BZI_LOAD_HIGH_ADDR, %esi
234 /* Payload must be aligned to a whole number of setup sectors */
235 .globl _payload_align
236 .equ _payload_align, 512