From owner-freebsd-current Thu Aug 15 6:49:45 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8FD4F37B405 for ; Thu, 15 Aug 2002 06:49:37 -0700 (PDT) Received: from hardtime.linuxman.net (hardtime.linuxman.net [66.147.26.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id E10C843EB7 for ; Thu, 15 Aug 2002 06:47:57 -0700 (PDT) (envelope-from gh@over-yonder.net) Received: from mortis.over-yonder.net (localhost [127.0.0.1]) by hardtime.linuxman.net (8.11.6/8.11.6) with ESMTP id g7FE1vj01421 for ; Thu, 15 Aug 2002 09:01:59 -0500 Received: by mortis.over-yonder.net (Postfix, from userid 1012) id 815AD1F04; Thu, 15 Aug 2002 08:47:38 -0500 (CDT) Date: Thu, 15 Aug 2002 08:47:38 -0500 From: dmk To: freebsd-current@freebsd.org Subject: Re: emulators/rtc and vmware2 Message-ID: <20020815134738.GB35400@over-yonder.net> References: <20020815121105.GA35400@over-yonder.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="RnlQjJ0d97Da+TV1" Content-Disposition: inline In-Reply-To: <20020815121105.GA35400@over-yonder.net> User-Agent: Mutt/1.4i-fullermd.1 X-Editor: vi X-OS: FreeBSD Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --RnlQjJ0d97Da+TV1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Aug 15, 2002 at 07:11:05AM -0500 I heard the voice of dmk, and lo! it spake thus: > > Is anybody successfully using the port emulators/rtc with vmware2 on > -current? [...] Replying to myself... I have since hacked rtc so it works with vmware2 on my -CURRENT system dated February 4, 2002. In the shocking case that anyone is interested, I have attached the diff. (I would appreciate anybody looking at the diff as it is my first kernel hack.) > Thanks loads, dan --RnlQjJ0d97Da+TV1 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="rtc.diff" --- rtc.c.bk Thu Aug 15 03:50:21 2002 +++ rtc.c Thu Aug 15 03:51:30 2002 @@ -177,9 +177,8 @@ rtc_open(dev_t dev, int oflag, int otyp, struct proc *p) #endif { - struct rtc_softc *sc; + struct rtc_softc *sc = (struct rtc_softc *) dev->si_drv1; - sc = rtc_attach(dev); if (sc==NULL) return (EAGAIN); @@ -264,7 +263,21 @@ static int init_module(void) { -int error; + int error; + struct rtc_softc *sc; + dev_t dev; + + dev = make_dev(&rtc_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, DEVICE_NAME); + if(dev==NULL) + return (NULL); + + MALLOC(sc, struct rtc_softc*, sizeof(*sc), M_DEVBUF, M_WAITOK); + if(sc==NULL) + return NULL; + + bzero(sc, sizeof(*sc)); + rtc_sc = sc; + dev->si_drv1 = sc; /* Link together */ error = cdevsw_add(&rtc_cdevsw); if (error) --RnlQjJ0d97Da+TV1-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message