Friday, June 27, 2008

LCD Driver

I lied, this is not the "Why iPhone Linux?" post; it's boring and philosophical anyway. Instead, I've got some hacking news!

So I've been putting off the LCD driver because I always thought it would be big and complicated. A long time ago, before I looked at all the USB code, I took one look at merlot_init and got scared off, but upon revisiting it, it really doesn't look that bad. I also was afraid of it possibly needing complicated interrupt routines, but now I can see that it only uses interrupts to dispatch spi and possibly gpio i/o, which is generic and not too bad.

I also was wondering why openiboot, as it is, makes the screen fade to (nearly) white in what pytey has called "disco lights" behavior. openiboot is obviously breaking the already initialized LCD driver somewhere. At first I thought it was because iBoot has stopped responding to interrupts necessary for the upkeep of the LCD, but an infinite loop before anything has happened will cause the LCD to remain the same. Therefore, I put a bunch of rudimentary "breakpoints" (infinite while-loops really) around the beginning of openiboot, and discovered that the LCD breaks when I initialize the system controller's power feature, which just turns off most devices. If I don't do that, the LCD stays initialized. What's more, I can just write raw ARGB (well, from the perspective that I am writing little-endian integers that are 0xAARRGGBB, it's actually BGRA in memory) into the vram range (as labeled here) and it'll show up on screen! This is without any sort of interrupt support or depending on any other memory resident code. So apparently, all that is needed is the initialization routine for basic functionality!

This is great news, and the upshot is that I think I can finish the LCD driver by the end of this weekend. In addition, cmw has already written a framebuffer that can be used after driver init, so we can display text and whatever we want.

Tuesday, June 24, 2008

An introduction to the blog

Sometimes, I like to write down my thoughts about stuff. My graphomania tends to be sporadic, but it is nice to have a place where I can exercise it when I experience it. The dev team has a bit of a taboo against blogging, which is why I haven't done it before. "Code, not ego" is our creed, and some of us believe that blogging sometimes lead to the interests of the community or the team being compromised in order to gain attention. However, I don't see anything wrong with sharing some of my love for the art... as long as I practice discretion and good taste.

Besides, we have an "official blog" now, so I feel like the playing field is open. ;)

This blog is for the developers of iPhone Linux. Any developer who's working on the project (sadly, a very short list of individuals) can ask me for write permissions here. The format will be kept largely informal. Major announcements and technical information will go on the wiki, but I'll personally be dumping a lot of technical information here on the blog as well when I can't decide/can't be bothered to condense and format it for the wiki. Views represented here are of the individual developer and not of the project in general.

Let me introduce myself though: Hi, I'm planetbeing. I'm currently, I suppose, the lead developer on the iPhone Linux project by virtue of circumstance. I was introduced to this project by cmw, a hacker who has a ton of experience porting Linux and other operating systems to a variety of equipment in the past. Unfortunately, he's currently largely burdened with other commitments. Even so, he helps out as much as he can, and he has some very exciting projects bubbling in the background that I'm sure you'll hear about soon. :)

I'm also a member of the iPhone Dev Team. While iPhone Linux has not official or direct connection with the Dev Team (I just happen to be on the Dev Team and also working on this project), its members often lend me valuable insight into many, many problems. Remember, less than a year ago I hadn't reversed a single line of code. I brought to the table (I hope) a quick and ready mind but only by hanging out with them was I able to fill it so fast.

Lastly, I tend to be overly locquacious in writing. Honestly, most people have one paragraph introduction posts and this is already War and Peace. For that, I apologize and I hope you will stick with me nevertheless.

My next post will be entitled "Why iPhone Linux?" It's something I often am challenged on and I thought I would write up an article justifying all the time I'm spending on it. :)