Re: Boot2 loading process

2006-10-15 Thread Valentin Nechayev
 Sat, Oct 14, 2006 at 21:15:55, jerrymc wrote about Re: Boot2 loading 
process: 

  So my question is: where does the rest of the boot2 binary is located and 
  how is it loaded ?
 You skipped boot1 from attention. boot2 is loaded by boot1, not boot0.
 Not according to that piece of architecture documentation that was quoted.
  www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/book.html#BOOT-BOOT0
 It says that boot1 is used only with floppy boots.

The doc is incorrect, or at least uses less detailed description. One
can see from code that boot0 loads _one_ sector from slice and calls
its code. Initial block of the bootable slice is identical to
/boot/boot1:

$ dd if=/dev/ad0s1a bs=512 count=1 | head -c 446 | md5 -r
42b4daabbfea8c8d3ec45e24b340868a
$ head -c 446 /boot/boot1 | md5 -r
42b4daabbfea8c8d3ec45e24b340868a

And reading code in /usr/src/sys/boot/i386/boot2/boot1.S is enough
to see that it is the routine which loads 8K including boot2.

Maybe documentation clause (that boot0 loads boot2 directly) remains
from other version of boot0, or is used to simplify the description
(because boot1 is silent part and shows something only in case of
fatal error). But it's anyway too simplified as to reply to original
question in this thread.

This difference (boot0 loads boot2 directly or thru boot1) was vital
when 4.x and 5.x resides on the same disk. This was case for my home
machine a few years ago. Boot1 shall be the same version as boot2.
Changes in their interaction caused problem to load FreeBSD from
second slice (it was 5.x), that's why I had to use special boot setup.


-netch-
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Boot2 loading process

2006-10-15 Thread Valentin Nechayev
 Sun, Oct 15, 2006 at 11:33:06, netch wrote about Re: Boot2 loading process: 

 Not according to that piece of architecture documentation that was quoted.
  www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/book.html#BOOT-BOOT0
 It says that boot1 is used only with floppy boots.
 The doc is incorrect, or at least uses less detailed description. One

Heh, according to CVS history this is obsoleted at least for 3.1-release.


-netch-
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Boot2 loading process

2006-10-14 Thread Valentin Nechayev
 Sat, Oct 14, 2006 at 09:41:01, jan.pfeifer wrote about Boot2 loading 
process: 

 I was reading through the architecture handbook 
 (http://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/book.html) 
 about the boot process, and something strange caught my attention.

  According to the docs boot0 loads only the first record of the partition, 
 that is 512bytes. But boot2 in my 4.11 freebsd has  7K in size -- what makes 
 sense, considering the amount of things it does and that it links btxld.
Name it slice, not partition.

 So my question is: where does the rest of the boot2 binary is located and how 
 is it loaded ?

You skipped boot1 from attention. boot2 is loaded by boot1, not boot0.
boot1 resides in first block of FreeBSD slice (or whole disk in dedicated
partitioning). It reads MBR, detects first active FreeBSD slice (or first
FreeBSD slice if none active), loads first 8K from its (they are boot1
+ disklabel + boot2) and passes control to boot2. boot2 is placed in
blocks 2-15 of the FreeBSD slice.

 thanks in advance for any answers!


-netch-
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Boot2 loading process

2006-10-14 Thread Jerry McAllister
On Sat, Oct 14, 2006 at 09:30:53PM +0300, Valentin Nechayev wrote:

  Sat, Oct 14, 2006 at 09:41:01, jan.pfeifer wrote about Boot2 loading 
 process: 
 
  I was reading through the architecture handbook 
  (http://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/book.html) 
  about the boot process, and something strange caught my attention.
 
   According to the docs boot0 loads only the first record of the partition, 
  that is 512bytes. But boot2 in my 4.11 freebsd has  7K in size -- what 
  makes sense, considering the amount of things it does and that it links 
  btxld.
 Name it slice, not partition.
 
  So my question is: where does the rest of the boot2 binary is located and 
  how is it loaded ?
 
 You skipped boot1 from attention. boot2 is loaded by boot1, not boot0.

Not according to that piece of architecture documentation that was quoted.

 www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/book.html#BOOT-BOOT0

It says that boot1 is used only with floppy boots.

So, either the question remains or that oiece of doc is incorrect.

Cheers,

jerry

 boot1 resides in first block of FreeBSD slice (or whole disk in dedicated
 partitioning). It reads MBR, detects first active FreeBSD slice (or first
 FreeBSD slice if none active), loads first 8K from its (they are boot1
 + disklabel + boot2) and passes control to boot2. boot2 is placed in
 blocks 2-15 of the FreeBSD slice.
 
  thanks in advance for any answers!
 
 
 -netch-
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to [EMAIL PROTECTED]
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Boot2 loading process

2006-10-14 Thread Jan Pfeifer
Thanks for the reference Jerry, you are right, from the docs:

boot0: saved into MBR, loads boot2 (the boot1 being the floppy version of it)

But still, according to the docs, boot0 loads only 512 bytes of it.

So thanks for the note Valentin, I understand then that boot0 loads 15 records, 
that is 7.5kb.


many thanks again,

- jan

ps.: the docs also mentions that slices are the FreeBSD jargon for partitions, 
sorry.

- Original Message 
From: Jerry McAllister [EMAIL PROTECTED]
To: Valentin Nechayev [EMAIL PROTECTED]
Cc: Jan Pfeifer [EMAIL PROTECTED]; freebsd-questions@freebsd.org
Sent: Saturday, October 14, 2006 6:15:55 PM
Subject: Re: Boot2 loading process

On Sat, Oct 14, 2006 at 09:30:53PM +0300, Valentin Nechayev wrote:

  Sat, Oct 14, 2006 at 09:41:01, jan.pfeifer wrote about Boot2 loading 
 process: 
 
  I was reading through the architecture handbook 
  (http://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/book.html) 
  about the boot process, and something strange caught my attention.
 
   According to the docs boot0 loads only the first record of the partition, 
  that is 512bytes. But boot2 in my 4.11 freebsd has  7K in size -- what 
  makes sense, considering the amount of things it does and that it links 
  btxld.
 Name it slice, not partition.
 
  So my question is: where does the rest of the boot2 binary is located and 
  how is it loaded ?
 
 You skipped boot1 from attention. boot2 is loaded by boot1, not boot0.

Not according to that piece of architecture documentation that was quoted.

 www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/book.html#BOOT-BOOT0

It says that boot1 is used only with floppy boots.

So, either the question remains or that oiece of doc is incorrect.

Cheers,

jerry

 boot1 resides in first block of FreeBSD slice (or whole disk in dedicated
 partitioning). It reads MBR, detects first active FreeBSD slice (or first
 FreeBSD slice if none active), loads first 8K from its (they are boot1
 + disklabel + boot2) and passes control to boot2. boot2 is placed in
 blocks 2-15 of the FreeBSD slice.
 
  thanks in advance for any answers!
 
 
 -netch-
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to [EMAIL PROTECTED]





___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]