From owner-freebsd-ports Wed May 16 8:56:50 2001 Delivered-To: freebsd-ports@freebsd.org Received: from kalaid.f2f.com.ua (kalaid.f2f.com.ua [62.149.0.33]) by hub.freebsd.org (Postfix) with ESMTP id A92E437B43E for ; Wed, 16 May 2001 08:56:33 -0700 (PDT) (envelope-from sobomax@mail-in.net) Received: from Mail-In.Net (borey.f2f.com.ua [62.149.0.24]) by kalaid.f2f.com.ua (8.11.3/8.11.1) with ESMTP id f4GFx2097281; Wed, 16 May 2001 18:59:02 +0300 (EEST) (envelope-from sobomax@mail-in.net) Received: from vega.vega.com (root@das0-l80.uic-in.net [212.35.189.207]) by Mail-In.Net (8.11.3/8.H.Z) with ESMTP id f4GFv0049767; Wed, 16 May 2001 18:57:02 +0300 (EEST) Received: from FreeBSD.org (big_brother.vega.com [192.168.1.1]) by vega.vega.com (8.11.3/8.11.3) with ESMTP id f4GFh9k19561; Wed, 16 May 2001 18:43:09 +0300 (EEST) (envelope-from sobomax@FreeBSD.org) Message-ID: <3B02A00C.646E54DF@FreeBSD.org> Date: Wed, 16 May 2001 18:43:08 +0300 From: Maxim Sobolev Organization: Vega International Capital X-Mailer: Mozilla 4.77 [en] (WinNT; U) X-Accept-Language: uk,ru,en MIME-Version: 1.0 To: bryce.denney@bigfoot.com Cc: ports@FreeBSD.ORG Subject: Re: bochs port References: Content-Type: multipart/mixed; boundary="------------C6AC1C383E005D2EBA75D8E2" Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org This is a multi-part message in MIME format. --------------C6AC1C383E005D2EBA75D8E2 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Bryce Denney wrote: > Please forward to whoever is maintaining the bochs port to FreeBSD. > > A group of us from the bochs-developers mailing list have taken over > development of Bochs, with Kevin Lawton's support. He has redirected > http://www.bochs.com to our new site at http://bochs.sourceforge.net. We > have made a few bugfix releases to improve the most common problems, and > have an active CVS tree with lots of new features in progress. > > I expect your Bochs port has some diffs since Kevin's 3/25/2000 release > last year. If you would like to submit those diffs as a patch, or (even > better) check out our CVS tree and submit patches against the current CVS, > we will have better FreeBSD support in the future releases. Feel free to > ask for merging advice if you want it, since we've made quite a few > changes since last year. > > The web site describes how to join bochs-developers if you want. Thank you for notification. Attached please fix set of patches against current bochs cvs that required to make it working on FreeBSD. It would be nice if you can itegrate them into the mainline. -Maxim --------------C6AC1C383E005D2EBA75D8E2 Content-Type: text/plain; charset=koi8-r; name="patch-ac" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch-ac" --- iodev/serial.cc.orig Thu Nov 11 21:44:52 1999 +++ iodev/serial.cc Fri Jan 14 00:59:57 2000 @@ -75,8 +75,8 @@ term_new.c_iflag |= IGNBRK; term_new.c_iflag &= ~BRKINT; #endif - term_new.c_iflag |= IXOFF; - tcsetattr(0, TCSAFLUSH, &term_new); + // term_new.c_iflag |= IXOFF; + // tcsetattr(0, TCSAFLUSH, &term_new); #endif // nothing for now #if USE_RAW_SERIAL --------------C6AC1C383E005D2EBA75D8E2 Content-Type: text/plain; charset=koi8-r; name="patch-aa" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch-aa" --- .bochsrc.orig Sun Nov 14 16:01:27 1999 +++ .bochsrc Mon Nov 22 17:44:06 1999 @@ -84,4 +84,4 @@ -#log: /dev/null -log: ./bochs.out +log: /dev/null +#log: ./bochs.out keyboard_serial_delay: 200 --------------C6AC1C383E005D2EBA75D8E2 Content-Type: text/plain; charset=koi8-r; name="patch-ad" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch-ad" $FreeBSD$ --- iodev/cdrom.cc.orig Tue May 15 17:49:56 2001 +++ iodev/cdrom.cc Wed May 16 18:21:21 2001 @@ -52,7 +52,7 @@ } #endif /* __sun */ -#ifdef __OpenBSD__ +#if (defined(__OpenBSD__) || defined(__FreeBSD__)) // OpenBSD pre version 2.7 may require extern "C" { } structure around // all the includes, because the i386 sys/disklabel.h contains code which // c++ considers invalid. @@ -154,7 +154,7 @@ // some ioctl() calls to really eject the CD as well. if (fd >= 0) { -#ifdef __OpenBSD__ +#if (defined(__OpenBSD__) || defined(__FreeBSD__)) (void) ioctl (fd, CDIOCALLOW); if (ioctl (fd, CDIOCEJECT) < 0) BX_DEBUG(( "eject_cdrom: eject returns error.\n" )); @@ -264,7 +264,7 @@ return true; } -#elif defined(__OpenBSD__) +#elif (defined(__OpenBSD__) || defined(__FreeBSD__)) { struct ioc_toc_header h; struct ioc_read_toc_entry t; @@ -402,6 +402,53 @@ BX_DEBUG(( "capacity: %u\n", lp.d_secperunit )); return(lp.d_secperunit); + } +#elif defined(__FreeBSD__) + { + // Read the TOC to get the data size, since disklabel doesn't appear + // to work, sadly. + // Keith Jones, 16 January 2000 + +#define MAX_TRACKS 100 + + int i, num_tracks, num_sectors; + struct ioc_toc_header td; + struct ioc_read_toc_entry rte; + struct cd_toc_entry toc_buffer[MAX_TRACKS + 1]; + + if (fd < 0) + BX_PANIC(("cdrom: capacity: file not open.\n")); + + if (ioctl(fd, CDIOREADTOCHEADER, &td) < 0) + BX_PANIC(("cdrom: ioctl(CDIOREADTOCHEADER) failed\n")); + + num_tracks = (td.ending_track - td.starting_track) + 1; + if (num_tracks > MAX_TRACKS) + BX_PANIC(("cdrom: TOC is too large\n")); + + rte.address_format = CD_LBA_FORMAT; + rte.starting_track = td.starting_track; + rte.data_len = (num_tracks + 1) * sizeof(struct cd_toc_entry); + rte.data = toc_buffer; + if (ioctl(fd, CDIOREADTOCENTRYS, &rte) < 0) + BX_PANIC(("cdrom: ioctl(CDIOREADTOCENTRYS) failed\n")); + + num_sectors = -1; + for (i = 0; i < num_tracks; i++) { + if (rte.data[i].control & 4) { /* data track */ + num_sectors = ntohl(rte.data[i + 1].addr.lba) + - ntohl(rte.data[i].addr.lba); + fprintf(stderr, "cdrom: Data track %d, length %d\n", + rte.data[i].track, num_sectors); + break; + } + } + + if (num_sectors < 0) + BX_PANIC(("cdrom: no data track found\n")); + + return(num_sectors); + } #elif defined WIN32 { --------------C6AC1C383E005D2EBA75D8E2 Content-Type: text/plain; charset=koi8-r; name="patch-ae" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch-ae" --- debug/lexer.c.orig Wed Feb 2 17:00:44 2000 +++ debug/lexer.c Wed Feb 2 17:00:02 2000 @@ -1272,7 +1272,7 @@ case 92: YY_RULE_SETUP #line 108 "lexer.l" -{ bxlval.ulval = strtoull(bxtext, NULL, 10); return(BX_TOKEN_LONG_NUMERIC); } +{ bxlval.ulval = strtouq(bxtext, NULL, 10); return(BX_TOKEN_LONG_NUMERIC); } YY_BREAK case 93: YY_RULE_SETUP --------------C6AC1C383E005D2EBA75D8E2-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message