Re: Multiple kernels selector...

2001-09-16 Thread Warner Losh

[[ Please excuse me for replying to a one year old message, but I have 
   a question or two ]]

In message [EMAIL PROTECTED] Daniel C. Sobral writes:
: . Loading /boot/current.conf. Please wait... cr
: s /boot/current.conf read-conf

What's the difference beteen . and s?

: s /boot/stable.conf read-conf

What should go in /boot/stable.conf vs /boot/current.conf?

also, is there a good way of clearing out the environment and starting 
over?  If I'd like to load /boot/loader.conf from inside of
stable.conf or current.conf after setting currdev?

What I'm trying to do:

I have a disk (ad0) in my laptop.  It has two slices (one BSD one
DOS).  The BSD slice has partitions a, b, e, f, and g.  I'd like to
put current on partition g and stable on a.  I'd like a stable
command that sets up the environment to boot stable and a current
command that sets it up to do current.  Can I do that or am I SOL?

Warner

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: Multiple kernels selector...

2001-09-16 Thread Michael Reifenberger

On Sun, 16 Sep 2001, Warner Losh wrote:

 In message [EMAIL PROTECTED] Daniel C. Sobral writes:
 : . Loading /boot/current.conf. Please wait... cr
 : s /boot/current.conf read-conf

 What's the difference beteen . and s?
A . dot command does print the TOS (Top of Stack) usually.
. does print a constant string.
So .FOO does print FOO.
s does put a constant string on top of the stack.
Which seemd to get used by read-conf later on.

I hope my memory didn't fool me here.

Bye!

Michael Reifenberger
^.*Plaut.*$, IT, R/3 Basis, GPS


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: Multiple kernels selector...

2001-09-16 Thread Michael Reifenberger

On Sun, 16 Sep 2001, Warner Losh wrote:
...
 What's the difference beteen . and s?

BTW: Following the Tutorials link on
http://ficl.sourceforge.net/ficl.html
there is at least on good-looking Forth primer.

Bye!

Michael Reifenberger
^.*Plaut.*$, IT, R/3 Basis, GPS


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: Multiple kernels selector...

2001-09-16 Thread Daniel C. Sobral

Warner Losh wrote:
 
 [[ Please excuse me for replying to a one year old message, but I have
a question or two ]]
 
 In message [EMAIL PROTECTED] Daniel C. Sobral writes:
 : . Loading /boot/current.conf. Please wait... cr
 : s /boot/current.conf read-conf
 
 What's the difference beteen . and s?
 
 : s /boot/stable.conf read-conf
 
 What should go in /boot/stable.conf vs /boot/current.conf?
 
 also, is there a good way of clearing out the environment and starting
 over?  If I'd like to load /boot/loader.conf from inside of
 stable.conf or current.conf after setting currdev?
 
 What I'm trying to do:
 
 I have a disk (ad0) in my laptop.  It has two slices (one BSD one
 DOS).  The BSD slice has partitions a, b, e, f, and g.  I'd like to
 put current on partition g and stable on a.  I'd like a stable
 command that sets up the environment to boot stable and a current
 command that sets it up to do current.  Can I do that or am I SOL?

Do you know the Japanese ISO image with three versions selector: 3.x,
4.x and current? That might help some, as might the stuff in
/usr/share/examples/bootforth.

Now, to the questions:

.  prints 
s  places a string on the stack. It must be used only inside
definitions, because, otherwise, the space where the string is placed is
reused.

No, there is no way of clearing out the environment. As a matter of
fact, a few environment variables are actually set by loader itself, and
at least these should be preserved. Since environment variables are not
FICL-bound, such a command might as well be done entirely in C and
provided as a builtin.

The module stuff, though, must be taken care of in Forth. If I ever find
time, this stuff will be dealt with using environment variables too,
but...

My own boot environment, which is available with slight variations on
/usr/share/examples/bootforth, presents me with a menu which present me
the option of loading, in addition to the other conf files, stable.conf,
current.conf or nothing else. I see no reason why you couldn't set
currdev before doing it.

-- 
Daniel C. Sobral(8-DCS)
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]

wow regex humor... I'm a geek

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Multiple kernels selector...

2000-09-05 Thread Daniel C. Sobral

This is an adaptation from menuconf.4th:

\ Simple greeting screen, presenting basic options.
\ XXX This is far too trivial - I don't have time now to think
\ XXX about something more fancy... :-/
\ $FreeBSD: /c/ncvs/src/share/examples/bootforth/menuconf.4th,v 1.4
1999/09/29 04:46:01 dcs Exp $

: title
." Welcome to BootFORTH!" cr cr
;

: menu
." 1.  Start FreeBSD with /boot/stable.conf." cr
." 2.  Start FreeBSD with /boot/current.conf." cr
." 3.  Start FreeBSD with standard configuration. " cr
." 4.  Reboot." cr cr
;

: tkey  ( d -- flag | char )
seconds +
begin 1 while
dup seconds u if
drop
-1
exit
then
key? if
drop
key
exit
then
repeat
;

: prompt
." Enter your option (1,2,3,4): "
10 tkey
dup 32 = if
drop key
then
dup 0 if
drop 51
then
dup emit cr
;

: (reboot) 0 reboot ;

: main_menu
begin 1 while
title
menu
prompt
cr cr
dup 49 = if
drop
." Loading /boot/stable.conf. Please wait..." cr
s" /boot/stable.conf" read-conf
0 boot-conf exit
then
dup 50 = if
drop
." Loading /boot/current.conf. Please wait..."
cr
s" /boot/current.conf" read-conf
0 boot-conf exit
then
dup 51 = if
drop
." Proceeding with standard boot. Please
wait..." cr
0 boot-conf exit
then
dup 52 = if
drop
['] (reboot) catch abort" Error rebooting"
then
." Key " emit ."  is not a valid option!" cr
." Press any key to continue..."
key drop cr
repeat
;

This reads stable.conf or current.conf depending on option 1 or 2 (or
standard boot for option 3), and then boots. You can simplify it in the
following way. Replace the lines

s" /boot/stable.conf" read-conf
0 boot-conf exit

(and similar for current.conf) with the line

s" kernel.stable" 1 boot-conf exit

and you'll just try to boot the standard configuration using the kernel
named kernel.stable. If you need to match modules to kernels, keep both
kernel and modules in the same directory, under either root or /boot,
for each kernel/modules set. Then, if you want to boot the kernel and
modules inside the directory /boot/stable or /stable, for example, you
replace the two lines with:

s" stable" 1 boot-conf exit

You can, of course, add more options easily. And you can mix all of the
above options: .conf files names, kernel names and directory names,
depending on what option you choose.

Put this stuff in a file (asciimenu.4th, for example) and then replace
the "start" on loader.rc with the following:

s" /boot/asciimenu.4th" fopen dup fload fclose
initialize drop
main_menu

-- 
Daniel C. Sobral(8-DCS)
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]

OK, so the solar flares are my fault.. I am sorry, ok?!?!


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message