Welcome to Tactical Gamer

View RSS Feed

draeh

Always remember to count starting with 0

Rate this Entry
by , 02-04-2010 at 01:01 PM (691 Views)
I've just had an "anvil of enlightenment" moment. I've been struggling for about an hour trying to boot a custom Linux kernel on a custom ARM target. When you jump to the entry point of the kernel, a few processor registers must be set accordingly for the kernel to gather initial information about the system since there is no BIOS on an embedded target. The boot loader I'm using has a very nice facility for passing arguments in the registers prior to jumping to any code... Unfortunately for me, I "forgot" about the existence of register r0 and thus the arguments I thought I was passing into registers r1 & r2 actually ended up in r0 & r1.

I think its time for a small break before I continue...

Submit "Always remember to count starting with 0" to Digg Submit "Always remember to count starting with 0" to del.icio.us Submit "Always remember to count starting with 0" to StumbleUpon Submit "Always remember to count starting with 0" to Google

Tags: None Add / Edit Tags
Categories
Software Engineering

Comments

  1. oniell121's Avatar
    HAHA. Love it. I've done that with code more times than I like.
  2. Zhohar's Avatar
    What was your target? What are you trying to do?
    This sounds like a cool project.
  3. draeh's Avatar
    Quote Originally Posted by Zhohar
    What was your target? What are you trying to do?
    This sounds like a cool project.
    My target is a vehicle communications adapter/data logger utilizing a Freescale i.MX258 (ARM9) microprocessor with embedded Linux. The boot loader has to pass the Linux kernel a machine id number and a pointer to a table of target specifics in registers r1 and r2 before jumping to the kernel's entry point.
  4. BleedingKnee's Avatar
    Rookie. Use a debugger next time.
    J/K I do that all the time.
  5. oniell121's Avatar
    Software engineering.....I'll stick to web development.
  6. draeh's Avatar
    Quote Originally Posted by BleedingKnee
    Rookie. Use a debugger next time.
    J/K I do that all the time.
    I know I know... I got lazy. My BDI2000 was sitting right there too.
  7. BleedingKnee's Avatar
    Gosh I've used the BDI2000. Did you buy it on EBay by any chance? That's where my unit ended up.
  8. draeh's Avatar
    Quote Originally Posted by BleedingKnee
    Gosh I've used the BDI2000. Did you buy it on EBay by any chance? That's where my unit ended up.
    I bought my personal unit on ebay. The company bought a couple brand new back in 2004 when we did our first embedded linux project. For the price, I'm really like the JLink Pro from SEGGER. The bundled GDB server app works great.


  
 

Back to top