From owner-freebsd-hackers@FreeBSD.ORG Thu Aug 21 16:37:31 2008 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E8471065674 for ; Thu, 21 Aug 2008 16:37:31 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (unknown [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id 880578FC12 for ; Thu, 21 Aug 2008 16:37:30 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.2/8.14.2) with ESMTP id m7LGbRYf008359; Thu, 21 Aug 2008 18:37:28 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.2/8.14.2/Submit) id m7LGbRhJ008358; Thu, 21 Aug 2008 18:37:27 +0200 (CEST) (envelope-from olli) Date: Thu, 21 Aug 2008 18:37:27 +0200 (CEST) Message-Id: <200808211637.m7LGbRhJ008358@lurza.secnetix.de> From: Oliver Fromme To: freebsd-hackers@FreeBSD.ORG X-Newsgroups: list.freebsd-hackers User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.3-STABLE (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Thu, 21 Aug 2008 18:37:28 +0200 (CEST) Cc: Subject: Boot loader + malloc X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-hackers@FreeBSD.ORG List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Aug 2008 16:37:31 -0000 Hello, I've got a small question regarding $subject. I'm looking at this code snippet from src/sys/boot/i386/loader/main.c: #if defined(LOADER_BZIP2_SUPPORT) || defined(LOADER_FIREWIRE_SUPPORT) heap_top = PTOV(memtop_copyin); memtop_copyin -= 0x300000; heap_bottom = PTOV(memtop_copyin); #else heap_top = (void *)bios_basemem; heap_bottom = (void *)end; #endif setheap(heap_bottom, heap_top); If I understand correctly, the boot loader will use only low memory (i.e. below 0x100000) for malloc by default. Extended memory is only used if bzip2 or firewire support are enabled (not default). Is this intentional? Would it make sense to toggle the default and always use extended memory, unless disabled? I'm asking because the upcoming graphics support requires a little bit of memory for fonts and images, but there's only less than about 80 KB left in low memory, which is insufficient except for very trivial things. The loader kept crashing on me in nasty ways because of that. In my p4 branch I modified the above #if to also use extended memory if LOADER_GRAPHICS_SUPPORT is defined, giving me 3 MB of memory to play with, which is plenty. Is that OK, or should I expect trouble? Any comments are appreciated. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "One of the main causes of the fall of the Roman Empire was that, lacking zero, they had no way to indicate successful termination of their C programs." -- Robert Firth