From owner-freebsd-hackers Mon Aug 25 12:31:28 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id MAA03492 for hackers-outgoing; Mon, 25 Aug 1997 12:31:28 -0700 (PDT) Received: from eddie.mit.edu (EDDIE.MIT.EDU [18.62.0.6]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id MAA03483 for ; Mon, 25 Aug 1997 12:31:24 -0700 (PDT) Received: by eddie.mit.edu id aa03017; 25 Aug 97 15:10 EDT Received: from ccomp.inode.com by eddie.mit.edu id aa02990; 25 Aug 97 15:09 EDT Received: (from gdk@localhost) by ccomp.inode.com (8.6.9/1.3) id PAA00599; Mon, 25 Aug 1997 15:05:53 -0400 From: Gary Kendall Message-Id: <199708251905.PAA00599@ccomp.inode.com> Subject: Re: Sizing mem > 64MB at boot-time To: Mike Smith Date: Mon, 25 Aug 1997 15:05:53 -0400 (EDT) Cc: freebsd-hackers@freebsd.ORG In-Reply-To: <199708250232.MAA01084@word.smith.net.au> from Mike Smith at "Aug 25, 97 12:02:01 pm" X-Mailer: ELM [version 2.4ME+ PL17 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@freebsd.ORG X-Loop: FreeBSD.org Precedence: bulk > > Any help anyone can give me in sorting out segments and/or operand sizes > > in real-mode would be greatly appreciated. > > Jonathan Lemon (jlemon@freebsd.org) recently announced some code for > calling real-mode BIOS functions from the FreeBSD kernel, which should > cover everything you want to do here. > > I haven't had time to follow it through yet, regrettably, but you should > definitely coordinate with him. > > mike > Mike, I saw Jonathan's post re real-mode access from the kernel, and I got a copy of the code (which should prove to be quite usefull for DOS emulation), but it won't solve the problem I'm trying to solve. I want the boot program to size the memory so that the kernel, during initialization, can use the memory size to allocate buffers, etc. Jonathan's code doesn't come into play until the machine has already booted the kernel, and is executing it. His real-mode code is through a system call interface, and as such, happens "too late" for my purposes. However, it would be nice if someone familiar with the biosboot code and/or Intel processors could look at what I have written and point me in the right direction with respect to accessing a buffer while in real-mode. As near as I can tell, prot_to_real() (in /sys/i386/apm/apm_init/real_prot.S) sets all of the segment registers (cs, ds, es, and ss) to APM_INIT_CS16_SEL. This means that the code, data, extra, and ??stack?? segments are all the same. What I can't seem to figure out is how to get gas to assign a buffer pointer in this configuration. Does this mean that I can't use .lcomm to allocate the buffer, and that I have to use .space, with the buffer in the code segment? Huh? ;-) Regards, Gary Kendall %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % The difficult is done immediately, the impossible takes a little longer. % %----------------------------------------------------------------------------% % gdk@ccomp.inode.com or gkendall@eddie.mit.edu % %----------------------------------------------------------------------------% % Creative Computing * 96 Forest Street * Danvers, MA 01923 * 508-777-3784 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%