Hitchhiker's Guide to Openbsd


Download 1.27 Mb.
Pdf ko'rish
bet79/258
Sana04.04.2023
Hajmi1.27 Mb.
#1328980
1   ...   75   76   77   78   79   80   81   82   ...   258
Bog'liq
obsd-faq49

Building a custom kernel
In this case, we will build a kernel that supports the 
boca(4)
 ISA multi-port serial card. This card is not 
in the GENERIC kernel, due to conflicts with other drivers. There are two common ways to make a 
custom kernel: copy the GENERIC config file to another name and edit it, or create a "wrapper" file that 
"includes" the standard GENERIC kernel and any options you need that aren't in GENERIC. In this 
case, our wrapper file looks like this: 
include "arch/i386/conf/GENERIC"
boca0 at isa? port 0x100 irq 10 # BOCA 8-port 
serial cards
com* at boca? slave ?
The two lines regarding the boca(4) card are copied from the commented out lines in 
GENERIC
, with 
the IRQ adjusted as needed. The advantage to using this "wrapper" file is any unrelated changes in 
GENERIC are updated automatically with any other source code update. The disadvantage is one can 
not remove devices (though in general, that's a bad idea, anyway). 
The other way to generate a custom kernel is to make a copy of the standard 
GENERIC
, giving it another 
name, then editing it as needed. The disadvantage to this is later updates to the GENERIC configuration 
file have to be merged into your copy, or you have to remake your configuration file. 
In either event, after making your custom kernel configuration file, use config(8) and make the kernel as 
documented 
above

Full instructions for creating your own custom kernel are in the 
config(8)
man page. 
5.8 - Boot-Time Configuration
Sometimes when booting your system you might notice that the kernel finds your device but maybe at 
the wrong IRQ. And maybe you need to use this device right away. Well, without rebuilding the kernel 
you can use OpenBSD's boot time kernel configuration. This will only correct your problem for one 
time. If you reboot, you will have to repeat this procedure. So, this is only meant as a temporary fix, and 
you should correct the problem using 
config(8)
. Your kernel does however need option 
BOOT_CONFIG in the kernel, which GENERIC does have. 
http://www.openbsd.org/faq/faq5.html (18 of 26)9/4/2011 10:02:02 AM


5 - Building the System from Source
Most of this document can be found in the man page 
boot_config(8)

To boot into the User Kernel Config, or UKC, use the -c option at boot time. 
boot> boot hd0a:/bsd -c
Or whichever kernel it is you want to boot. Doing this will bring up a UKC prompt. From here you can 
issue commands directly to the kernel specifying devices you want to change or disable or even enable. 
Here is a list of common commands in the UKC. 

add device
- Add a device through copying another 

change devno | device 
- Modify one or more devices 

disable devno | device 
- Disable one or more devices 

enable devno | device 
- Enable one or more devices 

find devno | device 
- Find one or more devices 

help
- Short summary of these commands 

list
- List ALL known devices 

exit/quit
- Continue Booting 

show [attr [val]]
- Show devices with an attribute and optional with a specified value 
Once you have your kernel configured, use 
quit
or 
exit
and continue booting. After doing so, you 
should make the change permanent in your kernel image, as described in 
Using config(8) to change your 
kernel


Download 1.27 Mb.

Do'stlaringiz bilan baham:
1   ...   75   76   77   78   79   80   81   82   ...   258




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling