Next Previous Contents

3. Pws na ry8misete pragmatika ton pyrhna

3.1 Pairnoyme ton phgaio (source) kwdika

Mporoume na broume ton source kwdika me anonymous ftp sto ftp.kernel.org, sto dir /pub/linux/kernel/vx.y, opoy x.y einai o ari8mos ekdoshs (px 2.2), kai - opws proeipame - oi monoi ari8moi sto telos deixnoyn ekdoseis anaptyjhs, poy mporei na einai asta8eis. To arxeio typika onomazetai linux-x.y.z.tar.gz, opoy x.y.z einai o ari8mos ekdoshs. Ta diafora paromoia sites syxna exoyne ki ena arxeio me katalhjh .bz2, dhl. poy sympiesthke me to programma bzip2. (Ayta ta arxeia einai mikrotera, kai xreiazontai ligotero xrono na kateboun.)

Kalutera einai na xrhsimopoioume to ftp.xx.kernel.org, opoy xx einai o kwdikas ths xwras sas. Gia paradeigma, to ftp.at.kernel.org einai gia thn Aystria, kai to ftp.us.kernel.org gia tis HPA.

3.2 Anoigoyme ton source kwdika

Kanoyme login ws (h su pros) root, kai kanoyme cd sto directory /usr/src. Ean egkatasthsate ton source kwdika toy pyrhna (opws kanoyn oi perissoteroi xrhstes), 8a yparxei hdh ena dir poy legetai linux, poy periexei olo to dentro toy paliou source. An dia8etete arketo xwro ston disko kai 8elete na energhsete ek toy asfalous, krathste ayto to directory. Mia kalh idea einai na breite poia ekdosh xrhsimopoiei o H/Y sas twra, kai analoga n' allajete to onoma toy dir. H entolh uname -r deixnei thn parousa ekdosh toy pyrhna. Epomenws, an h uname -r leei 1.0.9, 8a allajete to onoma (me thn entolh mv) linux se linux-1.0.9. An ais8aneste metriws anypomonoi, apla sbhste olo to sygkekrimeno directory. Se ka8e periptwsh, pantws, kai prin aposympiesete ton plhrh source kwdika, bebaiw8eite pws den yparxei directory linux sto /usr/src.

Twra, mesa sto /usr/src, aposympieste ton kwdika me thn entolh tar zxpvf linux-x.y.z.tar.gz. (An exete arxeio apla .tar, xwris .gz sto telos, dwste tar xpvf linux-x.y.z.tar.) 8a deite na pernane mprosta sas grhgora ta periexomena toy source kwdika. Otan teleiwsete, 8a yparxei ena neo linux directory mesa sto /usr/src. Gyriste me cd sto linux, kai cajte prosektika to arxeio README. 8a breite mia enothta me thn tampela INSTALLING the kernel ( = egka8istwntas ton pyrhna). Efarmoste tis sxetikes odhgies otan prepei - symbolikoi desmoi (symbolic links) poy prepei na parameinoyn sth 8esh toys, afairesh paliwn arxeiwn .o, klp.

