From owner-soc-status@FreeBSD.ORG Mon Jun 25 12:58:23 2012 Return-Path: Delivered-To: soc-status@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F34F7106566B for ; Mon, 25 Jun 2012 12:58:22 +0000 (UTC) (envelope-from ericmcc@cs.umass.edu) Received: from mail.atlantawebhost.com (dns1.atlantawebhost.com [66.223.40.39]) by mx1.freebsd.org (Postfix) with ESMTP id A44D48FC22 for ; Mon, 25 Jun 2012 12:58:22 +0000 (UTC) Received: (qmail 22085 invoked from network); 25 Jun 2012 08:58:16 -0400 Received: from c-71-192-38-198.hsd1.ma.comcast.net (HELO Macintosh-21.local) (71.192.38.198) by mail.atlantawebhost.com with SMTP; 25 Jun 2012 08:58:15 -0400 Message-ID: <4FE86066.5070008@cs.umass.edu> Date: Mon, 25 Jun 2012 08:58:14 -0400 From: Eric McCorkle User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 To: soc-status@FreeBSD.org, "Andrey V. Elsukov" Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Status Update X-BeenThere: soc-status@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Summer of Code Status Reports and Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2012 12:58:23 -0000 This report is largely on activities from the beginning of last week. Towards the end, I was occupied with job interviews and things related to that, so I was unable to do much work. I was able to identify the root cause as to why I could not get a Hello, World type application to run. The problem is that when compiling on an amd64 machine, defines __uint64_t as unsigned long. When cross-compiling to i386 with the -m32 flag, this means that __uint64_t is incorrectly defined to be 32 bits in size. The result is that the EFI_SYSTEM_TABLE structure was misaligned. On a mingw32 build (like what EDK does), this isn't a problem, as it's using the i386 headers. I will still aim to create EDK II and IASL ports if I have the time, or after the end of summer if I run out. As things stand now, I can build a hello world type application. When I try to tie it in with libefi, however, things no longer work, but I know why. The process for starting up loader.efi is as follows: first, _start gets called, which subsequently calls _reloc, then efi_main. In libefi, efi_main does some initialization, then calls main. At present, when I try to build experimental applications that start with main (as opposed to defining their own efi_main and not linking against libefi.a), _reloc appears to fail. I am going to contact Rui Paulo to learn more about _reloc and what its purpose is. Also, loader.efi still doesn't run. There are several possible reasons for this. First, something somewhere might use __uint64_t, and I've only added macros to properly define UINT64. Second, I also noticed that mingw32 appears to reserve 8 bytes of stack space that seem to be unused, but may be an essential part of the ABI. The native build does not reserve that space. On a personal note, I will be traveling in the coming week, so my contact may be intermittent. However, I should be able to get work done.