On Sun, Sep 04, 2022 at 06:53:00AM +0100, Jason McIntyre wrote:
> On Sat, Sep 03, 2022 at 06:12:16PM +0000, Klemens Nanni wrote:
> > The current text is badly formatted and incomplete as to which optional
> > parts can be omitted in which way
> > 
> >     The file specification used is of the form:
> >           promdev:partition/filename options
> >     where: ???promdev??? is an optional Open Firmware device name (such as 
> > ???hd???
> >     or ???ide???) and ???partition??? is an optional disk partition number. 
> >  Normal
> >     line editing characters can be used when typing the file specification.
> > 
> > 1. 'partition' seems like an artifact that is not at all parsed as such,
> >    see sys/arch/macppc/stand/ ofwdev.c and main.c where the double colon is
> >    parsed;  the comments confirm this with
> >     * this function is passed [device specifier]:[kernel]
> >    and
> >     * if the kernel image specified contains a ':' it is
> >     * [device]:[kernel], so separate the two fields.
> > 
> >    Manual tests confirm this.
> > 
> > 2. if promdev is given, the double-colon MUST exist.
> 
> double colon?

Colon means "Doppelpunkt" in german, I mistakenly carried over the
Doppel/double part.

> 
> >    'boot hd'  tries to boot the kernel "hd"
> >    'boot hd:' tries to boot the kernel "hd:"
> >    'boot hd:/bsd' does what it says
> >    'boot hd:bsd'  is equivalent to the previous line since ofwboot prepends
> >                   trailing slashes;  don't document to keep it simple
> > 
> > 3. no vertical spacing makes the manual harder to read.
> > 
> > We could zap the entire specification and rely on wording, similar to what
> > boot_sparc64(8) does, but I prefer fixing the specification by removing
> > partition from it and adding proper markup, yielding:
> > 
> >      The file specification used is of the form:
> > 
> >        [promdev:]filename [-acds]
> > 
> >      where promdev is an optional Open Firmware device name (such as hd or
> >      ide).  Normal line editing characters can be used when typing the file
> >      specification.
> > 
> > That should be much clearer.
> > 
> > gkoehler greatly helped in confirming/testing various lines on his hardware.
> > 
> > Feedback? Objection? OK?
> > 
> 
> ok by me, but you probably want a technical ok as well.

Thanks.
I slightly changed the spec to
           [[promdev:]filename] [-acds]
to match boot(8) which I have now also fixed, see below.

> 
> jmc
> 
> > NB: boot(8/macppc) also mentions this, but some parts are plain wrong...
> > I suggest fixing that in a separate diff.

The problem there is that it was copied over from amd64 boot.8 but then
only partly adjusted.

1. amd64 biosboot(8) can boot off any disklabel slices, macppc ofwboot
   only uses 'a' and and it is not possible to specify a label in the
   first place.

2. both amd64 and macppc boot(8) say
        When selecting the device to boot from, boot makes no
        distinction between SCSI and IDE type drives; they are detected
        as ‘hd’ devices.
   which means they attach as hd(4) in the device.
   For amd64 biosboot(8) does take boot devices as 'hd', but macppc only
   takes 'cd', 'ide' and 'hd'... that has nothing to do with the kernel
   driver's name but is entirely an OpenFirmware thing.

   Therefore remove the mention of slices alltogether in macppc's
   boot(8) except for the /etc/boot.conf part which obviously covers
   the OS disk/filesystem;  there explicitly add the slice 'a' since,
   again, macppc always forcec 'a' rather than dynamically picking the
   slice ofwboot itself was loaded from (read amd64 boot(8) for that).

It's still debatable whether we should document things twice in both
manuals, but I don't want to spend too much time on this.

So let's just fix the obvious mistakes and help users navigate through
macppc's boot process.

Feedback? OK?