An exete arxeio .bz2 kai to programma bzip2 (diabaste sxetika m' ayto sto http://www.muraroa.demon.co.uk/), dwste :

     bz2cat linux-x.y.z.tar.bz2 | tar xvf -

3.3 Ry8mizoyme ton pyrhna

Shmeiwsh : Merika apo ta parakatw apoteloun epanalhch / dieykrinhsh mias paromoias enothtas sto arxeio README toy Linus.

H entolh make config, oso briskomaste sto /usr/src/linux, jekinaei ena script ry8misewn, poy sas kanei polles erwthseis. To script ayto apaitei to bash, epomenws epalh8euste oti to bash brisketai sto /bin/bash, sto /bin/sh, h sto $BASH.

Wstoso, yparxoyn merikes pio eyxaristes enallaktikes luseis sto make config, kai pi8anon na tis breite eykoloteres kai pio anetes sth xrhsh toys. To make menuconfig einai pi8anotata to eyrutera xrhsimopoioumeno. O,ti kai na dialejete, pantws, einai kalutero na ejoikeiw8eite me to sygkekrimeno, epeidh 8a epistrecete s' ayto syntomotera ap' oso fantazosaste. Osoi trexete ta X-Windows, mporeite na dokimasete to make xconfig, e, na exete egkatasthsei to Tk ("click-o-rama" - Nat). To make menuconfig einai gia osoys dia8etoyn to (n)curses kai 8a protimousane ena text menou. Ayta ta periballonta dia8etoyn ena ka8aro pleonekthma : An kaneis la8os epilogh kata th diarkeia twn ry8misewn, einai aplh doyleia to na epistreceis kai na th dior8wseis.

Me ta make menuconfig kai make xconfig, oi epiloges ry8misewn emfanizontai ierarxika.

Twra, eisaste etoimoi n' apanthsete stis erwthseis, synh8ws me y (yes, nai), h n (no, oxi). Oi drivers twn syskeywn synh8ws exoyne mia parametro m. Ayth shmainei "module", dhladh o H/Y 8a thn kanei compile, oxi omws katey8eian mesa ston pyrhna, alla san module poy fortwnetai. Enas kwmikoteros tropos na peis ti shmainei to m, einai "maybe". ( = Isws.) Oi parametroi me profanesterh xrhsh kai poy den einai toso basikes, den 8a syzhth8oun edw. Gia suntomh perigrafh merikwn akomh, diabaste thn enothta "Alles epiloges ry8misewn". Sto make menuconfig, to plhktro toy kenou diasthmatos enallassei thn epilogh.

Stoys pyrhnes 2.0.x (kai se metagenesteroys) yparxei kai epilogh "?", h opoia dinei suntomh perigrafh twn parametrwn ru8mishs. Aytes oi plhrofories pi8anotata einai kai oi pleon prosfata enhmerwmenes. Oriste kai mia lista merikwn shmantikwn xarakthristikwn, se poio ierarxiko menou briskontai, ka8ws kai mia suntomh perigrafh toys.

Apomimhsh toy ma8hmatikou synepejergasth (Tupos kai xarakthristika toy mPr)

An den exete ma8hmatiko synepejergasth (dhl. exete sketo 386 h 486SX H/Y), prepei n' apanthsete y sth sxetikh erwthsh. An exete synepejergasth, kai par' ol' ayta apanthsete y, mhn anhsyxeite idiaitera - o synepejergasths 8a xrhsimopoih8ei, kai to programma apomimhshs toy 8' agnoh8ei. Gia opoiodhpote sxedon monterno mhxanhma h apanthsh prepei na einai no, alla mhn anhsyxeite an apanthsete yes kata la8os. An den xreiastei, den 8a xrhsimopoih8ei.

Proxwrhmenh yposthrijh diskwn MFM/RLL, IDE, cdrom (Block Devices)

Pi8anotata 8a thn xreiasteite. Shmainei oti o pyrhnas 8a yposthrijei stantar sklhrous diskoys gia PC, toys opoioys dia8etoyn oi perissoteroi xrhstes. O sygkekrimenos driver den yposthrizei monades SCSI. M' aytes 8' asxolh8oume pio katw.

Meta 8a erwth8eite sxetika me drivers "old (palious) disk-only" kai "new (neoys) IDE". Sigoyra prepei na dialejete ton enan ap' toys dyo. H kuria diafora toys einai pws o palios driver yposthrizei mono duo diskoys se monh diasundesh (dhl. ena monadiko diplo kalwdio diskwn), kai o neos yposthrizei deytereuoysa diasundesh (dhl. duo dipla kalwdia) kai monades cd-rom IDE/ATAPI. O neos driver is 4k megaluteros apo ton palio, kai 8ewrhtika einai kai "beltiwmenos", poy shmainei oti (ektos apo to na periexei diaforetiko ari8mo bugs) mallon 8a beltiwsei thn apodosh toy diskoy sas, eidika an dia8etete newtero hardware (tupoy EIDE).

Yposthrijh diktuwshs (Genikes ry8miseis)

Sth 8ewria, prepei n' apanthsete y monon an o H/Y sas brisketai syndedemenos s' ena diktyo (opws px to Internet), h 8elete na xrhsimopoihsete ta SLIP, PPP, term, klp, gia na synde8eite mesw thlefwnoy sto Internet. Wstoso, epeidh poy arketa paketa (opws ta X Windows) apaitoun diktyakh yposthrijh, akomh ki an o H/Y sas den brisketai se kapoio diktyo, prepei n' apanthsete y. Argotera, 8a erwth8eite an 8elete yposthrijh diktuwshs tupoy TCP/IP. 3anadwste y kai edw, an den eisaste apolyta bebaioi.

System V IPC (Genikes ry8miseis)

Enas apo toys kaluteroys orismous ths IPC (Interprocess Communication, epikoinwnia diadikasiwn) brisketai sto glwssario, sto biblio ths Perl. Kati poy den ekplhssei, epeidh arketoi programmatistes se Perl xrhsimopoioun thn IPC gia na baloyn tis processes na milhsoyn h mia sthn allh, kai paromoia gia merika alla programmata (me gnwstotero paradeigma to DOOM), ara den einai kalh idea n' apanthsete n, ektos an gnwrizete akribws ti kanete.

Oikogeneia toy processor (Tupos kai xarakthristika toy processor)

(Se palioteroys pyrhnes : Dwste thn parametro -m486 gia beltistopoihsh eidika gia ton 486.)

Paradosiaka, edw kanoyme compile me beltistopoihsh gia sygkekrimeno prosessora. Paliotera, oi pyrhnes trexane mia xara se diaforetikous prosessores, alla hsan megaluteroi. Stoys newteroys pyrhnes ayto den isxuei, epomenws prepei na peite gia poion prosessora kanete compile ton pyrhna. Enas pyrhnas gia "386" 8a doylecei m' ayton kai ka8e newtero tupo ix86 H/Y.

Yposthrijh SCSI

An exete syskeyes SCSI devices, apanthste y. 8a erwth8eite gia tis ypoloipes plhrofories, px yposthrijh cd-rom, diskwn, kai ti eidoys SCSI karta dia8etete. Gia perissoteres leptomereies, diabaste to SCSI-HOWTO.

Yposthrijh kartwn diktuoy

An exete karta diktuoy, h 8elete na xrhsimopoihsete ta SLIP kai PPP, h mia parallhlh 8ura gia sundesh me to Internet, dwste y. To script ry8misewn 8a sas rwthsei ti eidos kartas exete, kai poio prwtokollo na xrhsimopoihsei.

Systhmata arxeiwn (Filesystems)

Meta, to script ry8misewn rwtaei an 8elete yposthrijh gia ta ejhs filesystems :

To stantar (minix) - Oi newteres dianomes den dhmioyrgoun minix filesystems, kai polloi xrhstes den to xrhsimopoioun, alla isws na ejakoloy8ei na xreiazetai touto edw. To xrhsimopoioun merika programmata se "disketa diaswshs", alla ki alloy eidoys disketes mporei na exoyn minix filesystem, mia poy einai eukolo na to xrhsimopoioume se disketes.

To second extended - Ayto einai to stantar filesystem toy Linux. Eseis mallon sigoyra exete ena tetoio, kai prepei na apanthsete y.

To msdos - An 8elete na xrhsimopoihsete kai tis MS-DOS partitions toy sklhrou sas diskoy, h na kanete mount se MS-DOS disketes, dwste y.

Yparxoyn dia8esimoi kai tupoi filesystems apo diafora alla LS.

To /proc - (Ayto htan idea twn Bell Labs, ypo8etw.) Den ftiaxnoyme proc filesystem epanw s' enan disko : Ayto einai h diasundesh toy filesystem gia ton pyrhna kai tis diadikasies (processes). To xrhsimopoioun polla programmata listas diadikasiwn (process listers), opws px to ps. Dokimaste px na dwsete cat /proc/meminfo, h cat /proc/devices. Merika kelufh (shells), eidika to rc, xrhsimopoioun to /proc/self/fd (gnwsto ws /dev/fd se alla LS) gia eisodo - ejodo (I/O). Sxedon me bebaiothta prepei na peite y edw. Polla shmantika ergaleia toy Linux basizontai s' ayto.

To NFS - An o H/Y sas einai syndedemenos s' ena diktyo, kai 8elete na xrhsimopoieite ta filesystems twn allwn H/Y poy epishs exoyn NFS, dwste y.

To ISO9660 - Brisketai sta perissotera CD-ROMs. An exete monada CD-ROM, kai 8elete na th blepei to Linux, apanthste y.

Ma, den jerw poia filesystems xreiazomai!

Entajei, dwste mount. H ejodos ths entolhs 8a einai kapws etsi :

    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)

