From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 16 18:30:58 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 1A5A810656A5; Mon, 16 Aug 2010 18:30:58 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: freebsd-hackers@freebsd.org Date: Mon, 16 Aug 2010 14:30:32 -0400 User-Agent: KMail/1.6.2 References: <201008161422.01541.jkim@FreeBSD.org> In-Reply-To: <201008161422.01541.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201008161430.44974.jkim@FreeBSD.org> Cc: Christian Zander , Oleg Sharoyko Subject: Re: PCI config space is not restored upon resume (macbook pro) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2010 18:30:58 -0000 On Monday 16 August 2010 02:21 pm, Jung-uk Kim wrote: > On Monday 16 August 2010 12:46 pm, Oleg Sharoyko wrote: > > On 6 August 2010 08:15, Oleg Sharoyko wrote: > > >> When using the NVIDIA driver, you will need to make sure that > > >> you're using 256.44, you'll need to be running X at the time > > >> of entry to S3/S4, and you'll need to make sure you've > > >> switched away from X's VT (this didn't happen automatically on > > >> FreeBSD last time I checked). > > > > > > I'll give 256.44 a try, but at first I'll try to fix bios > > > emulation issues. > > > > Sorry for a long delay - it has been a really busy week here. It > > does indeed works with 256.44 just the way you describe. Though I > > had a couple of strange lockups of ACPI subsystem, but I haven't > > had enough time to debug them. I guess other drivers could also > > work if only this wasn't a MacBook. FreeBSD can call BIOS reset, > > but it looks like this doesn't work with MacBook as it has no > > BIOS, and would require to copy video card BIOS into memory and > > execute it in emulation mode. I've seen such a code for linux > > loader (to boot linux in non-emulation mode), but I don't think > > it worth doing this on resume. > > I am glad to hear it helped. :-) > > In theory, we can shadow video ROM and execute it in emulation > *iff* it actually contains x86 real mode code. It won't be too > hard but I am not sure whether it is worth trying. Are you sure > the option ROM is actually real mode code but not shadowed again > after resume? FYI, you can add a printf() in sys/dev/fb/vesa.c > like this to verify, I think: > > if (x86bios_get_orm(0xc0000) == NULL) { > printf("No option ROM found\n"); > return (1); > } I forgot "where" to add it. It's in vesa_bios_post(). You need to replace: if (x86bios_get_orm(0xc0000) == NULL) return (1); with the above three lines. Just in case. :-) Jung-uk Kim