3b1 3.51a kernel

Roger Abrahams roger at marque.mu.edu
Mon Apr 18 00:10:05 AEST 1988


In article <270 at amanue.UUCP> jr at amanue.UUCP (Jim Rosenberg) writes:
<In article <339 at icus.UUCP> lenny at icus.UUCP (Lenny Tropiano) writes:
<>|>This brings up another question, has anyone or can you build a bootable
<>|>floppy which you can run, of course, a minimal system under?  [...]
<>
<>Yeah, I been experimenting with this with minimal luck.  I know that the
<>".vl and .sl" extentions on the fdfmt and fdfmt10 command create floppies
<>with the system loader on it.  I've booted them with a copy of /unix and
<>other stuff and it still seems to want to boot off the hard disk.
<
<I haven't played with this on a 3b1, but did make bootable floppies for Venix
<on a PC-type machine, & I believe the principle is the same.  Your kernel
<(/unix) has "wired" into it rootdev, pipedev, and swapdev -- at least that's
<what they are on some systems.  These are direct references into the device
<switch table, if I'm not mistaken.  Copying /unix from your hard disk onto a
<file system on a floppy will *definitely* have these set for the hard disk.
<On systems with configuration rights (I think the going phrase these days is
<"Link Kit") you have to make a new kernel to get these to recognize the floppy
<instead of the hard disk.  On some systems this is all in /usr/sys/conf/c.c,
<if my memory is still intact.
<
<None of this helps a bit for the 3b1.  Don't we get some kind of tunable
<parameters?  Hmm.  /etc/lddrv/unix.sym has values for rootdev, pipedev, and
<swapdev.  One might be able to sdb a copy of /unix and just change these.
<***CAREFUL*** though, I see lots of other symbols in there that don't look too
<familiar that might need to be changed too.
<
<Of course the *easy* way is to snarf the kernel from a floppy that's already
<bootable.  Has anyone tried mounting one of the bootable floppies and rooting
<around for a kernel?

Dead right Charlie!  The bootable floppy version is on Disk #2 of the 
Foundation set.  Disk #3 contains the file system and Disk #4 has the 
bootable version for the hard disk.

So - make it this way:

1.  Format a disk that is bootable.  To do this you must use a descriptor
that has a loader mentioned in it.  These are found in /usr/lib/iv.  I suggest
using one that also has a definition for 10 sectors also, as anything will
have a shortage of space.  Probably AT&T (or Convergent) does it with
multiple disks for this reason.  Anyway this should work:

	iv -i /dev/rfp020 /usr/lib/iv/FD10vl
	mkfs /dev/rfp021
	dismount -f

2.  Mount Disk #2 of the foundation set and you will find a copy of "unix"
and a link to it with the version in it (I.E. "UNIX3.51").  Copy "unix"
into a temporary directory.  Dismount Disk #2, mount up your bootable
master and move "unix" onto it.  Link it to the other name on the disk.

	mount /dev/fp021 /mnt
	cp /mnt/unix /tmp/unix
	sync;sync;sync
	dismount -f
	(now switch disks)
	mount /dev/fp021 /mnt
	mv /tmp/unix /mnt
	ln /mnt/unix /mnt/UNIX3.51
	sync;sync;sync
	dismount -f

3.  Now you need a file system. It won't fit, but the process looks like
this: 
	
	mount /dev/fp021 /mnt #(using disk #3 of the Foundation set.)
	cd /mnt
	tar cf - . |( cd /usr/mnt; tar xf - ) #This will make a copy of
					      #the file system.
	sync;sync;sync;
	dismount -f

At this point you should "cd /usr/tmp/etc" and modify your "profile".  I
just removed the original and replaced it with this:

	PATH=:/mnt/bin:/mnt/usr/bin:/bin:/etc; export PATH
	mount /dev/fp002 /mnt
	/bin/sh

With this structure as your bootable floppy, you will put you in a shell 
(no cursor) and will have the hard disk mounted so you can use the /bin and 
/usr/bin directories on it.  Remember that the hard disk is now /mnt.  So if 
you need to modify say "gettydefs", it is now in "/mnt/etc/gettydefs".

You can also muck around removing stuff you don't need.  I deleted the
stuff in "/usr/tmp/etc/convert" and that directory.  Delete as much as
you can as you need to reduce the size in order to get it back on the
disk.  Actually, it is impossible to reduce it enough.  YOu should end
up with a disk with about 660 free blocks.  Version 3.51 of unix is 330
blocks so you will have only 330 blocks left to play with.  The file 
system for V3.51 is 674 blocks so you can see that you really can't even
have the essentials!  But since this is an intellectual exercise anyway,
you should attempt to make a minimal system.  I leave this as an exercise
to you as I have a 80 track drive I do this on, and it all fits with spare
space.  Anyway, having done the impossible and made a minimal system in
/usr/tmp,  Put it on the disk:

	mount /dev/fp021 /mnt #(using the bootable master)
	cd /usr/tmp
	tar cf - . |(cd /mnt; tar xf - )
	sync;sync;sync
	dismount -f

You should now have a floppy which will boot up using the floppy as the
root device, etc.  It will still pause and ask you to insert "Disk #3 of
the Foundation Set" but just hit a space or return and it will merrily go
on and find its own file system.

A further fun thing, is when you have your floppy "unix" in /tmp, you just
might want to do "cmp -l /tmp/unix /unix" and this will reveal the locations
of the bytes and what they contain, that are different for the rootdev, etc.

<-- 
< Jim Rosenberg
<     CIS: 71515,124                         decvax!idis! \
<     WELL: jer                                   allegra! ---- pitt!amanue!jr
<     BIX: jrosenberg                  uunet!cmcl2!cadre! /

						- Good Luck
						- Roger



More information about the Comp.sys.att mailing list