Koitajte se ka8e grammh : H lejh dipla sthn type deixnei ton tupo toy filesystem. Sto paradeigma mas ta filesystems / kai /usr einai second extended, xrhsimopoiw to /proc, kai yparxei kai mia disketa poy ekana mount, h opoia einai toy msdos (mpliax!) filesystem.

Dokimaste na dwsete cat /proc/filesystems, an exete energopoihsei to /proc : 8a dwsei mia lista twn filesystems poy exei o pyrhnas sas.

H ru8mish spaniwn, mh shmantikwn filesystems parafoyskwnei ton pyrhna. Diabaste sthn enothta gia ta modules pws to apofeugoyme ayto, kai thn enothta "Pagides" gia to giati enas parafoyskwmenos pyrhnas einai anepi8umhtos.

Syskeyes xarakthrwn (Character devices)

Edw energopoieite toys drivers gia ton ektypwth sas (dhl. ton parallhlo ektypwth), gia to pontiki tupoy busmouse h PS/2 (polloi forhtoi H/Y xrhsimopoioun to prwtokollo PS/2 gia tis trackballs poy exoyne), gia merikes monades magnhtikhs tainias, kai gia alles paromoies syskeyes "xarakthrwn". Dwste y gia opoia syskeyh exete.

Shmeiwsh : to gpm einai ena programma, poy energopoiei to pontiki (ejw apo to periballon twn X-Windows) gia cut kai paste anamesa se (virtual) konsoles. Paei mia xara me ta seiriaka pontikia, epeidh mporei na synyparxei kala me ta X, alla xreiazontai eidika kolpa gia toys alloys tupoys pontikiwn.

