Re: The first file loaded is?

2010-02-08 Thread Jerry McAllister
On Mon, Feb 08, 2010 at 09:23:41AM -0500, 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!

Well, the first thing executed is the BIOS.  
It discovers an MBR to suck in and transfer control to.
The MBR that it chooses is the one on the first one of its
list of boot devices that has an MBR.   That all is pretty much
the same for all PC systems regardless of OS.  Once it loads and
transfers control to the MBR it is dependand on the OS.  The MBR
generally checks a couple things and chooses a boot sector from one
of the bootable partitions to read in and hand over control to.

If you poke around in man pages for boot and init you will learn a lot
of what you are asking.

jerry 
  
> 
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
> 
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: The first file loaded is?

2010-02-08 Thread Ivan Voras

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.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


The first file loaded is?

2010-02-08 Thread Decker, Ross
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!

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"