Index: chap-kernel.xml =================================================================== RCS file: /cvsroot/htdocs/guide/en/chap-kernel.xml,v retrieving revision 1.9 diff -b -u -r1.9 chap-kernel.xml --- chap-kernel.xml 20 May 2004 03:09:14 -0000 1.9 +++ chap-kernel.xml 14 Aug 2004 15:06:46 -0000 @@ -42,131 +42,35 @@ Installing the kernel sources - You can get the kernel sources from AnonCVS, see - . + + You can get the kernel sources from AnonCVS (see + ), or from the + syssrc.tgz + tarball that is located in the source/sets/ + directory of the release that you are using. If you use the second + method, you can extract the tarball as root: + - Be patient: this operation lasts many minutes, because the repository - contains hundreds of files. - The sources live in /usr/src/sys; the - symbolic link sys points to this directory. - Therefore the following commands have the same effect: + +&rprompt; cd / +&rprompt; tar zxf /path/to/syssrc.tgz + - &rprompt; cd /usr/src/sys -&rprompt; cd /sys + + If you chose to use AnonCVS, be patient, the operation can last + many minutes, because the repository contains hundreds of files. + - Once the sources are checked out, you can create a custom kernel: this - is not as difficult as you think. + + Once you have the sources available, you can create a custom kernel: + this is not as difficult as you might think. In fact, a new kernel can be created in a few steps which will be described in the following sections. - - Italian keyboard layout - - Before compiling the kernel, Italian users should consider modifying - the predefined layout for the italian keyboard, which is defined in the - source file /sys/dev/pckbc/wskbdmap_mfii.c. - In the default layout some characters useful for programmers are - missing (for example, left and right braces and tilde). - This is an alternative layout: - - static const keysym_t pckbd_keydesc_it[] = { -... -KC(8), KS_7, KS_slash, KS_braceleft, -KC(9), KS_8, KS_parenleft, KS_bracketleft, -KC(10), KS_9, KS_parenright, KS_bracketright, -KC(11), KS_0, KS_equal, KS_braceright, -KC(12), KS_apostrophe, KS_question, KS_grave, -KC(13), KS_igrave, KS_asciicircum, KS_asciitilde, -KC(26), KS_egrave, KS_eacute, KS_bracketleft, KS_braceleft, -KC(27), KS_plus, KS_asterisk, KS_bracketright,KS_braceright, -... - - The previous layout defines the following mappings: - - - - - - - - - Keys - Character - - - - - - Alt Gr + 7 - { - - - - Alt Gr + 8 - [ - - - - Alt Gr + 9 - ] - - - - Alt Gr + 0 - } - - - - Alt Gr + ' - ` - - - - Alt Gr + ì - ~ - - - - Alt Gr + é - [ - - - - Alt Gr + + - ] - - - - Shift + Alt Gr + è - { - - - - Shift + Alt Gr + + - } - - - - - - - Console driver - - starting with version 1.4, &os; uses the - wscons multiplatform console driver to - handle screen, keyboard and mouse. - Previous versions used pccons or - pcvt. - For a detailed description, see . - - - - - Recompiling the kernel @@ -187,10 +91,6 @@ Basic steps for kernel compilation - Build the toolchain - - - Create/modify the kernel configuration file @@ -214,23 +114,6 @@ - - Build the toolchain - - The &os; toolchain provides a simple mechanism for compiling - the &os; system both natively or when the need arises, cross - compiling for other targets. In this example, a native toolchain - is built (as root) by simply typing: - - &rprompt; cd /usr/src -&rprompt; ./build.sh tools - - Once the tools are built, the kernel can be reconfigured - and compiled. - - - - Creating the kernel configuration file @@ -244,14 +127,14 @@ characteristics of the devices supported by the kernel as well as several kernel configuration options. Kernel configuration files are located in the - /sys/arch/i386/conf directory. + /usr/sys/arch/i386/conf directory. The easiest way to create a new file is to copy an existing one and modify it: usually the best choice on most platforms is the GENERIC configuration. In the configuration file there are comments describing the options; a more detailed description is found in the &man.options.4; man page. - &rprompt; cd /sys/arch/i386/conf/ + &rprompt; cd /usr/src/sys/arch/i386/conf/ &rprompt; cp GENERIC MYKERNEL &rprompt; vi MYKERNEL @@ -313,31 +196,32 @@ ... options PCKBD_LAYOUT="KB_IT" - The adjustkernel Perl script, which can be - found at , - analizes the output of &man.dmesg.8; and + + The adjustkernel Perl script, which is + available through pkgsrc analyzes the output of &man.dmesg.8; and automatically generates a minimal configuration file. - To run it you need to have Perl installed on your system. - The installation of new software is described in detail - in the . - If you want to install Perl now, download the pre-compiled package - perl-5.00404.tgz and write the following command: - - &rprompt; pkg_add perl-5.00404.tgz + The installation of packages is described extensively in + in the , but installing + adjustkernel basically boils down to: + - Now Perl is installed, configured and ready to work: easier than this - it's impossible... + +&rprompt; cd /usr/pkgsrc/sysutils/adjustkernel +&rprompt; make install You can now run the script with: &rprompt; cd /sys/arch/i386/conf -&rprompt; perl adjustkernel GENERIC > MYKERNEL +&rprompt; adjustkernel GENERIC > MYKERNEL + - I tried this script and it worked very well, saving me a lot of manual + + This script usually works very well, saving a lot of manual editing. - Beware that the script only configures the available devices: you - must still configure manually the other options (e.g. Linux emulation, - ...) + But be aware that the script only configures the available devices: you + must still configure the other options manually. + @@ -376,53 +260,10 @@ chips): the compilation puts a higher stress on the system than most applications do. Another typical error is the following: option B, active, requires - option A which is not active. - - A full compilation of the kernel can last from some minutes to several + option A which is not active. + A full compilation of the kernel can last from some minutes to several hours, depending on the hardware. - See the following table for some examples: - - - - - - - - - - CPU - RAM (MB) - Approx. time - - - - - - 486 DX2 50 - 20 - 1 hour - - - - P166 - 96 - 15 minutes - - - - PIII - 128 - 5 minutes - - - - 68030/25 - 8 - 4 hours - - - - + The output of the make command is the netbsd file in the compile directory: this file should be copied in the root