From owner-freebsd-questions@FreeBSD.ORG Mon Feb 8 15:13:51 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AAAB106568B for ; Mon, 8 Feb 2010 15:13:51 +0000 (UTC) (envelope-from freebsd-questions@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id 5561E8FC2E for ; Mon, 8 Feb 2010 15:13:51 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1NeVIy-0001la-97 for freebsd-questions@freebsd.org; Mon, 08 Feb 2010 16:13:40 +0100 Received: from lara.cc.fer.hr ([161.53.72.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 08 Feb 2010 16:13:40 +0100 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 08 Feb 2010 16:13:40 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-questions@freebsd.org From: Ivan Voras Date: Mon, 08 Feb 2010 16:12:48 +0100 Lines: 24 Message-ID: References: <3C2D9FDCACFBCB4183516E784E9DC7DE17D09128@cocoaex3.brevard.cc.fl.us> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.5) Gecko/20100118 Thunderbird/3.0 In-Reply-To: <3C2D9FDCACFBCB4183516E784E9DC7DE17D09128@cocoaex3.brevard.cc.fl.us> Sender: news Subject: Re: The first file loaded is? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2010 15:13:51 -0000 On 02/08/10 15:23, Decker, Ross wrote: > I'm just starting my adventure into BSD along with C++. I know that > this OS gives you all the source files that are used in the OS. What I'm > asking, is what is the name of the first file that is loaded and where > is the source file for it? I want to start with the very first line of > code and see if I can step my way through the entire boot process. There > are many things that I see during boot up that I have no idea what they > are (SMAP Type....) that aren't that Google Friendly. > > So if anyone knows the names of the source files and their locations for > the boot sequence could you please post them..... SUPER thank you's! Your question is very vague. The first executed code on an IBM-PC is the boot loader, look at sys/boot/boot0. First executed lines of the kernel are at mi_startup() in sys/kern/init_main.c. First executed lines of userland code are in the "init" process, in sbin/init/init.c. All paths are relative to /usr/src.