|
@@ -188,17 +188,52 @@ setup_code:
|
188
|
188
|
We're now at the beginning of the kernel proper.
|
189
|
189
|
*/
|
190
|
190
|
run_ipxe:
|
191
|
|
- /* Set up stack just below 0x7c00 */
|
|
191
|
+ /* Set up stack just below 0x7c00 and clear direction flag */
|
192
|
192
|
xorw %ax, %ax
|
193
|
193
|
movw %ax, %ss
|
194
|
194
|
movw $0x7c00, %sp
|
|
195
|
+ cld
|
195
|
196
|
|
196
|
197
|
/* Retrieve command-line pointer */
|
197
|
|
- movl %es:cmd_line_ptr, %edx
|
|
198
|
+ movl %ds:cmd_line_ptr, %edx
|
|
199
|
+ testl %edx, %edx
|
|
200
|
+ jz no_cmd_line
|
|
201
|
+
|
|
202
|
+ /* Set up %es:%di to point to command line */
|
|
203
|
+ movl %edx, %edi
|
|
204
|
+ andl $0xf, %edi
|
|
205
|
+ rorl $4, %edx
|
|
206
|
+ movw %dx, %es
|
|
207
|
+
|
|
208
|
+ /* Find length of command line */
|
|
209
|
+ pushw %di
|
|
210
|
+ movw $0xffff, %cx
|
|
211
|
+ repnz scasb
|
|
212
|
+ notw %cx
|
|
213
|
+ popw %si
|
|
214
|
+
|
|
215
|
+ /* Make space for command line on stack */
|
|
216
|
+ movw %sp, %di
|
|
217
|
+ subw %cx, %di
|
|
218
|
+ andw $~0xf, %di
|
|
219
|
+ movw %di, %sp
|
|
220
|
+
|
|
221
|
+ /* Copy command line to stack */
|
|
222
|
+ pushw %ds
|
|
223
|
+ pushw %es
|
|
224
|
+ popw %ds
|
|
225
|
+ pushw %ss
|
|
226
|
+ popw %es
|
|
227
|
+ rep movsb
|
|
228
|
+ popw %ds
|
|
229
|
+
|
|
230
|
+ /* Store new command-line pointer */
|
|
231
|
+ movzwl %sp, %edx
|
|
232
|
+no_cmd_line:
|
198
|
233
|
|
199
|
234
|
/* Retrieve initrd pointer and size */
|
200
|
|
- movl %es:ramdisk_image, %ebp
|
201
|
|
- movl %es:ramdisk_size, %ecx
|
|
235
|
+ movl %ds:ramdisk_image, %ebp
|
|
236
|
+ movl %ds:ramdisk_size, %ecx
|
202
|
237
|
|
203
|
238
|
/* Install iPXE */
|
204
|
239
|
call alloc_basemem
|