<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6454200798774615510</id><updated>2011-07-07T17:31:31.338-07:00</updated><title type='text'>FreeBSD + PPC = GSoC 2008</title><subtitle type='html'>A blog on porting FreeBSD to PPC based board called Efika during the Google Summer of Code 2008</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://bitbay.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6454200798774615510/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://bitbay.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>vi0</name><uri>http://www.blogger.com/profile/03338074674997819446</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6454200798774615510.post-1927406150653199395</id><published>2008-11-02T12:48:00.000-08:00</published><updated>2008-11-02T12:52:20.645-08:00</updated><title type='text'>Temporary halt</title><content type='html'>I'm presently involved in creating Europen Games Academy, and thus I'm forced to stop the work on the Efika port. I plan to come back to the project later, yet in the middle I'm planning to use FreeBSD in the development of a new kind of computer games related device... I'll try to put some details as the project develop...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6454200798774615510-1927406150653199395?l=bitbay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bitbay.blogspot.com/feeds/1927406150653199395/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6454200798774615510&amp;postID=1927406150653199395' title='34 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6454200798774615510/posts/default/1927406150653199395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6454200798774615510/posts/default/1927406150653199395'/><link rel='alternate' type='text/html' href='http://bitbay.blogspot.com/2008/11/temporary-halt.html' title='Temporary halt'/><author><name>vi0</name><uri>http://www.blogger.com/profile/03338074674997819446</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>34</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6454200798774615510.post-7149258791134369184</id><published>2008-09-08T13:09:00.000-07:00</published><updated>2008-09-08T13:23:41.839-07:00</updated><title type='text'>also</title><content type='html'>I'm preparing a diagram of our dev tree, showing the PIC location relative to PCI, root/nexus and others. Also, while filling out the final eval, an idea came to me to write a tutorial on using p4 in cumbersome situations, like having to fix broken local copy of branch etc... I had some problems with p4 and it's possible that future GSoCers will encounter them too, while the p4 part of the handbook is not helping much with those (of course one can always say RTFM..:)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6454200798774615510-7149258791134369184?l=bitbay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bitbay.blogspot.com/feeds/7149258791134369184/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6454200798774615510&amp;postID=7149258791134369184' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6454200798774615510/posts/default/7149258791134369184'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6454200798774615510/posts/default/7149258791134369184'/><link rel='alternate' type='text/html' href='http://bitbay.blogspot.com/2008/09/also.html' title='also'/><author><name>vi0</name><uri>http://www.blogger.com/profile/03338074674997819446</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6454200798774615510.post-4018274936722865858</id><published>2008-09-08T12:42:00.000-07:00</published><updated>2008-09-08T13:09:01.084-07:00</updated><title type='text'></title><content type='html'>Not much happened recently due to the exam I had to pass. What we did was thinking out the device structure using the ofwbus bus. The aim is to place the PIC driver in a suitable place so the rest of the dev tree can be constructed. Now is the time to read the PIC programming part of the MPC5200B UG... &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6454200798774615510-4018274936722865858?l=bitbay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bitbay.blogspot.com/feeds/4018274936722865858/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6454200798774615510&amp;postID=4018274936722865858' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6454200798774615510/posts/default/4018274936722865858'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6454200798774615510/posts/default/4018274936722865858'/><link rel='alternate' type='text/html' href='http://bitbay.blogspot.com/2008/09/not-much-happened-recently-due-to-exam.html' title=''/><author><name>vi0</name><uri>http://www.blogger.com/profile/03338074674997819446</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6454200798774615510.post-2173663107224743977</id><published>2008-08-27T06:01:00.000-07:00</published><updated>2008-08-27T06:08:18.542-07:00</updated><title type='text'>WANTED: PIC driver...</title><content type='html'>Finally, I've managed to fix all (at least up till now..) broken OF calls, and the kernel went further, to the place where devices are attached. Among them, there should be a PIC driver, which is missing... After adding the ofwbus driver which I got from Andrew, I've constructed a PIC driver skeleton from the sys/powerpc/powermac/hrowpic.c. The PIC was found to resist on the ofwbus3, and the attch method fails to allocate memory (nice screenshot on my wiki http://wiki.freebsd.org/Porting_FreeBSD_to_Efika_(PPC_bring_up)). Now I have to mutate the old mac driver to obey the mpc5k2 will... I've also created a new folder in the p4 branch, where all the stuff concerning MPC5200B will be stored. It's called ... mpc5k2 :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6454200798774615510-2173663107224743977?l=bitbay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bitbay.blogspot.com/feeds/2173663107224743977/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6454200798774615510&amp;postID=2173663107224743977' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6454200798774615510/posts/default/2173663107224743977'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6454200798774615510/posts/default/2173663107224743977'/><link rel='alternate' type='text/html' href='http://bitbay.blogspot.com/2008/08/wanted-pic-driver.html' title='WANTED: PIC driver...'/><author><name>vi0</name><uri>http://www.blogger.com/profile/03338074674997819446</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6454200798774615510.post-1603866010460684580</id><published>2008-08-19T17:52:00.000-07:00</published><updated>2008-08-19T17:58:18.335-07:00</updated><title type='text'>Staying late pays...</title><content type='html'>&lt;p&gt;Thanks to simple, yet great advice by Andrew Turner concerning calls to openfirmware and utilizing *OF_buf, it seems that eventually I came to the point where the kernel panics due to the lack of PIC!:&lt;/p&gt;&lt;p&gt;===================&lt;/p&gt;&lt;p&gt; atomic_subtract_16(0)... panic: no PIC detected&lt;br /&gt;&lt;br /&gt;KDB: enter: panic&lt;br /&gt;[thread pid 0 tid 100000 ]&lt;br /&gt;Stopped at      0x29587c:       addi    r0, r0, 0x0&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;===================&lt;/p&gt;&lt;p&gt;As you can see, the KDB by itself stops at this point, no crash at last:)&lt;/p&gt;&lt;p&gt;All thanks to the AT and the fact that I'm studying hard for the exam (Quantum Mechanics for PhD students....)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6454200798774615510-1603866010460684580?l=bitbay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bitbay.blogspot.com/feeds/1603866010460684580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6454200798774615510&amp;postID=1603866010460684580' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6454200798774615510/posts/default/1603866010460684580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6454200798774615510/posts/default/1603866010460684580'/><link rel='alternate' type='text/html' href='http://bitbay.blogspot.com/2008/08/staying-late-pays.html' title='Staying late pays...'/><author><name>vi0</name><uri>http://www.blogger.com/profile/03338074674997819446</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6454200798774615510.post-8472821194294522838</id><published>2008-08-19T05:54:00.000-07:00</published><updated>2008-08-19T06:08:52.053-07:00</updated><title type='text'>/*decr_init()*/</title><content type='html'>&lt;p&gt;Some new things came up recentrly, I've added some code from NetBSD and commented out the decr_init() in cpu_startup(). Now, during the boot I've rached subsystem 3800000 , as last time w/o decr_init(), but this time it seems it entered the newbus!&lt;/p&gt;&lt;p&gt;==========================================&lt;/p&gt;&lt;p&gt;[thread pid 0 tid 100000 ]&lt;br /&gt;Breakpoint at   0x4930d8:       stwu    r1, r1, -0x20&lt;br /&gt;db&gt;&lt;br /&gt;nexus0: registered as a time-of-day clock (resolution 1000us)&lt;br /&gt;nexus0: &lt;openprom&gt;, type (unknown) (no driver attached)&lt;br /&gt;nexus0: &lt;aliases&gt;, type (unknown) (no driver attached)&lt;br /&gt;nexus0: &lt;options&gt;, type (unknown) (no driver attached)&lt;br /&gt;nexus0: &lt;packages&gt;, type (unknown) (no driver attached)&lt;br /&gt;nexus0: &lt;chosen&gt;, type (unknown) (no driver attached)&lt;br /&gt;nexus0: &lt;memory&gt;, type memory (no driver attached)&lt;br /&gt;nexus0: &lt;cpus&gt;, type (unknown) (no driver attached)&lt;br /&gt;nexus0: &lt;rtas&gt;, type (unknown) (no driver attached)&lt;br /&gt;nexus0: &lt;failsafe&gt;, type serial (no driver attached)&lt;br /&gt;nexus0: &lt;builtin&gt;, type builtin (no driver attached)&lt;br /&gt;nexus0: &lt;pci&gt;, type pci (no driver attached)&lt;br /&gt;sc0: no video adapter found.&lt;br /&gt;nexus0: &lt;sc&gt;, type syscons (no driver attached)&lt;br /&gt;done.&lt;br /&gt;   ofw_bus_gen_get_name(0)... cpu_exception:&lt;br /&gt;SRR0 0x01035CFC SRR1  0x00003030 MSR  0x00003030&lt;br /&gt;LR   0x0103E1E4 CTR   0x0101A5F0 CR   0x44002042   XER 0x20000000&lt;br /&gt;DAR  0xD0004DDE DSISR 0x42000000 Type 3&lt;br /&gt;GPR[] 0x00000007 0x00559EB4 0x00000000 0x00000000 0x07C05323 0x00000005 0x0000000D 0x0058EBB8&lt;br /&gt;&lt;/p&gt;&lt;p&gt;...&lt;/p&gt;&lt;p&gt;============================================&lt;br /&gt;&lt;/p&gt;&lt;p&gt;And again, the old friend. I can't spot the cause of those crashes. They always look the same, with the same content of SRR0,1 and MSR. Adding some stuff from NetBSD helped, but it only took it just a few steps further. Thus it must be something wih the OF, but what? This time it's nothing about the stack, because the registers contains some crazy addresses, neither form kernel, nor from the OF stack... During some previous tests I've encountered some crashes on instructions reading/writing to SPRG0 and IBAT4, in  ofw_sprg_prepare(); and in&lt;/p&gt;&lt;p&gt;===========&lt;/p&gt;&lt;p&gt;from: src/sys/powerpc/aim/ofw_machdep.c&lt;/p&gt;&lt;p&gt; __asm __volatile(       "\t"&lt;br /&gt;                "sync\n\t"&lt;br /&gt;                "mfmsr  %0\n\t"&lt;br /&gt;                "mtmsr  %1\n\t"&lt;br /&gt;                "isync\n"&lt;br /&gt;                : "=r" (oldmsr)&lt;br /&gt;                : "r" (ofmsr[0])&lt;br /&gt;        );&lt;br /&gt;============&lt;br /&gt;&lt;/p&gt;&lt;p&gt;both in openfirmware()...&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6454200798774615510-8472821194294522838?l=bitbay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bitbay.blogspot.com/feeds/8472821194294522838/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6454200798774615510&amp;postID=8472821194294522838' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6454200798774615510/posts/default/8472821194294522838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6454200798774615510/posts/default/8472821194294522838'/><link rel='alternate' type='text/html' href='http://bitbay.blogspot.com/2008/08/decrinit.html' title='/*decr_init()*/'/><author><name>vi0</name><uri>http://www.blogger.com/profile/03338074674997819446</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6454200798774615510.post-5329895237445517790</id><published>2008-08-17T16:41:00.000-07:00</published><updated>2008-08-17T16:53:51.313-07:00</updated><title type='text'>odd discovery</title><content type='html'>&lt;p&gt;I was fighting with the OF_peer() to check if it passes the openfirmware() call, which is OF entry and after lots of tries it seems that it does. It's very different from what I thought before. After using ofw_stack() from NetBSD in OF_peer() as it was done in OF_read()/OF_write(), that function seems to be working but the crash remains. &lt;/p&gt;&lt;p&gt;Here's the dump:&lt;/p&gt;&lt;p&gt;DEBUG 2&lt;br /&gt;done.&lt;br /&gt;subsystem 2100000&lt;br /&gt;   freebsd4_sigreturn(0)...&lt;br /&gt;cpu_startup() DEBUG 0&lt;br /&gt;** DEBUGL OF_printf(): after OF_peer() in decr_init()&lt;br /&gt;cpu_exception:&lt;br /&gt;SRR0 0x004A0DF0 SRR1  0x00003030 MSR  0x00003030&lt;br /&gt;LR   0x01003ED8 CTR   0x00000000 CR   0x24002044   XER 0x0&lt;br /&gt;DAR  0xD0004D3C DSISR 0x42000000 Type 3&lt;br /&gt;========================&lt;br /&gt;What is very strange, during the trace I've encountered the call to OF_write() just after OF_peer(), like there were _two_ calls to openfirmware() insted of one. And it's the second one that crashes... Now, what I don't get is where from this second call come ? There's no printf() around OF_peer()...:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;========================&lt;/p&gt;&lt;p&gt;from: sys/dev/ofw/openfirm.c&lt;/p&gt;&lt;p&gt;phandle_t&lt;br /&gt;OF_peer(phandle_t node)&lt;br /&gt;{&lt;br /&gt;            static struct {&lt;br /&gt;                    cell_t name;&lt;br /&gt;                    cell_t nargs;&lt;br /&gt;                    cell_t nreturns;&lt;br /&gt;                    cell_t node;&lt;br /&gt;                    cell_t next; } &lt;/p&gt;&lt;p&gt;               args = {&lt;br /&gt;                           (cell_t)"peer",&lt;br /&gt;                            1,&lt;br /&gt;                            1,&lt;br /&gt;                            };&lt;/p&gt;&lt;p&gt;&lt;br /&gt;        ofw_stack();&lt;br /&gt;        args.node = node;&lt;br /&gt;        if (openfirmware(&amp;amp;args) == -1)&lt;br /&gt;                return (-1);&lt;br /&gt;        return (args.next);&lt;br /&gt;}&lt;br /&gt;=========================&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6454200798774615510-5329895237445517790?l=bitbay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bitbay.blogspot.com/feeds/5329895237445517790/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6454200798774615510&amp;postID=5329895237445517790' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6454200798774615510/posts/default/5329895237445517790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6454200798774615510/posts/default/5329895237445517790'/><link rel='alternate' type='text/html' href='http://bitbay.blogspot.com/2008/08/odd-discovery.html' title='odd discovery'/><author><name>vi0</name><uri>http://www.blogger.com/profile/03338074674997819446</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6454200798774615510.post-1726951362836065456</id><published>2008-08-16T05:32:00.000-07:00</published><updated>2008-08-16T05:35:19.458-07:00</updated><title type='text'></title><content type='html'>I've tried to find the differences between the contexts of calling openfirmware()&lt;br /&gt;from OF_write()/OF_read() and OF_peer(), but I found none. It's not possible&lt;br /&gt;to break into the fwentry() call from openfirmware(), since it always results in&lt;br /&gt;spinlock corrupt crash.  I've tried to insert the call to decr_init() into several&lt;br /&gt;boot subsystems, it always ended with the same crash, even before the VM init.&lt;br /&gt;I've also called the OF_peer() at the very beginning of OF_write() to see if it's&lt;br /&gt;possible to execute it at the very early stage of the boot, before the KDB entry.&lt;br /&gt;It crashed. I've also tried to switch off the decr_init() call in the cpu_starup() and the system passed several following subsystems to subsystem 3000000 (or so) and crashed in the same way it does with decr_init().&lt;br /&gt;I've inspected what does the ofw_stack() function do, but it only copies the current call stack to the firmware stack located in locore.S. This call was added in OF_read()/write() to make them work on Efika. Now, I can guess it's something with what could have change in p4 FBSD vs FBSD 6.x, since the patch was for that version. I'll try to apply the patch to version 6.x. Also, I'll have a look at the NetBSD source. I really don't understand, why it does work work the OF_read()/OF_write() and does not for OF_peer(), since those calls are so similar.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6454200798774615510-1726951362836065456?l=bitbay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bitbay.blogspot.com/feeds/1726951362836065456/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6454200798774615510&amp;postID=1726951362836065456' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6454200798774615510/posts/default/1726951362836065456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6454200798774615510/posts/default/1726951362836065456'/><link rel='alternate' type='text/html' href='http://bitbay.blogspot.com/2008/08/ive-tried-to-find-differences-between.html' title=''/><author><name>vi0</name><uri>http://www.blogger.com/profile/03338074674997819446</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6454200798774615510.post-5887681693398099028</id><published>2008-08-08T14:28:00.000-07:00</published><updated>2008-08-08T14:47:20.518-07:00</updated><title type='text'>still no luck, and a new problem</title><content type='html'>I've performed lots of experiments with the ofwreal.S and locore.S&lt;br /&gt;sources in aim to try to remove the problem with the stack.&lt;br /&gt;It does't work for now, but I've managed to overcome that by utilizing&lt;br /&gt;some free registers. Now I've encountered yet another problem - the&lt;br /&gt;kernel now crashes on the openfirmware entry in the fwentry(). It's probably&lt;br /&gt;coused by a wrong address of the entry point, coming from the virtual&lt;br /&gt;instead of the real addressing.  Here's the crash site:&lt;br /&gt;=============&lt;br /&gt;cpu_exception:&lt;br /&gt;SRR0 0x00000000 SRR1  0x00083030 MSR  0x00003030&lt;br /&gt;LR   0x004A0E70 CTR   0x00000000 CR   0x44002082   XER 0x20000000&lt;br /&gt;=============&lt;br /&gt;I've made a small test by changing the address the firmware entry is supposed to&lt;br /&gt;be at and I get slightly similar crash:&lt;br /&gt;=============&lt;br /&gt;cpu_exception:&lt;br /&gt;SRR0 0x01003ED8 SRR1  0x00003030 MSR  0x00003030&lt;br /&gt;LR   0x004A0E70 CTR   0x00000000 CR   0x44002044   XER 0x0&lt;br /&gt;=============&lt;br /&gt;The LR's point to the same location, the very next instrucion after  branch to OF.&lt;br /&gt;So I suppose it's the OF address, not just the argument addresing&lt;br /&gt;that is responsible at the moment. I'm trying to find out how to translate an&lt;br /&gt;address to the real mode. All help would be greatly appreciated...:)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6454200798774615510-5887681693398099028?l=bitbay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bitbay.blogspot.com/feeds/5887681693398099028/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6454200798774615510&amp;postID=5887681693398099028' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6454200798774615510/posts/default/5887681693398099028'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6454200798774615510/posts/default/5887681693398099028'/><link rel='alternate' type='text/html' href='http://bitbay.blogspot.com/2008/08/still-no-luck-and-new-problem.html' title='still no luck, and a new problem'/><author><name>vi0</name><uri>http://www.blogger.com/profile/03338074674997819446</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6454200798774615510.post-4010509782318405583</id><published>2008-08-01T06:29:00.000-07:00</published><updated>2008-08-01T06:48:55.554-07:00</updated><title type='text'>hard progress</title><content type='html'>&lt;p&gt;Eventually, with the aid of my mentor, we found the exact position of the faulting instruction. I've managet to turn on the KDB facility and thus we were able to make some breakpoints. In aim to spot the bug we used the DAR register content and toolchan version of the objdump tool.  Fortunately, it appeared that addresses obtained from the objdump and those from the running kernel match. Here's the dump: &lt;/p&gt;&lt;p&gt;====================================================================&lt;/p&gt;&lt;p&gt;...&lt;/p&gt;&lt;p&gt;SRR0 0x004A0D10 SRR1 0x00003030 MSR 0x00003030&lt;br /&gt;LR 0x01003ED8 CTR 0x00000000 CR 0x24002044 XER 0x0&lt;br /&gt;DAR 0xD0004D3C DSISR 0x42000000 Type 3&lt;br /&gt;GPR[] 0x004A0BC4 0xD0004D30 0x00000000 0x01003ED8 0x00003030 0x00000000 0x00000020 0x00000000&lt;br /&gt;...&lt;br /&gt;&lt;/p&gt;&lt;p&gt;====================================================================&lt;/p&gt;&lt;p&gt;The evil instrucion is in the openfirmware entry point wrapper,&lt;/p&gt;&lt;p&gt;====================================================================&lt;/p&gt;&lt;p&gt;ofwreal.S&lt;/p&gt;&lt;p&gt;...&lt;/p&gt;&lt;p&gt;/*&lt;br /&gt; * Emulated firmware entry.&lt;br /&gt; */&lt;br /&gt;fwentry:&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;&lt;/p&gt;&lt;p&gt; lis     %r3,clsave@ha             /* save mmu values of client */&lt;br /&gt;        addi    %r3,%r3,clsave@l       &lt;br /&gt;        lis     %r3,fwsave@ha           /* restore mmu values of firmware */&lt;br /&gt;        addi    %r3,%r3,fwsave@l&lt;br /&gt;        bl      restoremmu &lt;/p&gt;&lt;p&gt;&lt;br /&gt;        lis     %r3,ofentry@ha&lt;br /&gt;        lwz     %r3,ofentry@l(%r3)      /* get actual firmware entry */&lt;br /&gt;        mtlr    %r3&lt;br /&gt;&lt;br /&gt;        mfmsr   %r4                    &lt;br /&gt;        stw     %r4,12(%r1)             /* save MSR */&lt;br /&gt;        ori     %r4,%r4,PSL_IR|PSL_DR   /* turn on MMU */&lt;br /&gt;        andi.   %r4,%r4,~PSL_EE@l       /* turn off interrupts */&lt;br /&gt;        mtmsr   %r4&lt;br /&gt;        isync&lt;br /&gt;&lt;br /&gt;====================================================================&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The problem is with the stack,&lt;/p&gt;&lt;p&gt;stw     %r4,12(%r1)             /* save MSR */&lt;/p&gt;&lt;p&gt;That line causes probably a DSI exception. The problem is that it crashes just after the restoremmu function branch. If one stores something on the stuck before that branch, ther's no crash. So the problem lies in the restoremmu function, but it's not clear to me where exactly it is, because the restoremmu does not operate the %r1 register explicitly.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6454200798774615510-4010509782318405583?l=bitbay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bitbay.blogspot.com/feeds/4010509782318405583/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6454200798774615510&amp;postID=4010509782318405583' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6454200798774615510/posts/default/4010509782318405583'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6454200798774615510/posts/default/4010509782318405583'/><link rel='alternate' type='text/html' href='http://bitbay.blogspot.com/2008/08/hard-progress.html' title='hard progress'/><author><name>vi0</name><uri>http://www.blogger.com/profile/03338074674997819446</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6454200798774615510.post-3791179700594915711</id><published>2008-07-07T02:16:00.000-07:00</published><updated>2008-07-07T02:21:25.633-07:00</updated><title type='text'>suspect spotted</title><content type='html'>I've managed to find  the faulty function. It's openfirmware() from ofw_machdep.c. Back to __asm__ and OF vs SF...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6454200798774615510-3791179700594915711?l=bitbay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bitbay.blogspot.com/feeds/3791179700594915711/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6454200798774615510&amp;postID=3791179700594915711' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6454200798774615510/posts/default/3791179700594915711'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6454200798774615510/posts/default/3791179700594915711'/><link rel='alternate' type='text/html' href='http://bitbay.blogspot.com/2008/07/suspect-spotted.html' title='suspect spotted'/><author><name>vi0</name><uri>http://www.blogger.com/profile/03338074674997819446</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6454200798774615510.post-8297384593222701991</id><published>2008-07-06T07:37:00.001-07:00</published><updated>2008-07-06T07:43:10.779-07:00</updated><title type='text'>Bad surprise</title><content type='html'>I've been playing around with the kernel to turn on some debugging&lt;br /&gt;in the driver source code, and it appeared that it doesn't even come to&lt;br /&gt;SI_SUB_CONFIGURE. I've turned on VERBOSE_SYSINIT, here's the snipped:&lt;br /&gt;&lt;br /&gt;=======================================================================&lt;br /&gt; 0x253718(0x57d068)... done.&lt;br /&gt; 0x253718(0x57d120)... done.&lt;br /&gt; 0x253718(0x578dcc)... done.&lt;br /&gt; 0x26d900(0x56f194)... done.&lt;br /&gt; 0x253718(0x56f19c)... done.&lt;br /&gt; 0x253718(0x57d5a0)... done.&lt;br /&gt; 0x2a46e8(0)... done.&lt;br /&gt; 0x308d88(0)... done.&lt;br /&gt; 0x295c50(0)... done.&lt;br /&gt;subsystem 1c00000&lt;br /&gt; 0x293e94(0)... done.&lt;br /&gt;subsystem 1c00001&lt;br /&gt; 0x27a9d8(0)... done.&lt;br /&gt;subsystem 2000000&lt;br /&gt; 0x2520e0(0)... done.&lt;br /&gt; 0x245f24(0)... done.&lt;br /&gt; 0x284630(0)... done.&lt;br /&gt; linker_file_unload(0)... done.&lt;br /&gt; ktrsyscall(0)... done.&lt;br /&gt; linker_file_lookup_set(0)... done.&lt;br /&gt;subsystem 2100000&lt;br /&gt; freebsd4_sigreturn(0)... cpu_exception:&lt;br /&gt;SRR0 0x004A0D10 SRR1  0x00003030 MSR  0x00003030&lt;br /&gt;LR   0x01003ED8 CTR   0x00000000 CR   0x24002044   XER 0x0&lt;br /&gt;DAR  0xD0004D3C DSISR 0x42000000 Type 3&lt;br /&gt;GPR[] 0x004A0BC4 0xD0004D30 0x00000000 0x01003ED8 0x00003030 0x00000000 0x00000020 0x00000000&lt;br /&gt;GPR[] 0x00000000 0x00000000 0x00000000 0x004A0D00 0x00003030 0x00000000 0xEFF7737F 0x00575BC8&lt;br /&gt;GPR[] 0x00590000 0x00554D0C 0x00522C6C 0x00522C4C 0x00522C5C 0x00522C90 0xD0004E18 0xD0004E1C&lt;br /&gt;GPR[] 0x00590000 0x00800001 0x00590000 0x00000001 0x00590000 0x02100000 0x00003032 0xD0004D40&lt;br /&gt;ibat0U 0x00001FFF ibat0L 0x00000012&lt;br /&gt;ibat1U 0xF0001FFF ibat1L 0xF0000012&lt;br /&gt;ibat2U 0x00000000 ibat2L 0x00000000&lt;br /&gt;ibat3U 0x00000000 ibat3L 0x00000000&lt;br /&gt;dbat0U 0xF0001FFF dbat0L 0xF000002A&lt;br /&gt;dbat1U 0x80001FFF dbat1L 0x8000002A&lt;br /&gt;dbat2U 0x00001FFF dbat2L 0x00000012&lt;br /&gt;dbat3U 0xC0001FFF dbat3L 0xC000002A&lt;br /&gt;HID0 0x0000C000&lt;br /&gt;deadend:&lt;br /&gt;=======================================================================&lt;br /&gt;&lt;br /&gt;The crashing subsystem is subsystem 2100000, and is responsible for the&lt;br /&gt;CPU resources:&lt;br /&gt;&lt;br /&gt;=======================================================================&lt;br /&gt;from sys/sys/kernel.h&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;enum sysinit_sub_id {&lt;br /&gt; ...&lt;br /&gt;      SI_SUB_KLD              = 0x2000000,    /* KLD and module setup */&lt;br /&gt;      SI_SUB_CPU              = 0x2100000,    /* CPU resource(s)*/&lt;br /&gt; ...&lt;br /&gt;};&lt;br /&gt;...&lt;br /&gt;=======================================================================&lt;br /&gt;&lt;br /&gt;It crashes somwhere near sigreturn(). The PIC has to wait for a second...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6454200798774615510-8297384593222701991?l=bitbay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bitbay.blogspot.com/feeds/8297384593222701991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6454200798774615510&amp;postID=8297384593222701991' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6454200798774615510/posts/default/8297384593222701991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6454200798774615510/posts/default/8297384593222701991'/><link rel='alternate' type='text/html' href='http://bitbay.blogspot.com/2008/07/bad-surprise.html' title='Bad surprise'/><author><name>vi0</name><uri>http://www.blogger.com/profile/03338074674997819446</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6454200798774615510.post-6333692534471536412</id><published>2008-06-14T05:54:00.000-07:00</published><updated>2008-06-14T06:02:14.961-07:00</updated><title type='text'>Recent activity report 01</title><content type='html'>This week I had a liitle progress in making p4 obeying my will:) I've managed to cleanup some mess I done there some time ago when I created my first branch. Now, after fixing that I've made a submit of the FreeBSD code merged with Andrew Turner's code. The code boots well and stops in the middle of nowhere...&lt;br /&gt;Now it's the time to check if the device enumeration goes well. I'll be trying to turn on the debugging in the devices source code to see if dev's ID's are OK with the OpenFirmware... After that I plan to get aquired with the newbus framework and I'll be heading towards the allmighty PIC... nexux.c awaits...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6454200798774615510-6333692534471536412?l=bitbay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bitbay.blogspot.com/feeds/6333692534471536412/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6454200798774615510&amp;postID=6333692534471536412' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6454200798774615510/posts/default/6333692534471536412'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6454200798774615510/posts/default/6333692534471536412'/><link rel='alternate' type='text/html' href='http://bitbay.blogspot.com/2008/06/recent-activity-report-01.html' title='Recent activity report 01'/><author><name>vi0</name><uri>http://www.blogger.com/profile/03338074674997819446</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6454200798774615510.post-2850446540050645270</id><published>2008-06-12T14:28:00.000-07:00</published><updated>2008-06-14T05:53:27.602-07:00</updated><title type='text'>So here we go...</title><content type='html'>&lt;strong&gt;Welcome everybody!&lt;/strong&gt;&lt;br /&gt;It's my blog on my 2008's GSoC  project, which is porting FreeBSD to Efika, a PPC based evaluation board. I've decided to create this blog in aim to  show you how a geek spends his summer :) - I'll be describing ups and downs of  being a GSoCer as the time passes, but also I'll be reporting the progress of the project. More techincal info can be foud on my FreeBSD wiki:&lt;br /&gt;http://wiki.freebsd.org/PrzemekWitaszczyk#preview&lt;br /&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6454200798774615510-2850446540050645270?l=bitbay.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bitbay.blogspot.com/feeds/2850446540050645270/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6454200798774615510&amp;postID=2850446540050645270' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6454200798774615510/posts/default/2850446540050645270'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6454200798774615510/posts/default/2850446540050645270'/><link rel='alternate' type='text/html' href='http://bitbay.blogspot.com/2008/06/so-here-we-go.html' title='So here we go...'/><author><name>vi0</name><uri>http://www.blogger.com/profile/03338074674997819446</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
