Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Dec 1998 14:07:19 +0800
From:      Peter Wemm <peter@netplex.com.au>
To:        Warner Losh <imp@village.org>
Cc:        "Jordan K. Hubbard" <jkh@zippy.cdrom.com>, current@FreeBSD.ORG
Subject:   Re: HEADS UP: FLAG DAY COMING (was Re: New aout-to-elf build failures.) 
Message-ID:  <199812310607.OAA89665@spinner.netplex.com.au>
In-Reply-To: Your message of "Wed, 30 Dec 1998 22:45:53 MST." <199812310545.WAA00555@harmony.village.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
Warner Losh wrote:
> In message <14276.915081197@zippy.cdrom.com> "Jordan K. Hubbard" writes:
> : OK, starting now:  HEADS UP!  -current will going exclusively to ELF
> : on January 6th, 1999!  Install those new boot blocks now, before it
> : becomes even more imperative! :-)
> 
> Might not be a bad idea to have heads ups like this have a subject
> line more like the above, so people don't miss it so easily.
> 
> Does this mean that we must be using ELF kernels by Jan 6?
> 
> Warner

Well.. I think it'll be possibe to use a.out for a while, at least as long 
as there is a source-only upgrade path from a.out to elf, simply because 
there is an a.out buildworld and a.out upgrade kernel installed in the 
process.

What will most likely happen is that the do-nothing option will be taken 
away.

Note that some sort of a.out support will need to be buried in there as 
long as we try to support a source-only upgrade.  Other options include a 
small binary toolchain "kit" to enable an elf 'make world' to work on an 
otherwise a.out system.

It seems the cat is out of the bag now already.. I was trying to put 
together a more complete HEADS UP message, but it looks like I missed out 
by about 10 minutes.

I'll attach a copy on the end.  Hopefully it'll head off a few riots and 
pre-answer a heap of questions and concerns.  BEWARE, I've attached it 
as-is, it's not complete, has not been run past people who should approve 
it, etc.  Although it says that it's been decided, it hasn't been run past 
the people who are going to have to help make it work.  Major showstoppers 
(referred to in the draft below) include things like Mafia hit squads 
hunting us down. :-]

Sorry to drop this on folks like this, but we really do need to light a 
few fires under our collective backsides and get this over and done with.

(All things being equal, the voxware/pcvt issue should be well and truely 
settled by then too.  Lack of voxware/pcvt should not be an issue for 
jumping on board this when the time comes).

Cheers,
-Peter

=== INCOMPLETE DRAFT ===
The time to complete the ELF transition has come.  More to the point, 
progress has stopped and there is no sign of things getting going and
finishing off the remaining rough edges without a bit more of a shove.

Please read this through carefully before getting out the flamethrowers
or starting a reply.

There are some known problems and rough edges still.  They are not getting
fixed because not enough of the *developers* are using it.  Note that
people installing 3.0-RELEASE get ELF by default, and 3.0.1 will have
an ELF kernel too.  We *need* to get the remaining developers (kicking
and screaming if necessary) onto the bandwagon or the current outstanding
problems are going to be present in 3.0.1 as well.

The state of the ELF world today is that just about everything important
works for just about everybody.

Specifically:
- The userland builds, installs and runs "just fine" as ELF, and has done
  so for a long time (I believe over a year).
- a.out binaries and libraries work unmodified.  There is no need
  to toss out /usr/local/bin.  The libraries get moved to
  /usr/local/lib/aout so there are no naming conflicts and the ldconfig
  paths can handle this.
- The kernel builds and runs as an ELF file.
- /boot/loader can load static aout and elf kernels, as well as do
  KLD preloading for ELF.  a.out and ELF kernels have had KLD enabled
  in them for over a month.
- The new bootblocks default to /boot/loader, but there are some problems
  for some people still.  This needs to be fixed, and either the new
  bootblocks need fixing or the old bootblocks need a cutdown and
  modified to fire up /boot/loader by default.
