Академический Документы
Профессиональный Документы
Культура Документы
1.
1.1 ! ( )
1.2
2. ,
2.1
2.2
2.3
2.4
2.5
2.6
2.7
, , ;
;
hardware ;
gcc libc ;
module (loadable);
;
;
3.
3.1 (source)
3.2 source
3.3
3.3.1 ( Pr)
3.3.2 MFM/RLL, IDE, cdrom (Block Devices)
3.3.3 ( )
3.3.4 System V IPC ( )
3.3.5 processor ( processor)
3.3.6 SCSI
3.3.7
3.3.8 (Filesystems)
3.3.8.1 , filesystems !
3.3.9 (Character devices)
3.3.10
3.3.11
3.3.12
3.4 , ; ( Makefile)
4. compile
4.1
4.2
4.3
4.4
compile
"make"
5. (patching)
5.1
5.2
5.3
5.4
(patch)
.orig
patches
6.
6.1 kbd
6.2 util-linux
6.3 hdparm
6.4 gpm
7.
Copyright, ,
______________________________________________________________________
1.
; ,
' :
"! -46.5.6
2.8.193, 1.0.9!"
driver ' ,
.
compile ' .
" README
;"
, .
, '
.
1.1. ! ( )
GNU tar, find, xargs.
, . ,
(filesystem) / . ,
( /)
mount, /etc/fstab (
). ,
, partition ,
,
Linux, .
""
2.2.9 ,
' .
,
. ,
, .
, .
source Linux,
"" "".
. 1.2.x ,
2.0.x , 2.2.x . (
)
bugs. (2.1.x , 2.3.x , )
,
( bugs) . !
1.2.
, ,
, (
), (
text, ). ( )
("),
:
,
,
. ( ,
" "
) '
, ,
' . ' ,
"make config",
"make config", "make config." . (... : ,
,
.)
2. ,
2.1. , , ;
*nix's
hardware. , (
) (processes),
( , )
. ,
,
hardware.
,
,
.
2.2. ;
hardware (, drivers
), ,
' , '
,
. ,
drivers bugs.
2.3. hardware ;
Hardware-HOWTO. ,
config.in source Linux,
, make config.
hardware ,
Linux. drivers
( PCMCIA )
modules (loadable),
.
source Linux, o
, ,
libc .
2.6. ;
/ . ,
source Linux 14 Mytes
2.2.9 .
, 67 MB.
2.7. ;
/, compilation ,
' , . AMD K6-2/300
2.2.x .
compilation Pentiums, 486s, 386s,
, ...
, compile
/ ,
( ,
utilities , ),
image .
3.
3.1. (source)
source anonymous ftp
ftp.kernel.org, dir /pub/linux/kernel/vx.y, x.y
( 2.2), - -
, .
linux-x.y.z.tar.gz, x.y.z
. sites
.bz2, . bzip2. (
, .)
ftp.xx.kernel.org, xx
. , ftp.at.kernel.org
, ftp.us.kernel.org .
3.2. source
/usr/src/linux,
. script
bash
$BASH.
, make
config,
. make menuconfig
. , , ,
, '
' . X-Windows,
make xconfig, , Tk ("clicko-rama" - Nat). make menuconfig
(n)curses text .
:
,
.
3.3.1. (
Pr)
(. 386 486SX
/), ' y .
, ' ' y,
- ,
' .
no, yes
. , .
( EIDE).
3.3.3. ( )
, ' y /
' ( Internet),
SLIP, PPP, term, ,
Internet. , ( X
Windows) , /
, ' y. ,
TCP/IP. y
, .
3.3.6. SCSI
SCSI devices, y.
, cd-rom, ,
SCSI . , SCSIHOWTO.
3.3.7.
, SLIP PPP,
Internet, y. script
,
.
3.3.8. (Filesystems)
, script
filesystems :
(minix) - minix
filesystems, ,
.
" ",
minix filesystem,
.
second extended - filesystem Linux.
, y.
msdos - MS-DOS partitions
, mount MS-DOS , y.
filesystems .
/proc - ( Bell Labs, .)
proc filesystem ' :
filesystem (processes).
(process listers),
ps. cat /proc/meminfo, cat
/proc/devices. (shells), rc,
/proc/self/fd ( /dev/fd ) -
(I/O). y .
Linux ' .
NFS - / ' ,
filesystems / NFS,
y.
ISO9660 - CD-ROMs. CDROM, Linux, y.
3.3.8.1. , filesystems !
, mount. :
blah# mount
/dev/hda1 on / type ext2 (defaults)
/dev/hda3 on /usr type ext2 (defaults)
none on /proc type proc (defaults)
/dev/fd0 on /mnt type msdos (defaults)
: type
filesystem. filesystems / /usr second
extended, /proc,
mount, msdos (!) filesystem.
cat /proc/filesystems,
/proc : filesystems .
, filesystems .
modules ,
""
.
3.3.10.
' biff , y,
,
. ( :
driver,
' n
, .)
,
drivers http://www.linux.org.uk/OSS/,
Open Sound System (OSS), http://www.opensound.com/.
3.3.11.
,
, (
3Com 3C509 compile driver
ethernet.)
( script Configure),
Axel Boldt
(boldt@math.ucsb.edu), online .
(
2.0), Documentation/Configure.help
dirs source Linux .
3.3.12.
> README Linus :
" (kernel hacking)"
( ),
,
,
( kmalloc() ). ,
' "n" "".
3.4. , ; ( Makefile)
,
, " -
Makefile (check the top-level Makefile for
additional configuration)", .
, Makefile.
, . '
,
rdev. ,
.
4. compile
4.1.
script , make
dep ( = ) () clean ( =
). , make dep.
, include, .
, /
. ,
make clean. object
, .
,
compile .
4.2. compile
depend clean, make bzImage,
make bzdisk. (
.) make bzImage compile ,
directory arch/i386/boot, (
) bzImage. , .
make bzdisk ,
bzImage ,
"A:". bzdisk ,
. ( ),
. '
boot,
( ).
,
' . ("'
! ' ;")
( )
, bz .
, .
, bzImage.
zImage. ,
, ,
, .
4.3. "make"
make mrproper clean,
.
(patch). make mrproper ,
backup (.config),
.
make oldconfig
. make config.
compile ,
, ,
' default .
modules, make modules.
4.4.
,
, .
LILO (Linux Loader) . make
bzlilo , LILO,
boot, lilo /
: /vmlinuz, lilo
/sbin, lilo (/etc/lilo.conf)
.
, LILO .
' ,
. (/etc/lilo/config
Linux, /etc/lilo.conf ),
. :
image = /vmlinuz
label = Linux
root = /dev/hda1
...
image = ,
/vmlinuz. label ( = )
lilo
boot, root directory /
. backup
bzImage . ( cp
bzImage /vmlinuz, /vmlinuz). ,
lilo. lilo,
/etc/lilo/install (), /etc/lilo/lilo
-C /etc/lilo/config ().
LILO,
LILO,
ftp server, .
boot '
( ,
),
( ) image = xxx
LILO, image = xxx image = yyy, yyy
path , backup
. , label = zzz label = linux-backup
lilo.
, delay=x, x
, LILO
boot, (
shift), label () backup (
).
5. (patching)
5.1. (patch)
patches ( =
). , 1.1.45,
patch46.gz ' ,
1.1.46, patch. ,
backup dirs source
( make clean, cd /usr/src; tar zcvf oldtree.tar.gz linux, tar ).
, ,
patch46.gz /usr/src. cd dir /usr/src
zcat patch46.gz | patch -p0 ( patch -p0 < patch46, patch
). (
, / ),
, .
,
,
. ,
-s patch,
. ( '
" , / ' !",
.)
, dir /usr/src/linux
.rej . patch ( ,
compile filesystem),
# . find
.
find . -name '*.rej' -print
.rej
dir subdirs .
, make clean, config, dep,
3 4.
patch. ,
patch -s , .
source dir
/usr/src/linux, patch -p1 (' dir) patch
. patch
man.
5.2.
( : .)
, patch
config.in, ,
/.
,
. , config.in.rej,
patch. + .
, y n. ,
config.in, y n n y,
.
patch -p0 < config.in.rej
(. ),
compilation.
config.in.rej , .
,
patch . patch previously
applied patch detected: Assume -R? ( patch,
;) patch
. y,
source , ' . ,
source ( , ,
).
patch, patch -R
patch.
, patches
, '
source ( linux-x.y.z.tar.gz),
.
5.3. .orig
patches, ' .orig
. , 1.1.51 ,
1.1.48 . .orig ,
MB.
find . -name '*.orig' -exec rm -f {} ';'
. patch #
.rej, tilde () .orig .
.orig,
GNU xargs. :
find . -name '*.orig' | xargs rm
" , " :
5.4. patches
patches ( " "), '
Linus. , patches
Linus ,
- source patch -
source ,
. ,
, ' source (
), patches
Linus, . ,
patches . ,
' , patch
source ,
( )
patch.
patches ;
.
noblink patch virtual ,
. ( patch -
- .) ,
drivers
modules , " "
patches .
6.
Linux ,
source .
,
.
6.1. kbd
Linux '
.
fonts, ,
( ), . kbd
,
fonts ,
sites, source
.
6.2. util-linux
6.3. hdparm
,
. patches
, (
) .
6.4. gpm
gpm general purpose mouse ( ).
cut paste text
virtual , ,
.
7.
7.2.
, , /
compile Quadbazillium-III/4400,
(drivers ,
filesystems, ). , ,
/.
(swapping) - .
, Fujitsu Eagles,
,
.
,
/ , "total mem"
( ) /proc/meminfo,
free.
7.3. ,
PCs : , "General
Setup" ( ), "Parallel port support"
( ) "PC-style hardware" (hardware
PC). , "Character devices" ( )
"Parallel printer support" ( ).
, . Linux 2.2
' , .
lp1 , lp0
. ,
dmesg, (logs) dir /var/log.
7.4. compile
compile, patch,
source . ,
gcc (
include). (symbolic links)
Linus README, . ,
compile ,
Linux,
.
, gcc
hardware. "xxx exited with signal 15"
( = xxx 15),
.
, -
cache, compiler .
, gcc.
compile
off cache, RAM, .
, hardware
, ' .
(FAQs),
http://www.bitwizard.nl/sig11/.
7.5. boot
LILO,
"" ,
boot = /dev/hda1, boot = /dev/hda.
,
.
,
(
,
.)
mkdir /mnt
mount -t ext2 /dev/hda3 /mnt
mkdir dir , .
, cd dir image .
/mnt + /usr/src/linux/arch/i386/boot - /usr = /mnt/src/linux/arch/i386/boot
cd /mnt/src/linux/arch/i386/boot
dd if=bzImage of=/dev/fd0
rdev /dev/fd0 /dev/hda1
, cd / unmount filesystem
/usr :
cd /
umount /mnt
, /
' . lilo (
, ) !
, .
/ (
/vmlinuz), .
, image
/vmlinuz, :
/dev/hda3 /dev/hda1 ( filesystem /), /mnt/src/linux
/mnt, if=bzImage if=vmlinuz. (
/mnt/src/linux.)
LILO ( 1024 )
. LILO mini-HOWTO,
.
7.9. routing
route,
routing.
/usr/include/linux/route.h (
/usr/src/linux).
7.13. compile,
source Linux
include ( .h) dir /usr/include,
.
( xyzzy.h include
/usr/include/linux) :
#include <linux/xyzzy.h>
7.14.
, , '
,
:
echo 4096 > /proc/sys/kernel/file-max
echo 12288 > /proc/sys/kernel/inode-max
echo 300 400 500 > /proc/sys/vm/freepages
8. 2.0.x, 2.2.x
2.0.x 2.2.x
. Documentation/Changes
drv_hello module, 4k
, modules '
. , rmmod drv_hello.
rmmod module , .
module lsmod.
utilities modules man.
9.2. Modules
2.0.30,
loadable modules. ,
. , y ' ,
make config. compile ,
' . , cd /usr/src/linux,
make modules. compile modules
, links
/usr/src/linux/modules.
dir , make modules_install,
dir /lib/modules/x.y.z ( x.y.z ).
filesystems. ,
filesystems minix msdos, ,
msdos (!!!), insmod
/usr/src/linux/modules/msdos.o, rmmod msdos.
50k RAM
. filesystem
minix : ,
"".
10.
10.1. make patch
make patch,
. ,
(shell) : grep root /etc/passwd,
/bin/csh.
sh bash, :
(command) 2>&1 | tee (output file)
(command) ( = )
(output file) ( = ).
csh tcsh, :
(command) |& tee (output file)
rc ( : ) :
(command) >[2=1] | tee (output file)
10.2.
,
. ,
Unix, LILO
boot ' . (
500 MBytes, LILO
.) ,
image = /usr/src/linux/arch/i386/boot/bzImage
label = new_kernel
LILO,
, ' /vmlinuz (,
lilo). LILO
boot , shift
( LILO , ),
(prompt).
new_kernel (. ), boot
.
/
source (, :
),
/usr/src/linux-x.y.z, x.y.z . ,
"" source '
(symbolic link). , ln -sf linux-1.2.2 /usr/src/linux,
1.2.2 . symbolic link,
ln
directory ( symbolic links ),
.
10.3.
Russell Nelson (nelson@crynwr.com)
. ,
. ftp
ftp.emlist.com ( dir pub/kchanges), site
http://www.crynwr.com/kchanges
11. HOWTOs
Sound-HOWTO : utilities
SCSI-HOWTO : SCSI controllers
NET-2-HOWTO :
PPP-HOWTO : PPP
PCMCIA-HOWTO : drivers
ELF-HOWTO : ELF,
Hardware-HOWTO : hardware
Module mini-HOWTO : modules
Kerneld mini-HOWTO : daemon kerneld
BogoMips mini-HOWTO : ... ( /)
12.
12.1.
Linux Kernel-HOWTO Brian Ward
(bri@cs.uchicago.edu). , , ,
( ).
,
URLs :
http://www.math.psu.edu/bri/
http://blah.math.tu-graz.ac.at/~bri/
mails ,
' , '
. ,
. harware
( ), hardware
. ,
" , ".
. , ,
gcc, libc .
, . ,
, , !
e-mail.
,
, .
(. ),
e-mail . . , .
e-mails ,
hardware. ok,
hardware .
12.2.
" " .
.
" ".
debugging crash recovery ( =
/ ).
12.3.
README Linus ( ).
, Linus!
uc@brian.lunetix.de (Ulrich Callmeier) : patch -s
xargs.
quinlan@yggdrasil.com (Daniel Quinlan) :
.
nat@nat@nataa.fr.eu.org (Nat Makarevitch) : mrproper, tar -p,
.
boldt@math.ucsb.edu (Axel Boldt) :
Internet , .
lembark@wrkhors.psyber.com (Steve Lembark) :
boot.
kbriggs@earwax.pd.uwa.edu.au (Keith Briggs) :
.
rmcguire@freenet.columbus.oh.us (Ryan McGuire) :
makeables.
dumas@excalibur.ibp.fr (Eric Dumas) : .
.) ,
. .
.