From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <42596403.2020508@zappe.us> Date: Sun, 10 Apr 2005 11:36:03 -0600 From: Michael Zappe User-Agent: Mozilla Thunderbird 1.0.2-1.3.2 (X11/20050324) MIME-Version: 1.0 To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] Small bits of progress on SIMpad, couple of ARM questions References: <20050410130007.GC97206@smp500.sitetronics.com> In-Reply-To: <20050410130007.GC97206@smp500.sitetronics.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: 35684e72-ead0-11e9-9d60-3106f5b1d025 Well, I just did the same thing for OpenBSD on IXP (XScale core), and here are some of the issues you may want to look at. It seems there's an errata with the XScale core that causes self-modifying code (including linkers and loaders) not to work if write coalescing is disabled in CP15. Check to make sure that it is enabled in register 0. Also, make sure that the cache flush you are calling invalidates the I-cache after flushing the D-cache. One other thing to try to make sure that it's a cache issue (what it sounds like), is to try running it with caches disabled on startup. If you need any more help, feel free to contact me! Mike Devon H. O'Dell wrote: >Hey, > >I'm hoping there's someone here who knows a bit more about ARM >than I do. I've grabbed the ARM specification and the docs on the >SA-1110 from Intel, and these are a real big help with learning >how the code works. > >I've got the decompressor to inflate the kernel, but I'm having >trouble getting it to jump to the kernel afterwards. From what >I can tell is happening: > > o After compiling, the image I send looks like: > +---------+ > | inflate | } 20KB, text of _start at 0xc0200010 > +---------+ > | | ) > | kernel | > ~420KB, text of _start at 0xc0008010 > | | ) > +---------+ > > o I generate a boot header and put it in flash, telling the > loader to load this to 0xc0008000 and enter at 0xc0008010. > > o Since inflate is in front of the kernel, and it has the > kernel magic, the bootloader sees that at 0xc0008010 and > jumps into it. > > o inflate knows it's at the wrong place, so it relocates > itself to 0xc0200000 and jumps to the relocated address which > calls the main() in imain.c > > o this gunzips the kernel from 0xc0200000 + 20*1024 to > 0xc0008000. > > o Kernel's _start is at 0xc0008010 (I'm assuming the extra 16 > bytes are the a.out header for all these things?). This is > assigned to ``f'' > > o cache is drained, (*f)() is called. > >I've placed various debugging prints around, and it turns out >that I _cannot_ get the thing to jump there. Reading the docs on >the processor, there shouldn't be any differences between bitsy >and my SIMpad at this point. When the jump should occur, the >unit powers off after a short delay, and I have verified with >prints that it never actually reaches _start in >/sys/src/9/bitsy/l.s > >So I'm curious what's happening. Perhaps the MMU is turned on >somehow and I'm accessing an illegal offset, which causes a >memory fault to be generated, but since there's no handler, the >unit powers itself down? This is all I can think of at the >moment. > >I've been reading the Linux source, and Walter Schweizer from >Siemens has been quite helpful at pointing me to to relevant >sections of Linux (which are surprisingly similar, when I'm able >to identify matching code). Are there any bitsy / ARM gurus who >might be able to give me some tips on what might be going wrong >at this early stage? If I can get past this, it should be >comparatively trivial to get it running further :) > >Kind regards, > >Devon H. O'Dell > >