From owner-freebsd-arm@FreeBSD.ORG Sat May 12 23:36:10 2012 Return-Path: Delivered-To: arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 599FA1065672 for ; Sat, 12 May 2012 23:36:10 +0000 (UTC) (envelope-from tim@kientzle.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 25C598FC16 for ; Sat, 12 May 2012 23:36:10 +0000 (UTC) Received: by pbbro2 with SMTP id ro2so5322730pbb.13 for ; Sat, 12 May 2012 16:36:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=3BG1cp2NgfU7Z3mjVr4LsHHt72h2Oz7E2VNmQfvNRqM=; b=PWX3av3fPYCQ3oNn5UMAG9gbW8joPmwQXrpdG+TK0q+wZTiSgTwwUkdk7l+4qHoz37 YwRWUfj8kw3eZj7GXcTkWmUtkUkBoEspyJ3o4l8edzOQi1If5KOBsof1Zu+gDuE9U1wF +TZRemNKLG4iAEsdgA0wmkK540xW+nQADiuvzxFPHE4nA5fH7Z9wU6XLOvMax6eLZlC6 rUNnk2jRuh6gkxinPRPaSPY4AjejO6SBuH1F1xKDbnPMniKBTl3CoRXw2v1WQV94CvkP RD4HSZGXcgoZCZt0lc0tbvbXIjISE842mxi9FjRIT4XRRvTecDPUL3SFsRZxmGQpzyIY bQzg== Received: by 10.68.231.164 with SMTP id th4mr8550692pbc.97.1336865769634; Sat, 12 May 2012 16:36:09 -0700 (PDT) Received: from [192.168.1.69] (99-74-169-43.lightspeed.sntcca.sbcglobal.net. [99.74.169.43]) by mx.google.com with ESMTPS id nv2sm17283070pbb.6.2012.05.12.16.36.06 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 12 May 2012 16:36:08 -0700 (PDT) Sender: Tim Kientzle Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=windows-1252 From: Tim Kientzle In-Reply-To: Date: Sat, 12 May 2012 16:36:04 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <3B2A320B-3ADE-4F48-B94E-4F0886178251@freebsd.org> <201205070957.03842.jhb@freebsd.org> <8B01DF29-747A-449C-A762-E852F57C6380@freebsd.org> To: Marcel Moolenaar X-Mailer: Apple Mail (2.1257) X-Gm-Message-State: ALoCoQkVM01dUiXG6/KiirjGLoF2iJj74zikYh/Ogsu1IbJBKUOI8jWDQBpmTOUnD6l/GcZtDFvQ Cc: arm@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: How does loader(8) decide where to load the kernel? X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 May 2012 23:36:10 -0000 On May 10, 2012, at 5:32 AM, Marcel Moolenaar wrote: >=20 > On May 8, 2012, at 1:32 AM, Tim Kientzle wrote: >>>> On i386, amd64, powerpc, and arm, loadimage subtracts >>>> the dest value from the address declared in the actual ELF >>>> headers so that the kernel always gets loaded into low memory. >>>> (there's some intermediate bit-twiddling I'm glossing over, but >>>> this is the general idea). >>>=20 >>> The bit twiddling is supposed to be the equivalent of subtracting >>> KERNBASE from the load address. On both i386 and amd64, there is >>> a direct mapping of the kernel text such that KERNBASE maps address >>> 0, etc. By default on i386 KERNBASE is 0xc0000000. >>=20 >> Exactly my problem. This all assumes that you're loading >> the kernel into low memory. >>=20 >> On the AM3358, the DRAM starts at 0x8000 0000 >> on boot, so I'm trying to find a clean way to convince >> the loader's ELF code to put the kernel there. >=20 > Look at what I did for ia64. All that frobbing should be done > in the machine specific implementation of arch_copyin, arch_copyout > and arch_readin. It's a kluge to do it in elf_loadimage. That sounds like a reasonable approach. I've started working down that path=85 but it looks like I'll have to fix a lot of the FDT code along the way. Tim