On Thu, Jan 24, 2008 at 06:20:07AM -0800, walt wrote:
> >Do you want to work on a loader for BSD?  That would be the ideal
> >solution and a nice opportunity for you to learn :-)
> 
> Sure, but don't expect very much :o)  We know that grub legacy can
> boot NetBSD, so maybe I can get grub2 to do the same.  Debugging
> a free-standing program like grub is something I've never tried.
> How would you approach the problem if you were going to do it
> yourself?

I was afraid too, but if you're used to debugging normal programs it's not
so difficult.  GRUB is just like a big, single-threaded C program really.

I usually just turn on debugging output to grasp where things start to go
ill, and add lots printfs to figure out what lines of code are reached,
at which point a value is corrupted, etc.

When I reach a cpu fault, I tend to put a "while (1);" loop someplace and
start moving it forward till I find the last point where runtime is still
"sane".

Also, if you're familiar with an emulator that supports debugging (I think
both qemu and bochs do), you can use that (but without direct debugging symbol
support, of course).

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call… if you are unable to speak?
(as seen on /.)


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to