From owner-freebsd-newbies Mon Apr 8 22:43:43 2002 Delivered-To: freebsd-newbies@freebsd.org Received: from andrsn.stanford.edu (andrsn.Stanford.EDU [171.66.112.163]) by hub.freebsd.org (Postfix) with ESMTP id 4EE2337B404 for ; Mon, 8 Apr 2002 22:43:37 -0700 (PDT) Received: from localhost (localhost.stanford.edu [127.0.0.1]) by andrsn.stanford.edu (8.11.6/8.11.6) with ESMTP id g395cud70672; Mon, 8 Apr 2002 22:38:56 -0700 (PDT) (envelope-from andrsn@andrsn.stanford.edu) Date: Mon, 8 Apr 2002 22:38:56 -0700 (PDT) From: Annelise Anderson To: Francisco Borggia Cc: freebsd-newbies@FreeBSD.ORG Subject: Re: Open source In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-newbies@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Sun, 7 Apr 2002, Francisco Borggia wrote: > It is an open source system. OK , but how to read > it? > There is a heep of files. Where does the execution > begin after everything > is loaded? Well, execution begins with booting the system--from the boot blocks, then using /boot/loader (or not), loading the kernel, running the very first process which is usually init, and then reading /etc/rc and following its commands. Most of this is binaries compiled from source code; the source is there, but it's not what gets executed. The scripts in /etc are interpreted rather than compiled in advance, though. But they too are source code. If you want to find out how the system boots, you could read man boot, man loader, man init, and man rc. Reading /etc/rc and "tracking" through what it does and what it reads (like the other rc.* scripts) is a useful way to understand how the system starts up. Once it is started up, a lot of stuff (various processes) is already running. > When I read some C code for Windows or DOS, > there is Winmain() or main() > functions. What is here of that kind? The source code (what the programmers wrote), if you installed it, is in /usr/src. A great deal of this is written in C. In /usr/src/sbin/init, for example, you will find the code for init, and in init.c is a "main()" function. But this is not used when the system starts up; the init binary (in /sbin/init) is what is used. This is where the "open source" is. >Where some > general skeleton of this > OS or source about source can be found? Give right > direction somebody,please. UNIX System Administration Handbook by Nemeth et.al. gives a summary of how UNIX (including BSD) systems start. Once you log in, your shell (which is a compiled binary) is also running. The shell interprets what you type at the command line-- some of the commands are shell "builtins" and some of the commands call programs. For example ls is a program that lists the files in a directory. You run a UNIX program by typing its name. I am sure some of the above is not quite precise, but it might help as a general overview. Annelise -- Annelise Anderson Author of: FreeBSD: An Open-Source Operating System for Your PC Available from: BSDmall.com and amazon.com Book Website: http://www.bittreepress.com/FreeBSD/introbook/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-newbies" in the body of the message