DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

kernel(ADM)


kernel -- determine or verify name of booted UNIX system

Syntax

/etc/kernel [ -qsuv ] [ -x level ] [ -B check ] [ -c ] [ -e bootstring ]... [ -f file ]...

Description

The kernel utility outputs the full pathname of the currently booted operating system image. kernel converts the extended UNIX system filenames used by boot(HW) into standard pathnames.

By default, kernel applies several heuristic checks to verify that the standard pathname contains the currently booted operating system image. Optionally, kernel can also write the converted name to an auxiliary file along with sufficient information to verify its correctness.

Commands can use the optional auxiliary check file to determine the name of the currently booted operating system image.

kernel accepts the following options:


-B check
Specifies the name of the check file. The default is /etc/ps/booted.system.

-c
Verify the check file describing the currently booted operating system.

-e bootstring
If bootstring appears to be an extended UNIX system filename as used by boot, kernel converts it into a standard pathname which it then checks. If the checks fail, or bootstring is not an extended UNIX system filename, then kernel assumes bootstring to be a standard pathname and checks it.

-f file
kernel decodes the first line in file and checks it in the same way as for the -e option.

-q
Print only the first filename which passes the heuristic checks. By default, kernel prints every pathname which passes the checks.

-s
Silent: do not print the name of any file which passes the heuristic checks.

-u
If the name of the currently booted system can be determined, generate a new check file which describes the currently booted operating system.

-v
Verbose: explain why if a pathname is not the currently running operating system image.

-x level
Set the level checking performed on each pathname:

0
no checks

10
pathname is a regular file which exists

20
pathname is a regular file which exists, and contains an operating system image

30
pathname is a regular file which exists, contains an operating system image, and the operating system image has the same identification data; equivalent to the traditional checking done by ps(C)

40
pathname is a regular file which exists, contains an operating system image, the operating system image has the same identification data, and if the booted inode is known, it must be the pathname; this is the default level

Note that level 40 requires additional support from boot which is not present in older versions of the operating system; if this is the case, level 40 is identical to level 30.

kernel decodes multiple -e, -f, and -c options and checks them in left-to-right order. kernel only prints pathnames on the standard output which pass the checks; the -s option suppresses printing.

A level specified by the -x option applies to all -e, -f, and -c options.

If none of the options -e, -f, or -c is specified then kernel assumes -q and first checks /unix (the usual booted image). If that is not the booted image, kernel decodes and checks the bootstring in /dev/string/boot.

By default, kernel does not use a check file.

Examples

The default when no options are specified is identical to:

kernel -q -e /unix -f /dev/string/boot

In the usual case this is equivalent to:

kernel -q -e /unix -e "hd(40)unix"

As shown above, it may be necessary to quote bootstrings to protect them from interpretation by the shell.

The command kernel -c verifies the default check file (/etc/ps/booted.system). If this passes the check, kernel prints the name of the booted image as recorded in that file.

Early in the startup sequence, the command kernel -u -s silently generates a /etc/ps/booted.system file that names the booted operating system image. This usually remains valid until a new kernel is built and installed.

Limitations

kernel ignores any keywords following the extended UNIX system filename in a bootstring.

In order to decode a bootstring such as foo(42)somewhere/unix, the indicated driver foo must be configured into the running system and the filesystem in the minor device (42) must be mounted. To check the decoded pathname, the implied pathname somewhere/unix must exist in that filesystem and be readable by kernel.

Most operating system images are protected, so for most users kernel cannot check pathnames successfully.

If kernel fails to open /etc/mnttab, any file specified with -f, or (when required) /dev/kmem, it prints a message to the standard error output and terminates.

kernel does not understand network pathnames used by boot.

Files


/dev/kmem
provides access to kernel virtual memory

/dev/string/boot
name of the booted image according to boot

/etc/mnttab
table of currently mounted filesystems

/etc/ps/booted.system
default check file naming the currently booted operating system image

/unix
usual booted operating system image

See also

boot(HW), mem(FP), mnttab(F), mount(ADM), ps(C), string(M)
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003