- The new bootblocks can load an a.out and ELF /kernel directly without
  /boot/loader.  (handy if you happen to break it or want to revert to
  /boot/loader.old :-).
- KLD's work and are a superset of LKM's.  You can build a.out and ELF
  KLD modules.  You can load a.out KLD's on an ELF kernel and ELF KLD's on
  an a.out kernel without noticing the difference.

In all, we're about as ready as we're ever going to be without getting
more people bashing at the code.

However, the problems and risks:
- OLD bootblocks apparently cannot load /boot/loader.  We do not yet know
  why.  We need to know why and preferably what to change in /boot/loader's
  headers to make it work.  This seems to affect only systems installed
  with 2.0.x, 2.1.x and early 2.2.x bootblocks that have never had them
  upgraded.
- 'make aout-to-elf' is known to have a few bumps when coming from some
  versions of 2.2.x and some -current builds from the last few months.
  There are other ways of ELF bootstrapping if building the source
  proves too difficult or takes too much space.  I personally have upgraded
  two machines by installing a new binary bindist and then doing a normal
  'make world' on the now ELF system to clean up the loose ends and bring it
  up to date.  I didn't have a.out binaries to worry about though.
- currently existing a.out LKM's will be truely dead.  This may be a problem
  for the one known 3rd party binary LKM, namely OSS.  (No, we don't have
  something against sound drivers, in spite of what it looks like :-).
- A 'make install' by an unwary -current user could install an ELF
  /kernel and strand themselves if they have got OLD bootblocks that cannot
  load /boot/loader, or if they do not know to just type "/boot/loader" at
  the boot: prompt to get out of the jam.

The plan:

January 6 becomes The Day.  (E2-day?  E-squared day? :-)

On that day, 'make world' to build an a.out would will be blocked.  Not
destroyed, not removed, just blocked.  I would like it to be sufficiently
crippled so that it isn't too hard to get going again in an emergency or
if somebody is really badly affected.  Perhaps something like:
  'make -DYES_I_KNOW_THIS_IS_ON_BORROWED_TIME world'  or requiring the
src/Makefile* file to be edited to remove the block.  It would be a waste
if 95% of people reflexively turned on a hook in /etc/make.conf out of
laziness, resistance to change, whatever, if it's too easy to take the
'do nothing' option.  People must then do a 'make aout-to-elf' or install
an ELF binary dist or something.

On the same day, the default kernel format would get changed to ELF..
People can do a 'echo /boot/loader > /boot.config' or install new bootblocks
(disklabel -B da0 / wd0 etc).  As insurance to try and avoid feet getting
blown off and people getting stranded with unbootable systems, either
use a small bootblock reader to check that new bootblocks are in place,
or force the user to manually set a flag to signify that they have done
something about the bootstrap issue.

Barring any *really*major* showstoppers, this will go ahead in the early
hours of January 6 (in the USA) and later in the day for the rest of the
world due to timezone differences.

What you can do right now:

1: Test the /boot/loader on your system from the boot: prompt to make sure
   it loads up and doesn't crash or reboot on the spot.

2: Prepare some emergency boot floppies *now* in case.  Get the 3.0 boot
   and fixit floppies from CD or from ftp.freebsd.org.

