[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More on oskit-mach debugging

From: Jeroen Dekkers
Subject: Re: More on oskit-mach debugging
Date: Fri, 13 Jul 2001 17:29:59 +0200
User-agent: Mutt/1.3.18i

On Fri, Jul 13, 2001 at 09:21:57AM -0400, Igor Khavkine wrote:
> Now if I was still linking with the version of oskit in the Hurd archives
> all my problems would be solved and I would be able to boot properly.
> However, I have compiled my own version of OSKit to get debigging
> symbols. Now I get a SIGSEVG during initialization in the OSKit
> function `oskit_linux_dev_init () at [oskit]/linux/dev/init.c:81',
> on line:
> 129             x = *((unsigned *)(kaddr + 0x104));
> Here `kaddr' has value 0x0 and the calculated address 0x104 is not
> accessibl, hence the SIGSEGV. Lets see how `kaddr' gets its
> value:
> 127     if (osenv_mem_map_phys(0, PAGE_SIZE, &kaddr, 0))
> 128             panic("%s:%d: unable to map phys memory", __FILE__, __LINE__);
> Once all the functions are followed through and all macros expanded,
> the result comes down to the following:
> kaddr = phystokv(0) = 0 + phys_mem_va
> And at the moment the value of phys_mem_va is also 0x0, hence `kaddr = 0x0'.
> My question is, when during oskit-mach's initialization does the paging
> turn on, and why isn't phys_mem_va set to the correct value?

There was my previous trap.c patch about (see that mail for the patch). First
I thought the same thing as you, but in gnumach and the example kernels
phys_mem_va is also set to 0. 

When I looked further, I ended in the page fault handling code. If 
trunc_page(subcode) == 0, the kernel panics. After macro expansion that means 
if subcode (the value of the address) is smaller than the page size, 
trunc_page(subcode) is 0 and thus gives a panic.

Because 0x104 is smaller than PAGE_SIZE (0xfff iirc), the kernel page faults.
I just removed the check and everythings works ok. Well, oskit-mach still 
doesn't work, but I get the same as with the debian packges. The fact that
this problem only occurs when you built the oskit yourself is that with the
debian package oskit_linux_dev_init is never called afaik, I don't know why.

I'm almost finished hacking remote debugging support with ethernet. If it
works I will post it here, but it's only a dirty hack. Anyway you can also
contact me on #hurd at openprojects, my nickname is F399.

Jeroen Dekkers

reply via email to

[Prev in Thread] Current Thread [Next in Thread]