From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1LtJ2V-0003w5-NN for mharc-grub-devel@gnu.org; Mon, 13 Apr 2009 06:05:19 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LtJ2P-0003m9-Cq for grub-devel@gnu.org; Mon, 13 Apr 2009 06:05:13 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LtJ2K-0003i6-QX for grub-devel@gnu.org; Mon, 13 Apr 2009 06:05:12 -0400 Received: from [199.232.76.173] (port=59149 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LtJ2K-0003i2-DI for grub-devel@gnu.org; Mon, 13 Apr 2009 06:05:08 -0400 Received: from mail-fx0-f166.google.com ([209.85.220.166]:34840) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LtJ2I-0004tU-TK for grub-devel@gnu.org; Mon, 13 Apr 2009 06:05:07 -0400 Received: by fxm10 with SMTP id 10so2136845fxm.42 for ; Mon, 13 Apr 2009 03:05:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type; bh=vU/o+upC6qZQsXAdKrkz+9J85BO/ntEG5Vo6gJnQB0o=; b=Ro5qvQaGDMvd8Z47BbBYrJt87V+dRmzonDpfjHMkGbekj0yNa9rgZQOnk8oVM9ZcZY YONjA+azsE3c0fL5vlyN/clP1I1ucdjFNkIjJfbLu/BuCLLbnI2gaR1tuYKqQ0NaTz56 bADdx4hGOrmBvsSXo+FvKkzHeouKCGJ535ET0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; b=imvg5H+DsEw/mykAh5q+TVZlEd5hrRMqGV2EgFUILzRI9yKV7JTfbhgzQ5C7LWb29Z rsp/yy0J8gC98/pUyJmPeUe72E0200Qt4Gq+PBgQpg6CPa/q+837+UsZGf1pWW+grOMK lIJpXood4gOrV1csUV5GiN6UldrM2+c/XoThA= Received: by 10.86.86.10 with SMTP id j10mr1229872fgb.37.1239617106039; Mon, 13 Apr 2009 03:05:06 -0700 (PDT) Received: from ?192.168.1.25? (116-145.62-81.cust.bluewin.ch [81.62.145.116]) by mx.google.com with ESMTPS id 4sm6921064fgg.5.2009.04.13.03.05.04 (version=SSLv3 cipher=RC4-MD5); Mon, 13 Apr 2009 03:05:05 -0700 (PDT) Message-ID: <49E30E56.5060909@gmail.com> Date: Mon, 13 Apr 2009 12:05:10 +0200 From: phcoder User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 To: The development of GRUB 2 References: <49E29515.1090804@gmail.com> <49E303EB.9060005@gmail.com> In-Reply-To: Content-Type: multipart/mixed; boundary="------------000201060608070009060609" X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [PATCH] FreeBSD 64-bit kernel support X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2009 10:05:14 -0000 This is a multi-part message in MIME format. --------------000201060608070009060609 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Try this Joey Korkames wrote: > phcoder writes: > >> Joey Korkames wrote: >>> Hmm, FreeBSD seems to choke when trying to load the grub-bootstrapped >>> mfsroot.gz (as the root device - haven't tried loading without >>> rooting from it)... > >> Thank you for the testing. Can you define "choke" more exactly? >>> > > Hmm, did my log attachment not make it? I'll inline it below. > > "md0: Preloaded image 11771904 bytes at 0x7380afd000" > I gunzipped the mfsroot.gz on my PXE server, this reported size matches > the uncompressed mfsroot file. > >>> >> Just run commands I gave you. You also need ruby to regenerate all >> these autogenerated files. > > All things Ruby (including the *.rmk files) purposefully try to escape > my attention ;-) > adding maintainer-clean before autogen in my build scripts fixed the > issue -thanks. > > > "Choking": > > Copyright (c) 1992-2009 The FreeBSD Project. > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 > The Regents of the University of California. All rights reserved. > FreeBSD is a registered trademark of The FreeBSD Foundation. > FreeBSD 7.1-RELEASE #0: Thu Jan 1 08:58:24 UTC 2009 > root@driscoll.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC > Timecounter "i8254" frequency 1193182 Hz quality 0 > CPU: Intel(R) Xeon(R) CPU 5140 @ 2.33GHz (2333.35-MHz > K8-class CPU) > Origin = "GenuineIntel" Id = 0x6f6 Stepping = 6 > Features=0xbfebfbff > > Features2=0x4e3bd > > AMD Features=0x20000800 > AMD Features2=0x1 > Cores per package: 2 > usable memory = 17155354624 (16360 MB) > avail memory = 16608129024 (15838 MB) > ACPI APIC Table: > FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs > cpu0 (BSP): APIC ID: 0 > cpu1 (AP): APIC ID: 1 > ioapic0 irqs 0-23 on motherboard > ioapic1 irqs 24-47 on motherboard > kbd1 at kbdmux0 > ath_hal: 0.9.20.3 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413) > acpi0: on motherboard > acpi0: [ITHREAD] > acpi0: Power Button (fixed) > Timecounter "ACPI-safe" frequency 3579545 Hz quality 850 > acpi_timer0: <24-bit timer at 3.579545MHz> port 0x1008-0x100b on acpi0 > pcib0: port 0xcf8-0xcff on acpi0 > pci0: on pcib0 > pcib1: at device 2.0 on pci0 > pci1: on pcib1 > pcib2: irq 16 at device 0.0 on pci1 > pci2: on pcib2 > pcib3: irq 16 at device 0.0 on pci2 > pci3: on pcib3 > pcib4: at device 0.0 on pci3 > pci4: on pcib4 > ahd0: port > 0x2400-0x24ff,0x2000-0x20ff mem 0xc8200000-0xc8201fff irq 16 at device > 2.0 on pci4 > ahd0: [ITHREAD] > aic7902: Ultra320 Wide Channel A, SCSI Id=7, PCI-X 67-100Mhz, 512 SCBs > ahd1: port > 0x2c00-0x2cff,0x2800-0x28ff mem 0xc8202000-0xc8203fff irq 17 at device > 2.1 on pci4 > ahd1: [ITHREAD] > aic7902: Ultra320 Wide Channel B, SCSI Id=7, PCI-X 67-100Mhz, 512 SCBs > pcib5: at device 0.2 on pci3 > pci5: on pcib5 > pcib6: irq 18 at device 2.0 on pci2 > pci6: on pcib6 > em0: port 0x3000-0x301f mem > 0xc8300000-0xc831ffff irq 18 at device 0.0 on pci6 > em0: Using MSI interrupt > em0: [FILTER] > em0: Ethernet address: 00:30:48:31:6b:10 > em1: port 0x3020-0x303f mem > 0xc8320000-0xc833ffff irq 19 at device 0.1 on pci6 > em1: Using MSI interrupt > em1: [FILTER] > em1: Ethernet address: 00:30:48:31:6b:11 > pcib7: at device 0.3 on pci1 > pci7: on pcib7 > mpt0: port 0x4000-0x40ff mem > 0xc8410000-0xc8413fff,0xc8400000-0xc840ffff irq 24 at device 1.0 on pci7 > mpt0: [ITHREAD] > mpt0: MPI Version=1.5.13.0 > mpt0: Capabilities: ( RAID-0 RAID-1E RAID-1 ) > mpt0: 0 Active Volumes (2 Max) > mpt0: 0 Hidden Drive Members (10 Max) > pcib8: at device 4.0 on pci0 > pci8: on pcib8 > pcib9: at device 6.0 on pci0 > pci9: on pcib9 > pci0: at device 8.0 (no driver attached) > pcib10: irq 17 at device 28.0 on pci0 > pci10: on pcib10 > uhci0: port > 0x1800-0x181f irq 17 at device 29.0 on pci0 > uhci0: [GIANT-LOCKED] > uhci0: [ITHREAD] > usb0: on uhci0 > usb0: USB revision 1.0 > uhub0: on usb0 > uhub0: 2 ports with 2 removable, self powered > uhci1: port > 0x1820-0x183f irq 19 at device 29.1 on pci0 > uhci1: [GIANT-LOCKED] > uhci1: [ITHREAD] > usb1: on uhci1 > usb1: USB revision 1.0 > uhub1: on usb1 > uhub1: 2 ports with 2 removable, self powered > uhci2: port > 0x1840-0x185f irq 18 at device 29.2 on pci0 > uhci2: [GIANT-LOCKED] > uhci2: [ITHREAD] > usb2: on uhci2 > usb2: USB revision 1.0 > uhub2: on usb2 > uhub2: 2 ports with 2 removable, self powered > ehci0: mem 0xc8000000-0xc80003ff irq > 17 at device 29.7 on pci0 > ehci0: [GIANT-LOCKED] > ehci0: [ITHREAD] > usb3: EHCI version 1.0 > usb3: companion controllers, 2 ports each: usb0 usb1 usb2 > usb3: on ehci0 > usb3: USB revision 2.0 > uhub3: on usb3 > uhub3: 6 ports with 6 removable, self powered > pcib11: at device 30.0 on pci0 > pci11: on pcib11 > vgapci0: port 0x5000-0x50ff mem > 0xd0000000-0xd7ffffff,0xc8500000-0xc850ffff irq 18 at device 1.0 on pci11 > isab0: at device 31.0 on pci0 > isa0: on isab0 > atapci0: port > 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0x1860-0x186f at device 31.1 on pci0 > ata0: on atapci0 > ata0: [ITHREAD] > ata1: on atapci0 > ata1: [ITHREAD] > pci0: at device 31.3 (no driver attached) > acpi_button0: on acpi0 > atkbdc0: port 0x60,0x64 irq 1 on acpi0 > atkbd0: irq 1 on atkbdc0 > kbd0 at atkbd0 > atkbd0: [GIANT-LOCKED] > atkbd0: [ITHREAD] > sio0: configured irq 4 not in bitmap of probed irqs 0 > sio0: port may not be enabled > sio0: configured irq 4 not in bitmap of probed irqs 0 > sio0: port may not be enabled > sio0: <16550A-compatible COM port> port 0x3f8-0x3ff irq 4 flags 0x10 on > acpi0 > sio0: type 16550A, console > sio0: [FILTER] > sio1: configured irq 3 not in bitmap of probed irqs 0 > sio1: port may not be enabled > sio1: configured irq 3 not in bitmap of probed irqs 0 > sio1: port may not be enabled > sio1: <16550A-compatible COM port> port 0x2f8-0x2ff irq 3 on acpi0 > sio1: type 16550A > sio1: [FILTER] > fdc0: port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on acpi0 > fdc0: [FILTER] > ppc0: port 0x378-0x37f,0x778-0x77f irq 7 drq 3 on acpi0 > ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode > ppc0: FIFO with 16/16/9 bytes threshold > ppbus0: on ppc0 > ppbus0: [ITHREAD] > plip0: on ppbus0 > plip0: WARNING: using obsoleted IFF_NEEDSGIANT flag > lpt0: on ppbus0 > lpt0: Interrupt-driven port > ppi0: on ppbus0 > ppc0: [GIANT-LOCKED] > ppc0: [ITHREAD] > cpu0: on acpi0 > est0: on cpu0 > est: CPU supports Enhanced Speedstep, but is not recognized. > est: cpu_vendor GenuineIntel, msr 728072806000728 > device_attach: est0 attach returned 6 > p4tcc0: on cpu0 > cpu1: on acpi0 > est1: on cpu1 > est: CPU supports Enhanced Speedstep, but is not recognized. > est: cpu_vendor GenuineIntel, msr 728072806000728 > device_attach: est1 attach returned 6 > p4tcc1: on cpu1 > orm0: at iomem > 0xc0000-0xcafff,0xcb000-0xcbfff,0xcc000-0xcc7ff on isa0 > sc0: at flags 0x100 on isa0 > sc0: VGA <16 virtual consoles, flags=0x300> > vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 > Timecounters tick every 1.000 msec > md0: Preloaded image 11771904 bytes at 0x7380afd000 > > > Fatal trap 12: page fault while in kernel mode > cpuid = 0; apic id = 00 > fault virtual address = 0x7380afd000 > fault code = supervisor read data, page not present > instruction pointer = 0x8:0xffffffff80789636 > stack pointer = 0x10:0xffffffffaeee2bd0 > frame pointer = 0x10:0xffffff000420a800 > code segment = base 0x0, limit 0xfffff, type 0x1b > = DPL 0, pres 1, long 1, def32 0, gran 1 > processor eflags = interrupt enabled, resume, IOPL = 0 > current process = 47 (md0) > trap number = 12 > panic: page fault > cpuid = 0 > Uptime: 1s > Cannot dump. No dump device defined. > Automatic reboot in 15 seconds - press a key on the console to abort > --> Press a key on the console to reboot, > --> or switch off the system now. > > > > > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel -- Regards Vladimir 'phcoder' Serbinenko --------------000201060608070009060609 Content-Type: text/x-diff; name="bsd64fix.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="bsd64fix.diff" diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index 8c59c1b..8e9bb17 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -219,11 +219,27 @@ grub_freebsd_add_meta_module (int is_kern, int argc, char **argv, ((is_64bit) ? FREEBSD_MODTYPE_KERNEL64 : FREEBSD_MODTYPE_KERNEL) : FREEBSD_MODTYPE_RAW); - if ((grub_freebsd_add_meta (FREEBSD_MODINFO_TYPE, type, + if (is_64bit) + { + grub_uint64_t addr64 = addr, size64 = size; + if ((grub_freebsd_add_meta (FREEBSD_MODINFO_TYPE, type, grub_strlen (type) + 1)) || - (grub_freebsd_add_meta (FREEBSD_MODINFO_ADDR, &addr, sizeof (addr))) || - (grub_freebsd_add_meta (FREEBSD_MODINFO_SIZE, &size, sizeof (size)))) - return grub_errno; + (grub_freebsd_add_meta (FREEBSD_MODINFO_ADDR, &addr64, + sizeof (addr64))) || + (grub_freebsd_add_meta (FREEBSD_MODINFO_SIZE, &size64, + sizeof (size64)))) + return grub_errno; + } + else + { + if ((grub_freebsd_add_meta (FREEBSD_MODINFO_TYPE, type, + grub_strlen (type) + 1)) || + (grub_freebsd_add_meta (FREEBSD_MODINFO_ADDR, &addr, + sizeof (addr))) || + (grub_freebsd_add_meta (FREEBSD_MODINFO_SIZE, &size, + sizeof (size)))) + return grub_errno; + } if (argc) { --------------000201060608070009060609--