From owner-cvs-all Tue Dec 17 13:21: 9 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1FA5A37B401 for ; Tue, 17 Dec 2002 13:21:08 -0800 (PST) Received: from smtp011.mail.yahoo.com (smtp011.mail.yahoo.com [216.136.173.31]) by mx1.FreeBSD.org (Postfix) with SMTP id 0DEF643EE6 for ; Tue, 17 Dec 2002 13:21:07 -0800 (PST) (envelope-from john_m_cooper@yahoo.com) Received: from pc016247.reshall.uidaho.edu (HELO ?129.101.136.30?) (john?m?cooper@129.101.136.30 with plain) by smtp.mail.vip.sc5.yahoo.com with SMTP; 17 Dec 2002 21:21:03 -0000 Subject: Re: cvs commit: src/sys/boot/i386/boot2 boot2.c From: John Merryweather Cooper To: Peter Jeremy Cc: John Baldwin , "M. Warner Losh" , cvs-all@freebsd.org, cvs-committers@freebsd.org In-Reply-To: <20021217202351.GO15322@gsmx07.alcatel.com.au> References: <20021217.103409.105683273.imp@bsdimp.com> <20021217202351.GO15322@gsmx07.alcatel.com.au> Content-Type: text/plain Organization: University of Idaho Message-Id: <1040160158.20854.29.camel@pc016247.reshall.uidaho.edu> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.0 Date: 17 Dec 2002 13:22:38 -0800 Content-Transfer-Encoding: 7bit Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, 2002-12-17 at 12:23, Peter Jeremy wrote: > On 2002-Dec-17 12:40:38 -0500, John Baldwin wrote: > >We could shave a lot of room off of boot2 by having it be a real-mode > >application instead of a protected mode one. This would allow us to > >ditch all of BTX. However, we would either need to use a C compiler > >that can generate real-mode code (gcc can't AFAIK) or we need to > >write it all in assembly. I'd really like to avoid the latter if at > >all possible. Any chance that gcc might could be tweaked to add a > >real-mode target? > > 80x86 real mode (16-bit) is significantly different to 32-bit mode - > the addressing modes are almost completely different for starters. > Supporting real-mode and generating decent compact code in particular > is going to require significantly more than a simple 'tweak' to gcc. > > The i386 backend definitely provides a good starting point for a > real-mode backend, but it's not immediately clear whether real-mode > would be better implemented as a new backend (which means building > a new gcc cross compiler just to compile boot2) or as a patch to > the i386 backend (which would bloat and slow down the main system > compiler). > > Probably the easiest way to play with a real-mode boot2 would be > to install something like ports/devel/bcc - the code quality isn't > as good as gcc[*] but should allow you to check the feasibility of > the project. > > [*] This isn't a slur on bde - a _lot_ more effort has gone into gcc. > > Peter Well, a real-mode boot2 would certainly give devel/bcc a chance to develop. Along those lines, the Open Watcom project now has it's development sources online, and the Open Watcom compiler, descended from the Watcom commercial compiler, is now online. See http://www.openwatcom.org/license_info/open_watcom_lic.html Since this compiler already has 286 real mode capability (an essential function since OS/2 device drivers mostly have 286 protect-mode code and OS2KRNL starts up as a 286 real mode program which then hands off . . .), these sources maybe of interest. My brief reading of the license indicates that it would not crimp a FreeBSD-style project very much (although it would be difficult for an FSF project to swallow). jmc -- John Merryweather Cooper University of Idaho To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message