From: David M. <da...@sn...> - 2003-01-06 01:28:38
|
Jivin Paul Mundt lays it down ... > Hi, > > Running into a bit of weirdness, and was curious if anyone had seen this > before. > > I'm presently running on an SH-4, with the MMU implicitly turned off > (and CONFIG_MMU unset). I've taken care of dealing with paging_init() > changes, tlb ops, etc. to deal with the lack of an MMU, and none of that > appears to be an issue. > > My current problem is that the minute init tries to start, I get endless > unaligned userspace access traps. If I implicitly flush the cache prior > to turning the MMU off, I don't have this problem, instead it runs into > a sort of livelock situation where init just hangs .. though I'm still > able to ping the target. Flushing the tlb prior to turning the MMU off > for added sanity doesn't seem to make a difference one way or the other. > > Also, flushing the cache at context switch time (to work around > potential aliasing issues, SH is VIPT) doesn't seem to make a difference > here either. I haven't tried running uncached yet, though I doubt that's > an issue here. > > Anyone seen this kind of behavior before? Suggestions? I suspect that you are still running ELF programs. When you turn off the MMU support in the kernel, the rules for applications change a little. They cannot be paged in for example, and they have to be loaded (and relocated) at run time. Normal elf programs are loaded at a fixed addresses and this cannot work without an MMU. The uClinux guys use a program called elf2flt (ELF to flat) to make flat binaries that can be run without an MMU. You can find it at: http://cvs.uclinux.org/cgi-bin/cvsweb/elf2flt/ I don't believe there is SH support in it at the moment, but it isn't a huge amount of work. Generally only a few relocation types need to be handled, Cheers, Davidm -- David McCullough: Ph: +61 7 3435 2815 http://www.SnapGear.com da...@sn... Fx: +61 7 3891 3630 Custom Embedded Solutions + Security |