Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Jan 1996 10:22:35 -0500 (EST)
From:      A boy and his worm gear <wpaul@skynet.ctr.columbia.edu>
To:        peter@jhome.DIALix.COM (Peter Wemm)
Cc:        current@freebsd.org
Subject:   Re: Odd question.. ;-)
Message-ID:  <199601041522.KAA04556@skynet.ctr.columbia.edu>
In-Reply-To: <Pine.BSF.3.91.960104213427.476A-100000@jhome.DIALix.COM> from "Peter Wemm" at Jan 4, 96 09:43:52 pm

next in thread | previous in thread | raw e-mail | index | archive | help
Of all the gin joints in all the world, Peter Wemm had to walk into
mine and say:

> Hi all..
> 
> I have a strange question..  (even stranger since it's from somebody who 
> should know.. :-)
> 
> How do I update the boot code to -current? :-)
> 
> Last time I messed with disklabel and /usr/mdec, I ended up trashing my 
> system beyond repair..  I've not looked again in something like 12 months.
> 
> Basically, I want to install a new /usr/mdec/boot2, because this system 
> has a version 2.0.5 boot2 that has the missing LF during boot.. :-)  
> (real crisis, eh? :-)
> 
> So, what do I do?  disklabel -B sd0 ?  I think last time I did that, I 
> lost the fdisk tables...  but I dont really remember...
> 
> Cheers,
> -Peter

It should be disklabel -B sd0. I do disklabel -B wd0 all the time; works
fine for me, though I generally test it on a floppy first to make sure 
the new boot block actually works before committing it to my hard disk 
(disklabel -B fd0).

By the way, since somebody brought up the boot loader: I have an idea
for a change that I'd like to run by some people. (It's a small change.
Really. :)

The other day I decided to swap the graphics card from my old machine
to my new one (the old one had an ISA ET4000 card; the new one has an
integrated VGA adapter based on some Cirrus Logic chipset -- it works
fine with X except it only has 512K of video RAM whereas the ET4000 has
1 MB, and I wanted to get 1024x768 resolution without having to order
new chips). This left the old machine headless; no problem since I've
been using a dumb terminal with it for some time now, so it was just a
matter of setting it up in serial console mode.

Unfortunately, for whatever the reason, the keyboard probe in the
boot block thinks that my keyboard is still plugged in even when it
really isn't, so it wouldn't default over to serial console mode.
I was going to compile a custom boot block with the serial console
mode hardwired on, but then a thought struck me.

The boot block already has enough brains to search for specific 
files in the rootfs, so I thought: instead of using a keyboard probe,
which is unreliable, why not have it look for a dummy file, like /.serial 
for instance, and have it switch over to serial console mode if it
finds it. This way, all you need to do to activate serial console mode
is 'touch /.serial; reboot'.

So I tried it, and lo and behold it worked out pretty well. :) The
only extra thing I want to do but didn't have time to rig up initially
is to have the boot block poll the keyboard while trying to read
from the disk and have it stop if it detects a keypress so that you
could force it back to normal VGA mode in case you 'accidentally'
create /.serial and want to get control back.

The upshot is that you can support dynamically switching to serial
console mode without the keyboard probe. You could even make a
serial console boot.flp image just by writing the new boot block to it
and creating a /.serial file on it.

So, what do you think? Sound like something that should be in -current?
Inquiring minds want to know.

-Bill

-- 
=============================================================================
-Bill Paul            (212) 854-6020 | System Manager
Work:         wpaul@ctr.columbia.edu | Center for Telecommunications Research
Home:  wpaul@skynet.ctr.columbia.edu | Columbia University, New York City
=============================================================================
License error: The license for this .sig file has expired. You must obtain
a new license key before any more witty phrases will appear in this space.
=============================================================================



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