File tree 1 file changed +11
-5
lines changed
1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -298,7 +298,13 @@ impl<'a> PreparedEntry<'a> {
298
298
"cli" ,
299
299
// virtual 8086 mode can't be set, as we're 32 or 64 bit code
300
300
// (and changing that flag is rather difficult)
301
-
301
+
302
+ // Writing to RBX (and thus EBX) using in("ebx") is forbidden,
303
+ // since this register is used internally by LLVM.
304
+ // Thus, we need to write the mulitboot information address to EAX
305
+ // and copy it into EBX here.
306
+ "mov ebx, eax" ,
307
+
302
308
// > ‘CR0’ Bit 31 (PG) must be cleared. Bit 0 (PE) must be set.
303
309
// > Other bits are all undefined.
304
310
"mov ecx, cr0" ,
@@ -315,7 +321,7 @@ impl<'a> PreparedEntry<'a> {
315
321
"mov cr4, ecx" ,
316
322
317
323
// TODO: Only do this on x86_64?
318
- // x86_64: switch from compatiblity mode to protected mode
324
+ // x86_64: switch from compatibility mode to protected mode
319
325
// get the EFER
320
326
"mov ecx, 0xC0000080" ,
321
327
"rdmsr" ,
@@ -326,11 +332,11 @@ impl<'a> PreparedEntry<'a> {
326
332
// write the signature to EAX
327
333
"mov eax, {}" ,
328
334
// finally jump to the kernel
329
- "jmp esi " ,
335
+ "jmp edi " ,
330
336
331
337
const SIGNATURE_EAX ,
332
- in( "ebx " ) & self . multiboot_information,
333
- in( "esi " ) entry_address,
338
+ in( "eax " ) & self . multiboot_information,
339
+ in( "edi " ) entry_address,
334
340
options( noreturn) ,
335
341
) ;
336
342
}
You can’t perform that action at this time.
0 commit comments