Index: sys/arch/macppc/stand/boot.8
===================================================================
RCS file: /cvs/src/sys/arch/macppc/stand/boot.8,v
retrieving revision 1.4
diff -u -p -r1.4 boot.8
--- sys/arch/macppc/stand/boot.8        23 Dec 2019 12:44:34 -0000      1.4
+++ sys/arch/macppc/stand/boot.8        4 Sep 2022 15:02:44 -0000
@@ -77,7 +77,7 @@ If the file
 exists on the filesystem in slice
 .Sq a
 on the first disk drive
-.Pq wd0 ,
+.Pq wd0a ,
 open and parse it.
 Lines beginning with the
 .Sq #
@@ -125,29 +125,26 @@ The following commands are accepted at t
 .Nm
 prompt:
 .Bl -tag -width shorten
-.It Ic boot Op Ar image Op Fl acds
-Boots the kernel image specified by
+.It Ic boot Oo Oo Ar device : Oc Ns Ar image Oc Op Fl acds
+Boots the specified kernel image with any options given.
+If
+.Ar device
+or
 .Ar image
-with any options given.
-Image specification consists of a pair
-.Ar device : Ns Ar filename ;
-either or both can be omitted (`:' is not needed if both are omitted),
-in which case values from
+are omitted, values from the
 .Nm
 variables will be used.
 .Pp
 The only bootable devices, at the moment, are IDE devices connected to
 the internal controller;
 they are detected as
-.Sq wd
+.Sq hd
 devices.
 Therefore, to boot kernel
 .Pa /bsd
-from slice
-.Sq a
 on the first hard drive,
 specify
-.Dq boot wd0a:/bsd .
+.Dq boot hd:/bsd .
 .Bl -tag -width _a_
 .It Fl a
 Causes the kernel to ask for the
@@ -205,8 +202,10 @@ Debug flag if
 was compiled with DEBUG defined.
 .It Ic device
 Boot device name (e.g.,
-.Li wd0a ,
-.Li wd1a ) .
+.Li ide ,
+.Li ide0 ,
+.Li hd ,
+.Li hd1 ) .
 .It Ic howto
 Options to pass to the loaded kernel.
 .It Ic image
@@ -277,7 +276,7 @@ Once booted, such changes can be made pe
 .Fl e
 option.
 .Pp
-.Dl boot> boot wd1a:/bsd -c
+.Dl boot> boot hd:/bsd -c
 .Sh SEE ALSO
 .Xr gzip 1 ,
 .Xr autoconf 4 ,
Index: sys/arch/macppc/stand/ofdev.c
===================================================================
RCS file: /cvs/src/sys/arch/macppc/stand/ofdev.c,v
retrieving revision 1.26
diff -u -p -r1.26 ofdev.c
--- sys/arch/macppc/stand/ofdev.c       11 Mar 2021 11:16:59 -0000      1.26
+++ sys/arch/macppc/stand/ofdev.c       3 Sep 2022 17:45:13 -0000
@@ -55,7 +55,6 @@ char opened_name[256];
 
 /*
  * this function is passed [device specifier]:[kernel]
- * however a device specifier may contain a ':'
  */
 static int
 parsename(char *str, char **file)
Index: share/man/man8/man8.macppc/boot_macppc.8
===================================================================
RCS file: /cvs/src/share/man/man8/man8.macppc/boot_macppc.8,v
retrieving revision 1.21
diff -u -p -r1.21 boot_macppc.8
--- share/man/man8/man8.macppc/boot_macppc.8    14 Feb 2014 12:18:27 -0000      
1.21
+++ share/man/man8/man8.macppc/boot_macppc.8    4 Sep 2022 15:02:41 -0000
@@ -93,16 +93,15 @@ If the special line
 is entered, the bootloader will attempt to restart the machine.
 .Pp
 The file specification used is of the form:
-.Dl promdev:partition/filename options
-where:
-.Dq promdev
+.Pp
+.Dl Oo Oo Ar promdev : Oc Ns Ar filename Oc Op Fl acds
+.Pp
+where
+.Ar promdev
 is an optional Open Firmware device name (such as
 .Dq hd
 or
-.Dq ide )
-and
-.Dq partition
-is an optional disk partition number.
+.Dq ide ) .
 Normal line editing characters can be used when typing the file
 specification.
 .Pp

Reply via email to