Nez se dostanu k vlastni kompilaci (jak to udelat, v kterych adresarich, jako jaky uzivatel atd.) tak par slov k jednotlivym cestam nahozeni systemu:
loadlin.exe zimage root=/dev/hdb2
ro ether=15,0x280,eth0 reserve=0x300,8 vga=-3
cp zImage /dev/fd0
) tak se z ni pak jadro primo spusti (zadny filesystem se pro jadro primo na bootovaci diskete nepouziva).
/usr/src/linux/# tar -xzvf linux_kernel_1.2.13.tar.gz
^^^^^^^^^^^^^^^^
rootovsky prompt (:-)
/usr/src/linux/# gunzip linux_kernel_1.2.13.tar.gz
a/usr/src/linux/# untar linux_kernel_1.2.13.tar
/usr/src/linux/# uncompress linux_kernel_1.2.13.tar.Z
/usr/src/linux/# untar linux_kernel_1.2.13.tar
Dalsi veci jez je mozno udelat je vzit zdrojaky ktere mate k dispozici ( v Slackware napr. 1.2.1 a 1.2.8 ) a updatnout je
na vyssi verzi jadra. K tomu slouzi soubory vetsinou oznacovane jako linux_1.2.1_1.2.2_patch.tar.gz nebo obdobne.
Konkretne: mam v /usr/src/linux zdrojaky verze 1.2.8 a stahnu si patche az do verze 1.2.13 .
Nejprve rozbalim zapakovane patch soubory (ja to delam v adresari /usr/src):
/usr/src/# tar -xzvf *patch.tar.gz
rozbalene vypadaji nejak takto:
/usr/src/# ls *.diff linux-1.2.9.diff linux-1.2.10.diff linux-1.2.11.diff linux-1.2.12.diff linux-1.2.13.diffNo a ted je aplikuji:
/usr/src/# patch -p0 < linux-1.2.9.diff /usr/src/# patch -p0 < linux-1.2.10.diff /usr/src/# patch -p0 < linux-1.2.11.diff /usr/src/# patch -p0 < linux-1.2.12.diff /usr/src/# patch -p0 < linux-1.2.13.diff
Ilustracni obrazek ukazuje, co mate ocekavat v jakych adresarich a jak se spusti upgrade jadra o 1 stupen pomoci diff souboru (cislo verze na obrazku nesouhlasi, ale princip ano).
Pokud tedy mate vse co jsem popsal, je uz hrackou jadro zkompilovat. Zalogujte se jako root (nic vam ovsem nebrani kompilovat jadro jako normalni uzivatel), prepnete
se do adresare jadra (mely by v nem byt soubory Configure , Makefile a jeste nejake README ) a
napiste
make config
Nyni prichazi na radu zodpovezeni otazek kolem vaseho hardwaru. Priklad vystupu je uveden vzdy s
komentarem 'vo co go'([y] je yes/ano, [n] je no/ne, zavorky se samozrejme nepisou).
Predesilam ze podpora pro cokoli zere pamet, takze na zbytecne veci odpovidejte [n]
Pro lidi s malou RAM (typicky 4MB) uvadim na nekolika mistech co si muzou/nemusi nakonfigurovat aby usetrili par procent pameti ze svych 4hodnemalo megabajtu. Takhle graficky:
Jako ze ne [n]
Radsi si dejte [y]
Pry je take rychlejsi pri male RAMeti (4-8MB) zakomentovat flag -pipe
v souboru /usr/src/linux/arch/i386/Makefile:
CFLAGS := $(CFLAGS) -pipe <--------dejte pryc ifdef CONFIG_M386 CFLAGS := $(CFLAGS) -m386 -DCPU=386 endif ifdef CONFIG_M486 CFLAGS := $(CFLAGS) -m486 -DCPU=486 endif
No a kdyz uz jsme u toho kompilatoru: novejsi verze gcc produkuji jako standart exe soubory ve formatu elf. Je to format souboru pouzivany na nekterych unixech. Jeho vyhodou je jednoducha tvorba sdilenych knihoven (relokovatelnych=mapovatelnych kamkoli v adresnim prostoru procesu). Vysledne knihovny jsou o trochu pomalejsi (diky sezrani jednoho z velmimalo registru intelu) nez ty a.outove. U jadra je to fuk. Toto se vztahuje hlavne na jadra 1.3.XX, o kterych jsem udelal mensi obrazovou galerii. Pokud pouzivate gcc pod 2.7.0, je jadro v a.out formatu a pro gcc 2.7.0 a vyssi je v elfu (vono se nic nedeje, stejne to je jen zalezitost bootbloku). Jedine co muze delat problemy (obecne, nejen u jadra) je to, ze starsi verze gcc odmitaji kompilovat novejsi programy a naopak novejsi gcc odmitaji kompilovat starsi verze jader (:-^)
A uz uplne nakonec pred okomentovanym vystupem typickeho konfiguracniho skriptu, kdyby se vam stalo neco ve stylu
chyby ``fatal error - caught signal 11. Compile stop.'' nebo neco podobneho - nahodne (mne se to stalo uz davno, nepamatuji si presne ani
syntaxi ani to cislo) tak si zkontrolujte pamet (RAM) hlavne casovani v BIOSu, protoze toto muze znamenat chybu parity pameti nebo prehrivani procesoru.
Podobne se chova server X-windows. Nutno podotknouti ze tuto chybu vyvola treba spatna kombinace gcc a ld (ale vzdycky na stejnem miste).
- *
* General setup
*
Kernel math emulation (CONFIG_MATH_EMULATION) [n]
Normal floppy disk support (CONFIG_BLK_DEV_FD) [y]
Normal (MFM/RLL) disk and IDE disk/cdrom support (CONFIG_ST506) [y]
*
* Please see drivers/block/README.ide for help/info on IDE drives
*
Use old disk-only driver for primary i/f (CONFIG_BLK_DEV_HD) [n]
Include support for IDE/ATAPI CDROMs (CONFIG_BLK_DEV_IDECD) [n]
XT harddisk support (CONFIG_BLK_DEV_XD) [n]
Networking support (CONFIG_NET) [y]
Limit memory to low 16MB (CONFIG_MAX_16M) [y]
PCI bios support (CONFIG_PCI) [n]
System V IPC (CONFIG_SYSVIPC) [y]
Kernel support for ELF binaries (CONFIG_BINFMT_ELF) [n]
Use -m486 flag for 486-specific optimizations (CONFIG_M486) [y]
*
* Loadable module support
*
Set version information on all symbols for modules (CONFIG_MODVERSIONS) [n]
*
* Networking options
*
TCP/IP networking (CONFIG_INET) [y]
IP forwarding/gatewaying (CONFIG_IP_FORWARD) [n]
IP multicasting (CONFIG_IP_MULTICAST) [n]
IP firewalling (CONFIG_IP_FIREWALL) [n]
IP accounting (CONFIG_IP_ACCT) [n]
*
* (it is safe to leave these untouched)
*
PC/TCP compatibility mode (CONFIG_INET_PCTCP) [n]
Reverse ARP (CONFIG_INET_RARP) [n]
Assume subnets are local (CONFIG_INET_SNARL) [y]
Disable NAGLE algorithm (normally enabled) (CONFIG_TCP_NAGLE_OFF) [n]
The IPX protocol (CONFIG_IPX) [n]
*
* SCSI support
*
SCSI support? (CONFIG_SCSI) [n]
*
* Skipping SCSI configuration options...
*
*
* Network device support
*
Network device support? (CONFIG_NETDEVICES) [y]
Dummy net driver support (CONFIG_DUMMY) [n]
SLIP (serial line) support (CONFIG_SLIP) [y]
PPP (point-to-point) support (CONFIG_PPP) [y]
PLIP (parallel port) support (CONFIG_PLIP) [n]
Do you want to be offered ALPHA test drivers (CONFIG_NET_ALPHA) [n]
Western Digital/SMC cards (CONFIG_NET_VENDOR_SMC) [n]
AMD LANCE and PCnet (AT1500 and NE2100) support (CONFIG_LANCE) [n]
3COM cards (CONFIG_NET_VENDOR_3COM) [y] 3c501 support (CONFIG_EL1) [n]
3c503 support (CONFIG_EL2) [n]
3c509/3c579 support (CONFIG_EL3) [y]
Other ISA cards (CONFIG_NET_ISA) [n]
EISA, VLB, PCI and on board controllers (CONFIG_NET_EISA) [n]
Pocket and portable adaptors (CONFIG_NET_POCKET) [n]
*
* CD-ROM drivers (not for SCSI or IDE/ATAPI drives)
*
Sony CDU31A/CDU33A CDROM driver support (CONFIG_CDU31A) [n]
Mitsumi (not IDE/ATAPI) CDROM driver support (CONFIG_MCD) [n]
Matsushita/Panasonic CDROM driver support (CONFIG_SBPCD) [n]
Aztech/Orchid/Okano/Wearnes (non IDE) CDROM support (CONFIG_AZTCD) [n]
Sony CDU535 CDROM driver support (CONFIG_CDU535) [n]
*
* Filesystems
*
Standard (minix) fs support (CONFIG_MINIX_FS) [n]
Extended fs support (CONFIG_EXT_FS) [n]
Second extended fs support (CONFIG_EXT2_FS) [y]
xiafs filesystem support (CONFIG_XIA_FS) [n]
msdos fs support (CONFIG_MSDOS_FS) [y]
umsdos: Unix like fs on top of std MSDOS FAT fs (CONFIG_UMSDOS_FS) [n]
/proc filesystem support (CONFIG_PROC_FS) [y]
NFS filesystem support (CONFIG_NFS_FS) [y]
ISO9660 cdrom filesystem support (CONFIG_ISO9660_FS) [n]
OS/2 HPFS filesystem support (read only) (CONFIG_HPFS_FS) [n]
System V and Coherent filesystem support (CONFIG_SYSV_FS) [n]
*
* character devices
*
Cyclades async mux support (CONFIG_CYCLADES) [n]
Parallel printer support (CONFIG_PRINTER) [n]
Logitech busmouse support (CONFIG_BUSMOUSE) [n]
PS/2 mouse (aka "auxiliary device") support (CONFIG_PSMOUSE) [n]
Microsoft busmouse support (CONFIG_MS_BUSMOUSE) [n]
ATIXL busmouse support (CONFIG_ATIXL_BUSMOUSE) [n]
QIC-02 tape support (CONFIG_QIC02_TAPE) [n]
QIC-117 tape support (CONFIG_FTAPE) [n]
*
* Sound
*
Sound card support (CONFIG_SOUND) [n]
*
* Kernel hacking
*
Kernel profiling support (CONFIG_PROFILE) [n]
The linux kernel is now hopefully configured for your setup.
Check the top-level Makefile for additional configuration,
and do a 'make dep ; make clean' if you want to be sure all
the files are correctly re-made
make dep ; make clean ; make zImage
make dep ; make clean ; make /dev/fd0
cat zImage > /dev/fd0
cp zImage /dev/fd0
make dep
--- make depend, vytvori soubory zavisle na parametrech, treba IRQ,ADDR,DMA zvukove karty a co chcete
make [kam/][co]
--- vytvori (kompiluje a linkuje) binarni obraz jadra v zkomprimovane podobe
make clean
--- odstrani vsechny *.o soubory, coz je produkt prekladace pred slinkovanim dohromady, po kompilaci doporucuji provest protoze odstrani nekolik MB zbytecnych souboru z disku.
make zImage
--- zkompiluje jadro a ulozi ho v ./arch/i386/boot/zImage v zkomprimovane podobe (samorozbalitelne).
make zlilo
--- zkompiluje jadro a ulozi ho v hlavnim (root) adresari pod nazvem vmlinuz a zavola lilo pro obcerstveni ukazatelu
make clean
).
################ naky sracky az sem #####################
struct signature {
char *signature;
int sig_offset;
int sig_length;
int major_bios_version;
int minor_bios_version;
int flag; /* 1 == PCI_bus, 2 == ISA_200S, 3 == ISA_250MG, 4 == ISA_200S */
} signatures[] = {
/* 1 2 3 4 5 6 */
/* 123456789012345678901234567890123456789012345678901234567890 */
{ "FUTURE DOMAIN CORP. (C) 1986-1990 1800-V2.07/28/89", 5, 50, 2, 0, 0 },
{ "FUTURE DOMAIN CORP. (C) 1986-1990 1800-V1.07/28/89", 5, 50, 2, 0, 0 },
{ "FUTURE DOMAIN CORP. (C) 1986-1990 1800-V2.07/28/89", 72, 50, 2, 0, 2 },
{ "FUTURE DOMAIN CORP. (C) 1986-1990 1800-V2.0", 73, 43, 2, 0, 3 },
{ "FUTURE DOMAIN CORP. (C) 1991 1800-V2.0.", 72, 39, 2, 0, 4 },
{ "FUTURE DOMAIN CORP. (C) 1992 V3.00.004/02/92", 5, 44, 3, 0, 0 },
{ "FUTURE DOMAIN TMC-18XX (C) 1993 V3.203/12/93", 5, 44, 3, 2, 0 },
{ "IBM F1 P2 BIOS v1.0104/29/93", 5, 28, 3, -1, 0 },
{ "Future Domain Corp. V1.0008/18/93", 5, 33, 3, 4, 0 },
{ "Future Domain Corp. V1.0008/18/93", 26, 33, 3, 4, 1 },
/* This next signature may not be a 3.5 bios */
{ "Future Domain Corp. V2.0108/18/93", 5, 33, 3, 5, 0 },
{ "FUTURE DOMAIN CORP. V3.5008/18/93", 5, 34, 3, 5, 0 },
{ "FUTURE DOMAIN 18c30/18c50/1800 (C) 1994 V3.5", 5, 44, 3, 5, 0 },
{ "FUTURE DOMAIN TMC-18XX", 5, 22, -1, -1, 0 }, -->> tenhle kontroler mam
{ "", 0, 0, -1, -1, 0 }, -->> a tohle jsem si pridal
};
################ naky sracky dal #####################