From owner-freebsd-current Thu Oct 23 17:01:46 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id RAA07285 for current-outgoing; Thu, 23 Oct 1997 17:01:46 -0700 (PDT) (envelope-from owner-freebsd-current) Received: from hydrogen.nike.efn.org (resnet.uoregon.edu [128.223.170.28]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id RAA07270 for ; Thu, 23 Oct 1997 17:01:40 -0700 (PDT) (envelope-from gurney_j@efn.org) Received: (from jmg@localhost) by hydrogen.nike.efn.org (8.8.7/8.8.7) id RAA17722; Thu, 23 Oct 1997 17:01:30 -0700 (PDT) Message-ID: <19971023170130.55831@hydrogen.nike.efn.org> Date: Thu, 23 Oct 1997 17:01:30 -0700 From: John-Mark Gurney To: Mike Smith Cc: FreeBSD Current Subject: Re: Doug Rabson's kernel linker code.. References: <19971023094120.57364@hydrogen.nike.efn.org> <199710231652.CAA01365@word.smith.net.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.69 In-Reply-To: <199710231652.CAA01365@word.smith.net.au>; from Mike Smith on Fri, Oct 24, 1997 at 02:22:27AM +0930 Reply-To: John-Mark Gurney Organization: Cu Networking X-Operating-System: FreeBSD 2.2.1-RELEASE i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ Sender: owner-freebsd-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Mike Smith scribbled this message on Oct 24: > > > > well.. I was reading through the code to get a better understand of > > > > it.. and I think that we need to export the make variable LOAD_ADDRESS > > > > from the Makefile to kernel, as the file kern/link_aout.c has this same > > > > value hard coded in it... > ... > > > Do you want to do this, or set it at runtime based on the real load > > > address? I realise that at the moment the load address is fixed by the > > > link phase... > > > > actually... I need the information about the kernel's address and the > > size of it... right now it just uses a constant of 0xf0100000 and the > > size is the negative of that... I'm not sure if this information is > > actually used, or is just kept for consistancy... and I don't need the > > information till SI_SUB_KMEM... > > It should be possible at that stage to reference the various symbols > set when the kernel is loaded and started; looking at create_pagetables > in i386/i386/locore.S I see that KERNend is set to the end of the > kernel plus any symbol table. hmm.. any machine independant way to get this information? > Note that other space is allocated after this. > > As far as I can tell, btext is going to be the lowest symbol in the > kernel, so you can prettymuch be sure that: > > extern void *btext; > extern long KERNend; > > will give you some numbers that you can work with. The types are > bogus; I'm not sure this is worth worrying about. Bruce may have more > to say on the topic; this is from inspection only. yeh.. well.. as I stated about.. the file that needs this is kern/link_aout.c... and I don't really want to reference machine specific symbols... unless we require all machines to contain these symbols.. the other option is to do something were we move the running of SYSINIT into kern_linker.c... and then at boot time we simply "link" in the kernel as we do with kld modules... this would require extensions to kern_linker.c to support linking of a memory address.. but this wouldn't be hard to do... -- John-Mark Gurney Modem/FAX: +1 541 683 6954 Cu Networking Live in Peace, destroy Micro$oft, support free software, run FreeBSD