GSoC 2010, TianoCore as a payload :(

It’s been an interesting summer.  It didn’t at all turn out how I expected, but it is what it is.  TianoCore as a software project turned out to be massively more complex than I anticipated when I submitted my proposal, and the level of knowledge required was quite a bit deeper than I expected… it’s one of those cases where I didn’t know what I didn’t know.  I’ll have to talk to a couple of my professors about that, to see if there’s some elective class that explains the things I’ve missed.

Sorry, that’s vague, let me give an example.  Coreboot does it’s thing, hardware initialization, then passes control to the payload.  This seems to be the equivalent of the dreaded “goto”, which is actually pretty cool.  Coreboot doesn’t care what happens next.  So hypothetically, I have some code, anything, I want to use it as a payload.  I compile it, then what?  Well, it depends (as you all know), how was it compiled?  Is it an elf?  PE32?  Something else?  Where exactly is the entry point to this binary blob?  (That’s a rhetorical question, please don’t answer it in the comments.)  You would have thought at some point in one of my classes executable formats would have come up, just as an example.  Or calling conventions.  Or hundreds of other little things that I’d never seen or heard of before I suddenly realized that I needed to understand them.  So that’s what I ended up spending much of the summer on.  Write code… stop and realize what I’m doing doesn’t make sense/won’t work/is the wrong approach, then start over.

One of the things that drew me to coreboot as a project was that as a computer engineering student, I took a lot of classes focusing on the physical side of computing, starting with physics and circuits classes, moving up through logic gates to chip design.  On the other side, programming started at a pretty high level with c++, then worked down, till I got to the computer architecture and operating system classes, and assembly language (not x86, unfortunately).   I would expect that as a “computer engineer” I should understand the whole stack, that the physical, EE stuff and the CS stuff would meet in the middle.  But they haven’t (and they won’t: I’m about to graduate, and there aren’t any crucial classes left to take).  I knew this going into GSoC, and coreboot seemed like the perfect project to fill the gap (and give something back to the open source world that I’ve gotten so much out of).  Well, like I said, the gap turned out to be a lot bigger than I expected.  (To abuse the metaphor a little more, anyone remember when Evel Knievel tried to jump the Snake River Canyon?  That’s kind of how I feel about my summer of code.)

So, I have some ugly code to submit to Google.  I have a lot more ideas of things that I want to do relating to my project.  I still think TianoCore as a payload is a good idea, and that my approach is the best way to do this.  I still owe the opensource community a meaningful contribution.  So I’m going to stick with it.  I’m having fun, and it would be a shame if everything I’ve learned over this summer ends up gathering dust in my head.  At the very least I have to finish the TianoCore-payload wiki page to share what I’ve learned.

There were a few GSoC wrapup questions asked, so let me address them here.

What was the final outcome of your project?  A bunch of header files for functions and the shell of a UEFI “PEI stage” that would serve as the bridge between coreboot and TianoCore.

What problems did you encounter and how did you work through them?  As for the problems, see above.  I worked through them with the help of a great search engine, reading K&R, and occasionally asking questions (I should have asked more, but I never want to be one of those guys who asks a question that he could have answered himself with a little more research.)

What did you learn about open source development?  It’s hard to put into words, but following the mailing list in itself was a great experience, as I got to see how professionals actually work on open source.

Do you plan to work on other open source projects? Which ones?

I plan on continuing with coreboot and TianoCore.  I like hardware and low-level stuff.

What did you learn about coreboot?  Let me break this answer up into two parts.  Most of what I learned “about coreboot”, as far as why it matters hasn’t gone beyond what I first learned watching the video of Ron, Peter and Stefan giving a talk at the Google campus.  I have repeatedly during the summer run into things that made me reflect on and appreciate things I learned in the video.  They had an hour to talk and pretty much summed up why coreboot was a good idea, and what was wrong with the BIOS (and alternatives).  (The thing that bothers me most is the security problem inherent in closed source BIOSes… as Ron said, that mystery code in the BIOS is still running, and it can do anything.)  The second part, when I finally understood what “CAR” stood for, and that it actually works, that was about the coolest geeky thing I’ve ever heard of.

Do you plan to develop or use coreboot in the future?  I have a bug to fix so I can use coreboot on one of my own boards, and three other boards that are good candidates.

What could coreboot do better to help developers in the future?  There are small mistakes scattered throughout the wiki, mostly things that need updating.  It’s very frustrating to a beginner when the official instructions don’t work.  The page on compiling QEMU come to mind as needing an update.  Now that I have a wiki account I can fix mistakes as I find them.

Would you recommend coreboot GSoC to other students?  Only the ones who are smarter than me.

Do you feel that you passed or failed your GSoC project?  Failed, but I take the long view.  There’s a steep learning curve for most opensource projects, and I suspect coreboot’s is steeper than most.  I’ve already made it quite a way up this hill, so now I’m in a position to continue and contribute, whereas if I hadn’t done GSoC, I never would have made it this far.  I consider myself an opensource developer now, and without GSoC I wouldn’t be, so it wasn’t a complete failure.

Thanks all for an interesting summer and for not calling me out on some of the mistakes I’ve made in previous posts.

3 thoughts on “GSoC 2010, TianoCore as a payload :(”

  1. Hi, l am trying to learn Coreboot and Tianocore as well. I have experience in MCU hardware and software with computer engineering background just like you. But Coreboot is extremely steep to learn since there is very little documents, books, or tutorials. I have been trying to dig more info on it with very little luck. I have been reading Beyond Bios second edition and I still feel like no solid information was found. Everything I know about bootloaders/firmware still are abstracted ideas only. If you find any great info on this topic, please do post more on it.

  2. It sounds like you had a similar expectation and experience as me; CS+EE ‘should’ make sense, and coreboot should tie into both fields nicely, but I’d agree that the coreboot learning curve is very steep, and with a ‘closed’ wiki, its quite hard for an ‘outsider’ to fix issues in the wiki (patrickg is usually around in #coreboot to deal with this stuff, but that doesn’t help the late-nights :D)

    I’m about half way through a 6 week coreboot implementation project, and while I’ve got it to ‘work’ on my boards, I still don’t feel like I have a strong enough understanding of the inner workings, so I look forward to your updates to the wiki for another perspective!

    Keep up the good work

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>