3: Build a new floppy with the new bootblocks, new boot loader and see that
   it works on your system.  To do this:
     1: get a formatted floppy ready
     2: disklabel -Brw -b /boot/boot1 -s /boot/boot2 /dev/rfd0.1440 fd1440
     3: newfs -T fd1440 /dev/rfd0.1440
     4: mount /dev/fd0.1440 /mnt
     5: mkdir /mnt/boot
     6: cp /boot/loader /mnt/boot/loader
     7: cp /kernel /mnt/kernel
     8: touch /mnt/boot/boot.conf
     9: umount /mnt
   And try it out.  You should see the "FreeBSD/i386 BOOT" message and a boot:
   prompt.  It should initiate /boot/loader a few seconds later, and the
   3rd stage loader should start.  It should say "starting /kernel in
   10 seconds" and do a countdown.  If this works and it loads the kernel
   from floppy, then you are clear.  (Yes, the kernel is expected to panic
   since it doesn't have a real rootfs or /sbin/init).
   You can abort the autostart and have a play around.  You can do things
   like:
     set currdev=disk1s1a  (hard disk root)
     load /kernel          (your real kernel)
     boot -s               (start in single user).
   You can also try typing "/kernel" at the first boot: prompt.
   You may also like to try building an ELF kernel
   (cd compile/FOO; make KERNFORMAT=elf depend; make KERNFORMAT=elf)
   and copy that somewhere that you can try it out.

4: If you are happy that the new bootblocks work, update your bootblocks
   on your hard disk.  MAKE SURE YOU HAVE A FALLBACK IF YOU GET STRANDED!
   Ideally have the sysinstall boot/fixit floppy handy at all times.

This is what a successful boot looks like using the new bootblocks and
/boot/loader.  (Yes, this kernel is a little old)

>> FreeBSD/i386 BOOT
Default: 0:da(0,a)/boot/loader
boot: 
text=0x1000 data=0x1b000 bss=0x0 symbols=[+0x0]
entry=0x100000
Console: serial port
BIOS drive A: is disk0
BIOS drive C: is disk1

FreeBSD/i386 bootstrap loader, Revision 0.2  639/64512kB
(root@beast.netplex.com.au, Fri Oct 16 23:15:13 WST 1998)
> set bootfile=/kernel
> autoboot 10
Hit [Enter] to boot immediately, or any other key for command prompt.
Booting [/kernel] in 9 seconds...
Booting [/kernel]...               
/kernel text=0xe1348 data=0x12994+0x1b9f0 syms=[0x4+0x191b0+0x4+0x14fa5]
BIOS basemem: 639K, extmem: 64512K (from 0xe801 call)
Copyright (c) 1992-1998 FreeBSD Inc.
Copyright (c) 1982, 1986, 1989, 1991, 1993
	The Regents of the University of California. All rights reserved.
FreeBSD 3.0-CURRENT #263: Sat Dec  5 18:29:39 WST 1998
    peter@beast.netplex.com.au:/home/src/sys/compile/BEAST
Timecounter "i8254"  frequency 1193182 Hz
CPU: Pentium Pro (686-class CPU)
  Origin = "GenuineIntel"  Id = 0x619  Stepping=9
  Features=0xfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV>
real memory  = 67108864 (65536K bytes)
config> quit
avail memory = 62861312 (61388K bytes)
Programming 24 pins in IOAPIC #0
FreeBSD/SMP: Multiprocessor motherboard
 cpu0 (BSP): apic id:  0, version: 0x00040011, at 0xfec08000
 cpu1 (AP):  apic id: 12, version: 0x00040011, at 0xfec08000
 io0 (APIC): apic id: 13, version: 0x00170011, at 0xfec00000
Preloaded elf kernel "kernel" at 0xf0240000.
Probing for devices on PCI bus 0:
[..]

Note the 'preloaded elf kernel' bit.  This is the in-kernel linker (KLD)
finding itself in the tables that the /boot/loader prepared for it.

Finally..  Try a 'make aout-to-elf-build' and make sure it works.  If it
does, make sure you've backed up any critical data and try a
'make aout-to-elf-install' and see how you go.  Note that on a pre-3.0
system you will need to convert your kernel config to 3.0 level and
place it as src/sys/i386/conf/GENERICupgrade.  copy plain GENERIC and
start from that if necessary.

Note that aout-to-elf will not install an ELF kernel for you.  Just
do one thing at a time and build an updated ELF kernel later.

== END OF INCOMPLETE DRAFT ==


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



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