Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Apr 1999 19:37:17 -0700 (PDT)
From:      papowell@astart4.astart.com
To:        abial@webgiro.com, papowell@astart4.astart.com
Cc:        freebsd-small@FreeBSD.ORG
Subject:   Re: archive site for freebsd-mail
Message-ID:  <199904290237.TAA07823@astart4.astart.com>

next in thread | raw e-mail | index | archive | help
> From abial@webgiro.com Tue Apr 27 11:06:16 1999
> Date: Tue, 27 Apr 1999 20:07:23 +0200 (CEST)
> From: Andrzej Bialecki <abial@webgiro.com>
> To: papowell@astart4.astart.com
> Cc: freebsd-small@FreeBSD.ORG
> Subject: Re: archive site for freebsd-mail
>
> On Tue, 27 Apr 1999 papowell@astart4.astart.com wrote:
>
> > I hate to ask this,  but I have just spend a slew of time
> > trying to find this,  but are the FreeBSD mailing lists
> > archived somewhere?
> > 
> > 1.  If they are,  could the FreeBSD.org main web page have a link
> >     to a page listing the locations of the sites?
>
> They are, and the Web pages say so (http://www.freebsd.org/mail).
>
> Andrzej Bialecki
>
> //  <abial@webgiro.com> WebGiro AB, Sweden (http://www.webgiro.com)
> // -------------------------------------------------------------------
> // ------ FreeBSD: The Power to Serve. http://www.freebsd.org --------
> // --- Small & Embedded FreeBSD: http://www.freebsd.org/~picobsd/ ----
>
>

Voila!  After a seriously hard day of pounding,  code reading, and
sacrificing my lunch time,  I seem to have created a floppy...

Not content with this,  I have taken the various scripts, etc., 
and written comments for them.  Now, you say 'WHY DO THIS'...

I know, I know... comments... documentation... whimpy stuff.

But perhaps this might help the next person.  If there is any interest,
I would be pleased/willing to post my notes on

     Generating PICOBSD Floppies Using FreeBSD 3.1-RELEASE

Also,  for your enjoyment,  here is a description of just what happens
during the boot process of the floppy,  together with a massaged version
of the 'stage3' script:


### we return to our original directory,  and copy the kernel to the floppy image
###  kernel
cd ${pwd}
cp kernel.gz /mnt/kernel.gz
rm kernel.gz

### now we add the boot loader - boot1 and boot2 were done by disklabel
### 
### Here is the boot sequence:
###   (boot0 on floppy sector 0/0/1) loaded into memory and executed
###   boot1 finds UNIX partition, brings in boot2, starts execution of boot2
###   Boot1 usually does things using BIOS facilities
###   Boot2 has quite a bit of the UNIX ufs file system, and can understand UFS
###     file systems.
###   boot2 will open /boot.config,  read THE SINGLE LINE IN THE FILE,
###      and interpret it as the name of a kernel and some options to pass
###      to the kernel.
###  The PICOBSD setup initializes boot.config with
###          /boot/loader
###      which tells boot2 to use the /boot/loader code as a kernel.
###
###  What is this all about?  The answer is simple:  we want to be able to
###      configure the devices by using the 3rd Stage Loader.  But this
###      loader is a little big,  so we use the kzip  (kernel zip) facility
###      to compress it and attach a bit of code to decompress and then run
###      the compressed code.
###  
###   The /boot/loader will now uncompress itself and will then read the
###       (documented in the source code) file
###             /boot/loader.rc
###   This contains a list of commands that the loader understands.
###       (Aside: /boot/loader.rc used to be /boot/boot.conf in earlier FreeBSD
###       releases, and this name is is pretty close to boot.config (see above).
###       I wonder how many people this has confused?)
###
###   The /boot/loader.rc file contains the following commands:
###        load /kernel
###        load -t userconfig_script /kernel.config
###        boot -P
###    (see /usr/src/boot/common/help.common for list of commands)
###
###   load /kernel loads /kernel into memory, and the boot -P
###    line will boot it with the -P (use serial console if no keyboard) option.
###        (see  man boot for details of the flags)
###   
###   The load -t userconfig_script /kernel.config
###   sets the kernel's 'userconfig_script' option value to
###   "/kernel.config".  The 'userconfig' module in the kernel
###   (see /usr/src/sys/i386/i386/userconfig.c for the nasty details)
###   will open and read this file,  getting commands to set device
###   configuration and other things.
###   These commands can be:
###                         example
###  di      disable dev    di de0
###  dr      drq dev #      dr 4
###  ei      # EISA slots   ei 4
###  en      enable dev     en ep0
###  ex      exit (quit)    ex
###  f       flags dev mask f  de0 0xff
###  h       help
###  intro   intro screen
###  iom     iomem dev addr iom ed0 0xdf0000
###  ios     iosize dev size iosize ed0 0x1000
###  ir      irq dev #      irq ed0 5
###  l       ls, list       l
###  pn      pnp ...        pnp
###  po      port dev addr  port ed0 0x300
###  res     reset CPU      res
###  q       quit           q
###  v       visual mode    v
###          
###   I strongly suspect that this has been included strictly as a Tour de Force
###   example of how to make the loading as flexible as possible, etc, without
###   needing to compile a special version of the boot code.
###
###   Finally,  after all this work,  the kernel is loaded into memory,
###   and kernel execution is started.   Of course we have compressed the
###   kernel, so it will promptly uncompress itself and start execution.
###
###   The userconfig module is started,  it reads the /kernel.config file,
###   and then,  since we have generated our kernel with the INTRO_USERCONFIG
###   option, the kernel will go into VISUAL userconfig
###   operation.
###
###   To stop the loader from going into /kernel.config
###    user interactive mode automatically,  you need to modify the
###    PICOBSD configuration file.  Remove the 
###      options         INTRO_USERCONFIG        #imply -c and parse info area
###   And regenerate the kernel.
###
###   Suggested Alternatives
###
###            Skipping the /boot/loader
###     To do this, set /boot.config to contain only '-P'
###    By default, you will get the kernel loaded.  You should also
###    compile the kernel without the INTRO_USERCONFIG option.
###

# we make a compressed loader
mkdir /mnt/boot
cp /boot/loader .
kzip -v loader
mv loader.kz /mnt/boot/loader
rm -f loader loader.o

# set up the /boot.config file to cause boot2 to load /boot/loader
echo "/boot/loader" >/mnt/boot.config

# set up the /boot/loader.rc to cause the /boot/loader to
#  load in the kernel and set options
cat  >/mnt/boot/loader.rc <<EOF
load /kernel
load -t userconfig_script /kernel.config
boot -P
EOF

( echo "-> Fixing permissions"; cd /mnt; chown -R root * )

### little bit of information for users
df -ik /mnt
ls -Rl /mnt

umount /mnt
# and we are finished
vnconfig -u /dev/rvn0


Patrick Powell                 Astart Technologies,
papowell@astart.com            9475 Chesapeake Drive, Suite D,
Network and System             San Diego, CA 92123
  Consulting                   619-874-6543 FAX 619-279-8424 
LPRng - Print Spooler (http://www.astart.com)


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-small" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199904290237.TAA07823>