Hxos

An exete idiaiterh epi8ymia n' akousete to biff na gabgizei, dwste y, kai meta 8a peite sto programma ry8misewn o,ti exei sxesh me thn karta hxoy sas. (Mia shmeiwsh gia tis ry8miseis ths kartas hxoy : Otan sas rwthsei an 8elete na egkatasthsete thn plhrh ekdosh toy driver, mporeite n' apanthsete n kai na ejoikonomhsete kamposh mnhmh ston pyrhna, dialegontas mono ta xarakthristika poy 8ewreite aparaithta.)

An 8elete na kanete sobarh yposthrijh sthn karta hxoy, koitajte kai toys dwrean drivers sto http://www.linux.org.uk/OSS/, kai toys emporikous toy Open Sound System (OSS), sto http://www.opensound.com/.

Alles parametroi ry8misewn

Edw den parati8entai oles oi epiloges ry8misewn, epeidh allazoyn arketa syxna, h epeidh einai sxetika aytonohtes (px h yposthrijh gia 3Com 3C509 shmainei na kanoyme compile ton driver ths sygkekrimenhs kartas ethernet.) Yparxei mia arketa periektikh lista olwn twn epilogwn (syn enas tropos na tis eisagoyme sto script Configure), apo mia prospa8eia poy arxise kai synthreitai apo ton Axel Boldt (boldt@math.ucsb.edu), kai prokeitai gia thn online boh8eia. Ayth h lista einai epishs dia8esimh se morfh enos terastioy arxeioy (poy brisketai sthn ekdosh 2.0), toy Documentation/Configure.help sto dentro twn dirs toy source kwdika toy pyrhna toy Linux sas.

Xakema toy pyrhna

>Apo to README toy Linus :

Oi leptomereies ths ru8mishs gia "xakema toy pyrhna (kernel hacking)" synh8ws dhmioyrgoun enan megalutero h argotero pyrhna (h kai ta duo), kai mporoun akomh na kanoyn ton pyrhna ligotero sta8ero, otan ry8mizoyme roytines, poy panta caxnoyn ston kakogrammeno kwdika gia na broyn ta problhmata toy pyrhna (h kmalloc() ). Epomenws, pi8anotata na prepei n' apanthsete "n" se sxetikes erwthseis gia pyrhna "paragwghs".

3.4 Kai twra, ti; (To arxeio Makefile)

Afou teleiwsete tis ry8miseis, ena mhnyma sas leei oti o pyrhnas sas einai ry8mismenos, kai na "elegjete to epanw-epanw epipedo toy Makefile gia epipleon ry8miseis (check the top-level Makefile for additional configuration)", klp.

Ara, koitazoyme to Makefile. Pi8anotata na mh xreiastei na to allajoyme, alla pote den blaptei mia matia. Mporoume epishs n' allajoyme tis epiloges toy otan etoimastei o neos pyrhnas, me thn entolh rdev. Ean ais8aneste sta xamena koitazontas to arxeio ayto, tote mhn asxolh8eite.


Next Previous Contents