qemu crashes when asm is called
Posted: Fri Jan 11, 2019 9:45 am
Sorry if I'm in the wrong sub section, I'm new.
I was just following the steps on this OS-Tutorial but I encountered into a problem, calling the assembly function in C like crashes qemu for some reason. Can anyone tell me how to fix this?
Tutorial I was following:
https://github.com/cfenollosa/os-tutori ... upts-timer
Error from qemu:
qemu-system-i386 -d guest_errors -fda Ranedeer.bin:
I was just following the steps on this OS-Tutorial but I encountered into a problem, calling the assembly function in C like
Code: Select all
asm volatile("sti")
Tutorial I was following:
https://github.com/cfenollosa/os-tutori ... upts-timer
Error from qemu:
Code: Select all
qemu-system-i386: Trying to execute code outside RAM or ROM at 0x6a006afa
This usually means one of the following happened:
(1) You told QEMU to execute a kernel for the wrong machine type, and it crashed on startup (eg trying to run a raspberry pi kernel on a versatilepb QEMU machine)
(2) You didn't give QEMU a kernel or BIOS filename at all, and QEMU executed a ROM full of no-op instructions until it fell off the end
(3) Your guest kernel has a bug and crashed by jumping off into nowhere
This is almost always one of the first two, so check your command line and that you are using the right type of kernel for this machine.
If you think option (3) is likely then you can try debugging your guest with the -d debug options; in particular -d guest_errors will cause the log to include a dump of the guest register state at this point.
Execution cannot continue; stopping here.
make: *** [makefile:26: run] Error 1
Code: Select all
qemu: fatal: Trying to execute code outside RAM or ROM at 0x6a006afa
EAX=00000034 EBX=00000000 ECX=000027e6 EDX=00000040
ESI=00000000 EDI=00000000 EBP=0008ffd0 ESP=0008ff9c
EIP=6a006afa EFL=00000057 [---ZAPC] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
CS =0008 00000000 ffffffff 00cf9a00 DPL=0 CS32 [-R-]
SS =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
DS =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
FS =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
GS =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
LDT=0000 00000000 0000ffff 00008200 DPL=0 LDT
TR =0000 00000000 0000ffff 00008b00 DPL=0 TSS32-busy
GDT= 00007ccd 00000017
IDT= 00000000 000007ff
CR0=00000011 CR2=00000000 CR3=00000000 CR4=00000000
DR0=00000000 DR1=00000000 DR2=00000000 DR3=00000000
DR6=ffff0ff0 DR7=00000400
CCS=ffffdf41 CCD=00000000 CCO=ADDL
EFER=0000000000000000
FCW=037f FSW=0000 [ST=0] FTW=00 MXCSR=00001f80
FPR0=0000000000000000 0000 FPR1=0000000000000000 0000
FPR2=0000000000000000 0000 FPR3=0000000000000000 0000
FPR4=0000000000000000 0000 FPR5=0000000000000000 0000
FPR6=0000000000000000 0000 FPR7=0000000000000000 0000
XMM00=00000000000000000000000000000000 XMM01=00000000000000000000000000000000
XMM02=00000000000000000000000000000000 XMM03=00000000000000000000000000000000
XMM04=00000000000000000000000000000000 XMM05=00000000000000000000000000000000
XMM06=00000000000000000000000000000000 XMM07=00000000000000000000000000000000