Debugging and (U)EFI.

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
Roman
Member
Member
Posts: 568
Joined: Thu Mar 27, 2014 3:57 am
Location: Moscow, Russia
Contact:

Debugging and (U)EFI.

Post by Roman »

Hello, everyone. Some time passed since I asked for help here last time.

I'm developing a microkernel and also rolling my own EFI loader. The kernel is loaded perfectly, paging is initialized, but I'm having a problem with interrupts. Unfortunately, QEMU is not very informative about triple faults. I remember that Bochs produces good information, but it doesn't seem to be able to work with EFI. Is there any emulator/VM that both supports EFI and produces good debugging information?
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
- Alan Kay
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Debugging and (U)EFI.

Post by iansjack »

What's the problem with qemu/gdb, or even qemu with the built-in debugger?
User avatar
Roman
Member
Member
Posts: 568
Joined: Thu Mar 27, 2014 3:57 am
Location: Moscow, Russia
Contact:

Re: Debugging and (U)EFI.

Post by Roman »

iansjack wrote:What's the problem with qemu/gdb, or even qemu with the built-in debugger?
I would like to know the exact reason of the fault (e. g. like Bochs reports).
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
- Alan Kay
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Re: Debugging and (U)EFI.

Post by jnc100 »

VirtualBox supports UEFI and has a built in debugger which can be used for interrogating the idt for example. There is rudimentary support for dumping the nature of an exception and the registers at the time to the crash log (normally located in the VM directory) however if you want to fully investigate the nature of the faults you will need to install your own exception handlers.

Regards,
John.
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Debugging and (U)EFI.

Post by iansjack »

qemu also has a built in debugger/monitor and allows you to write debug logs. If this is not enough then when used in conjunction with gdb you ought to be able to find out any information that you need to about a triple-fault.
User avatar
Roman
Member
Member
Posts: 568
Joined: Thu Mar 27, 2014 3:57 am
Location: Moscow, Russia
Contact:

Re: Debugging and (U)EFI.

Post by Roman »

I've written a multiboot-compliant loader for my kernel and tested it with Bochs. Now I get this:

Code: Select all

interrupt(long mode): IDT entry extended attributes DWORD4 TYPE != 0
The fourth double word is zero. My IDTR's offset points to the virtual address of the IDT. What am I missing? Should I show some code?

EDIT: Nevermind, I've made a stupid mistake. Now everything works! Thanks for the suggestions anyway.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
- Alan Kay
Post Reply