The HP-UX kernel may be configured using the command line method or SAM. First, you will see how to do it using the command line. The SAM method will be presented at the end of the chapter. The kernel reconfiguration process may be divided into the following phases.
The kernel configuration file is /stand/system . Whenever you need to build a new kernel, you need to prepare a new configuration file. The best way is to build a configuration file from the running kernel using the system_prep command and then make changes to it. See the examples of system_prep on the following pages. Before starting the kernel build process, you should look at the existing kernel parameters. The sysdef command analyzes the running system and shows its tunable parameters. A typical output of the command follows .
# sysdef NAME VALUE BOOT MIN-MAX UNITS FLAGS acctresume 4 - -100-100 - acctsuspend 2 - -100-100 - allocate_fs_swapmap 0 - - - bufpages 26214 - 0- Pages - create_fastlinks 0 - - - dbc_max_pct 10 - - - dbc_min_pct 10 - - - default_disk_ir 0 - - - dskless_node 0 - 0-1 - eisa_io_estimate 768 - - - eqmemsize 19 - - - file_pad 10 - 0- - fs_async 0 - 0-1 - hpux_aes_override 0 - - - maxdsiz 16384 - 0-655360 Pages - maxfiles 1024 - 30-2048 - maxfiles_lim 2048 - 30-2048 - maxssiz 2048 - 0-655360 Pages - maxswapchunks 2111 - 1-16384 - maxtsiz 16384 - 0-655360 Pages - maxuprc 1000 - 3- - maxvgs 20 - - - msgmap 67043328 - 3- - nbuf 26780 - 0- - ncallout 7016 - 6- - ncdnode 150 - - - ndilbuffers 30 - 1- - netisr_priority -1 - -1-127 - netmemmax 0 - - - nfile 12690 - 14- - nflocks 200 - 2- - ninode 11464 - 14- - no_lvm_disks 0 - - - nproc 7000 - 10- - npty 300 - 1- - nstrpty 300 - - - nswapdev 10 - 1-25 - nswapfs 10 - 1-25 - public_shlibs 1 - - - remote_nfs_swap 0 - - - rtsched_numpri 32 - - - sema 0 - 0-1 - semmap 314507264 - 4- - shmem 0 - 0-1 - shmmni 1024 - 3-1024 - streampipes 0 - 0- - swapmem_on 1 - - - swchunk 2048 - 2048-16384 kBytes - timeslice 10 - -1-2147483648 Ticks - unlockable_mem 14200 - 0- Pages -
From the sysdef output you find out what the values of tunable kernel parameters on your system are. After finding these values, you are in a better position to decide what changes are needed. In addition, you may want to see a list of hardware attached to your system before adding or deleting any device drivers. For this purpose you use the ioscan command. A part of the output from the ioscan command is shown below.
# ioscan -f Class I H/W Path Driver S/W State H/W Type Description ============================================================================= bc 0 root CLAIMED BUS_NEXUS bc 1 8 ccio CLAIMED BUS_NEXUS I/O Adapter ba 0 8/0 GSCtoPCI CLAIMED BUS_NEXUS PCI Bus Bridge lan 5 8/0/1/0 gelan CLAIMED INTERFACE HP 1000Base-SX ba 1 8/4 GSCtoPCI CLAIMED BUS_NEXUS PCI Bus Bridge lan 6 8/4/1/0 gelan CLAIMED INTERFACE HP 1000Base-SX ba 2 8/8 GSCtoPCI CLAIMED BUS_NEXUS PCI Bus Bridge lan 0 8/8/1/0 btlan4 CLAIMED INTERFACE PCI(10110009) lan 1 8/8/2/0 btlan4 CLAIMED INTERFACE PCI(10110009) ba 3 8/12 GSCtoPCI CLAIMED BUS_NEXUS PCI Bus Bridge lan 2 8/12/1/0 btlan4 CLAIMED INTERFACE PCI(10110009) lan 3 8/12/2/0 btlan4 CLAIMED INTERFACE PCI(10110009) bc 2 10 ccio CLAIMED BUS_NEXUS I/O Adapter ext_bus 0 10/0 c720 CLAIMED INTERFACE GSC Wide SCSI target 0 10/0.1 tgt CLAIMED DEVICE disk 0 10/0.1.0 sdisk CLAIMED DEVICE SEAGATE ST34572 target 1 10/0.2 tgt CLAIMED DEVICE disk 1 10/0.2.0 sdisk CLAIMED DEVICE SEAGATE ST34572 target 2 10/0.3 tgt CLAIMED DEVICE disk 2 10/0.3.0 sdisk CLAIMED DEVICE SEAGATE ST34572 target 3 10/0.4 tgt CLAIMED DEVICE disk 3 10/0.4.0 sdisk CLAIMED DEVICE SEAGATE ST34572 target 4 10/0.5 tgt CLAIMED DEVICE disk 4 10/0.5.0 sdisk CLAIMED DEVICE Quantum XP34361 target 5 10/0.6 tgt CLAIMED DEVICE disk 5 10/0.6.0 sdisk CLAIMED DEVICE SEAGATE ST15150 target 6 10/0.7 tgt CLAIMED DEVICE ctl 0 10/0.7.0 sctl CLAIMED DEVICE Initiator bc 3 10/4 bc CLAIMED BUS_NEXUS Bus Converter tty 0 10/4/0 mux2 CLAIMED INTERFACE MUX ext_bus 1 10/8 c720 CLAIMED INTERFACE GSC SCSI target 7 10/8.7 tgt CLAIMED DEVICE ctl 1 10/8.7.0 sctl CLAIMED DEVICE Initiator ba 4 10/12 bus_adapter CLAIMED BUS_NEXUS Core I/O Adapte ext_bus 3 10/12/0 CentIf CLAIMED INTERFACE Parallel Interf ext_bus 2 10/12/5 c720 CLAIMED INTERFACE Built-in SCSI target 8 10/12/5.0 tgt CLAIMED DEVICE tape 0 10/12/5.0.0 stape CLAIMED DEVICE HP C1537A target 9 10/12/5.2 tgt CLAIMED DEVICE disk 6 10/12/5.2.0 sdisk CLAIMED DEVICE TOSHIBA CD-ROM target 10 10/12/5.7 tgt CLAIMED DEVICE ctl 2 10/12/5.7.0 sctl CLAIMED DEVICE Initiator lan 4 10/12/6 lan2 CLAIMED INTERFACE Built-in LAN ps2 0 10/12/7 ps2 CLAIMED INTERFACE Keyboard/Mouse bc 4 10/16 bc CLAIMED BUS_NEXUS Bus Converter bc 5 12 ccio CLAIMED BUS_NEXUS I/O Adapter bc 6 14 ccio CLAIMED BUS_NEXUS I/O Adapter ext_bus 4 14/8 c720 CLAIMED INTERFACE GSC add-on target 11 14/8.0 tgt CLAIMED DEVICE disk 7 14/8.0.0 sdisk CLAIMED DEVICE SEAGATE ST34572 target 12 14/8.1 tgt CLAIMED DEVICE disk 8 14/8.1.0 sdisk CLAIMED DEVICE SEAGATE ST34572 target 13 14/8.2 tgt CLAIMED DEVICE disk 23 14/8.2.0 sdisk CLAIMED DEVICE SEAGATE ST34572 target 14 14/8.3 tgt CLAIMED DEVICE disk 24 14/8.3.0 sdisk CLAIMED DEVICE SEAGATE ST34572 target 15 14/8.7 tgt CLAIMED DEVICE ctl 3 14/8.7.0 sctl CLAIMED DEVICE Initiator target 16 14/8.11 tgt CLAIMED DEVICE disk 25 14/8.11.0 sdisk CLAIMED DEVICE SEAGATE ST34572 disk 26 14/8.11.1 sdisk CLAIMED DEVICE SEAGATE ST34572 disk 27 14/8.11.2 sdisk CLAIMED DEVICE SEAGATE ST34572 disk 28 14/8.11.3 sdisk CLAIMED DEVICE SEAGATE ST34572 disk 29 14/8.11.4 sdisk CLAIMED DEVICE SEAGATE ST34572 disk 30 14/8.11.5 sdisk CLAIMED DEVICE SEAGATE ST34572 disk 31 14/8.11.6 sdisk CLAIMED DEVICE SEAGATE ST34572 disk 32 14/8.11.7 sdisk CLAIMED DEVICE SEAGATE ST34572 target 17 14/8.12 tgt CLAIMED DEVICE disk 33 14/8.12.0 sdisk CLAIMED DEVICE SEAGATE ST34572 disk 34 14/8.12.1 sdisk CLAIMED DEVICE SEAGATE ST34572 disk 35 14/8.12.2 sdisk CLAIMED DEVICE SEAGATE ST34572 disk 36 14/8.12.3 sdisk CLAIMED DEVICE SEAGATE ST34572 disk 37 14/8.12.4 sdisk CLAIMED DEVICE SEAGATE ST34572 disk 38 14/8.12.5 sdisk CLAIMED DEVICE SEAGATE ST34572 disk 39 14/8.12.6 sdisk CLAIMED DEVICE SEAGATE ST34572 disk 40 14/8.12.7 sdisk CLAIMED DEVICE SEAGATE ST34572 processor 0 32 processor CLAIMED PROCESSOR Processor processor 1 34 processor CLAIMED PROCESSOR Processor processor 2 36 processor CLAIMED PROCESSOR Processor processor 3 38 processor CLAIMED PROCESSOR Processor memory 0 49 memory CLAIMED MEMORY Memory
Similarly, you can use the lanscan command to view the network interfaces installed in your computer. You can also use the -C option with the ioscan command to find information about a particular class of devices. For example, you can type: ioscan -fC disk to obtain an ioscan of only the disk devices. After getting this information, create a new configuration file with the following two steps.
Go to the directory /stand/build using the cd command.
cd /stand/build
Use the system_prep command to create a new system file from the running system.
/usr/lbin/sysadm/system_prem -s system
Once this system file is created in the /stand/build directory, edit it to make the appropriate changes. A typical system file is as follows.
* Drivers and Subsystems CentIf CharDrv DlkmDrv GSCtoPCI arp asp autofsc beep btlan4 c720 ccio cdfs clone core diag0 diag2 dlkm dlpi dmem echo fc fcT1 fcT1_fcp fc_arp fcgsc fcgsc_lan fcms fcp fcp_cdio fcparray fcpdev ffs gelan hp_apa hpstreams inet ip kload klog lan2 lasi ldterm lv lvm mux2 netdiag1 netqa nfs_client nfs_core nfs_server nfsm nms nuls pa pci pckt pipedev pipemod prm ps2 ptem ptm pts rawip sad sc sctl sdisk sio stape stcpmap strlog strpty_included strtelnet_included tcp telm tels timod tirdwr tlclts tlcots tlcotsod token_arp tun udp ufs uipc vxadv vxbase wsio * Kernel Device info dump lvol * Tunable parameters STRMSGSZ 65535 dbc_max_pct 10 dbc_min_pct 10 maxfiles 256 maxswapchunks 2113 maxuprc 500 maxusers 64 msgmap 258 msgmax 65536 msgmnb 65536 msgmni 200 msgseg 8192 msgtql 256 nfile 11500 ninode 11500 nproc 7000 npty 300 nstrpty 300 semmni 600 semmns 600 semmnu 600 semume 600
The first part shows the drivers and subsystems included in the kernel. Remove any drivers you don't need. You can make a decision while referring to the output of the ioscan command. Also remove any subsystem that is not required. The second part is the dump device information. The third part is the kernel tunable parameters. You may want to change any value here. After you are done with the changes, save the system file and move on to the next step of compiling the kernel.
To build a new kernel, you use the mk_kernel command.
/usr/sbin/mk_kernel -s ./system
The mk_kernel command uses master and library files from the /usr/conf directory. Files for any additional modules are expected to be in the /stand/system.d directory. If the kernel rebuild process is successful, the newly built kernel executable file is created in the /stand/build directory with the name vmunix_test .
As you already know, the default HP-UX kernel and system files are in the /stand directory with the names vmunix and system , respectively. You need to copy the new kernel and the system files into their default locations. But before that, you must create a backup copy of the existing working kernel. This is required so you can boot from the previous kernel if the new kernel fails to boot the system. You can back up the previous kernel and install the new kernel using the following sequence of commands.
mv /stand/system /stand/system.old mv /stand/vmunix /stand/vmunix.old mv /stand/build/system /stand mv /stand/build/vmunix_test /stand/vmunix
Now the previous kernel is saved with name vmunix.old and can be used in case of emergency.
After building and installing the new kernel, you can reboot the system. This is necessary because the new kernel does not load until you reboot. If all goes well, your system will reboot with the new kernel. Use sysdef to make sure that the changes have taken place.
Top |