From owner-freebsd-hackers Mon Jul 23 16:16:21 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from meow.osd.bsdi.com (meow.osd.bsdi.com [204.216.28.88]) by hub.freebsd.org (Postfix) with ESMTP id F058D37B42B for ; Mon, 23 Jul 2001 16:16:00 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: from laptop.baldwin.cx (john@jhb-laptop.osd.bsdi.com [204.216.28.241]) by meow.osd.bsdi.com (8.11.4/8.11.2) with ESMTP id f6NNFqv05840; Mon, 23 Jul 2001 16:15:52 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Mon, 23 Jul 2001 16:16:00 -0700 (PDT) From: John Baldwin To: Weiguang SHI Subject: RE: jmp after setting PE? Cc: freebsd-hackers@FreeBSD.org Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 23-Jul-01 Weiguang SHI wrote: > Thanks. > I think I've found it in btx.s: > > 213 mov %eax,%cr0 # > 214 ljmp $SEL_SCODE,$init.8 # To 32-bit code > 215 .code32 > 216 init.8: xorl %ecx,%ecx # Zero > > And there IS this "ljmp". Yes. > Well, this BTX thing is amazing: all this effort, (btxld, run-time > library crt0.o, loader, etc.) seems to just to provide a 32-bit > protected and possibly paging-enabled environment to start the > kernel/loader(and to confuse a new-comer like me.) What are the > other gains? Where can I found more info about this BTX before going > through the ultimate source code? (I've search the mailing-lists.) That's its purpose, to provide a mini-kenrel for the loader so we can write the loader in C and not assembly. (gcc doesn't do well with generating code for real mode). -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message