Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Apr 2002 22:38:56 -0700 (PDT)
From:      Annelise Anderson <andrsn@andrsn.stanford.edu>
To:        Francisco Borggia <Prabax@takas.lt>
Cc:        freebsd-newbies@FreeBSD.ORG
Subject:   Re: Open source
Message-ID:  <Pine.BSF.4.10.10204082224440.70640-100000@andrsn.stanford.edu>
In-Reply-To: <MBBBLEJEGBMGIFNCGDMPAECPCBAA.Prabax@takas.lt>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.10204082224440.70640-100000>