From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1V1fi4-00060Y-W9 for mharc-grub-devel@gnu.org; Tue, 23 Jul 2013 12:45:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49051) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1fi2-0005xd-8q for grub-devel@gnu.org; Tue, 23 Jul 2013 12:45:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V1fhz-00079N-R7 for grub-devel@gnu.org; Tue, 23 Jul 2013 12:45:10 -0400 Received: from mail-lb0-x229.google.com ([2a00:1450:4010:c04::229]:65105) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1fhz-00078O-HB for grub-devel@gnu.org; Tue, 23 Jul 2013 12:45:07 -0400 Received: by mail-lb0-f169.google.com with SMTP id d10so6489726lbj.14 for ; Tue, 23 Jul 2013 09:45:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; bh=dS+dD1gjWVLCiPliCakFdztIqHq9p0x+rcVX5i68qv4=; b=rLyxZXluo3TW8f9WyU9xlKhATU2Yqo5AWF6CqgttieB2Tv4meWGTDUPjE08aD9lUsZ +gEpTB2SYczA/cSC/XTdIbzFV2SKH5U9mXzG3lTtwT3iGnWTCImO3iIEo7Q5lYYaunaM YeK1hIqmYJ3Em2H1Jut9S4QzkXOLiQlm5jdukb/3TB5OdGNqPdCmQBBM4AECqGTcjRMb csGU6A5w0rzxwn/XmyBxGn6/bFyNuuSwlYhs2oh17DpExT4B8Nkm4UFRbfDaj8zB0BsB 5/73ikBzlV7oDcbD9Gc4od/IWb0pnf38tQdjpr/g0MoGZe11fiTlu8VUE/NiBgEQAjW5 tGpA== X-Received: by 10.152.4.232 with SMTP id n8mr15316828lan.29.1374597906011; Tue, 23 Jul 2013 09:45:06 -0700 (PDT) Received: from opensuse.site (ppp79-139-160-84.pppoe.spdop.ru. [79.139.160.84]) by mx.google.com with ESMTPSA id u1sm13408135lag.5.2013.07.23.09.45.04 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Tue, 23 Jul 2013 09:45:05 -0700 (PDT) Date: Tue, 23 Jul 2013 20:45:03 +0400 From: Andrey Borzenkov To: Holger Goetz Subject: Re: Obtaining the UUID of the system for a PXE boot Message-ID: <20130723204503.16520724@opensuse.site> In-Reply-To: <51EEAE57.8070700@hgsys.de> References: <51E67DC2.1090609@hgsys.de> <51E7C5F0.5000308@hgsys.de> <20130718193501.629d9c69@opensuse.site> <51E94C37.4030300@hgsys.de> <51EEAE57.8070700@hgsys.de> X-Mailer: Claws Mail 3.9.0 (GTK+ 2.24.18; x86_64-suse-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::229 Cc: grub-devel@gnu.org X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jul 2013 16:45:12 -0000 В Tue, 23 Jul 2013 18:24:55 +0200 Holger Goetz пишет: > Hi, > > looks i could need some help here. > > I've moved the smbios module from commands/i386 to commands and added > some casts to make the compiler happy. As I need a x86_64-efi grub. > What i see now is that the "_SM_" signature is not found: "Failed to > locate entry point structure" some added grub_dprintf's show all zeros > in the memory area. > Actually when i use the "dump" command to display the memory in the area > that gets swiped (0xf0000..0x10000) it (also) only displays "00"s. > Is there some memory mapping required in x86_64 mode to access the > memory area properly? I did cross check w/ the Linux kernel efi code and > syslinux all basically do the same searching. > You need to fetch SMBIOS table address from EFI system table. See as example https://git.ipxe.org/ipxe.git/blob/HEAD:/src/interface/efi/efi_smbios.c You can use grub_machine_acpi_get_rsdpv2() as example implementation. Just add SMBIOS GUID and any sanity checks as required. > Thanks, > Holger > > > > On 19.07.2013 18:31, David Michael wrote: > > Hi, > > > > On Fri, Jul 19, 2013 at 10:24 AM, Holger Goetz wrote: > >> Yes it's towards the right direction. But it is 32bit only if i understand > >> correctly, and it basically is a memory access to fixed/hardcoded MEMORY > >> address (0x80000001). to pick the veondor id and machine info. > > It's true that I've mostly been using the module on 32-bit virtual > > machines, so it hasn't really been tested elsewhere. However, I'm not > > sure I understand what you mean by the hard-coded memory address. The > > first function grub_smbios_locate_eps searches for the SMBIOS entry > > point structure as described in the spec. The table entries are then > > read at the table address found in the EPS, not a hard-coded location. > > > >> I have only 64bit - UEFI here - therefore the approach w/ first searching > >> the SMBIOS infoblock in memory is probably required. And then properly walk > >> through the info-tables/blocks to get to the UUID entry. It doesn'T need to > >> be a fixed info to be retrieved from the SMBIOS memory - maybe a generic > >> function to query/search a specific entry and return that to be assigned to > >> a variable would be more flexible. > > The module's command-line interface does use a (dumb) query/search > > method. You can specify the desired entry's type and/or handle and > > the data to retrieve from it. For example the following command > > prints the machine name (i.e. the string at offset 5 in an entry with > > type 1). > > > > smbios -t 1 -s 5 > > > > I think you may have found the first patch I sent in that old thread, > > which was for different functionality. The SMBIOS module can be > > downloaded from the list archive[1]. > > > > Unfortunately it doesn't have any convenient functions to output a > > usable UUID. It shouldn't take much to add one: the variable "entry" > > in the "main" function is a pointer to the matched entry, so entry[8] > > through entry[23] is the UUID in a call "smbios -t 1 ...". I've > > verified these bytes correspond to dmidecode output on my physical > > hardware with the following. > > > > for i in 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 > > do smbios -t 1 -b $i > > done > > > > If the module isn't salvageable on UEFI, maybe I can send out an > > updated version whenever I upgrade to such a system. > > > > Thanks. > > > > David > > > > [1] https://lists.gnu.org/archive/html/grub-devel/2013-04/binx8am8MvVSh.bin > > > > _______________________________________________ > > Grub-devel mailing list > > Grub-devel@gnu.org > > https://lists.gnu.org/mailman/listinfo/grub-devel > > > > >