studying linux in freebsd
Άγγελος Οικονομόπουλος
aoiko at cc.ece.ntua.gr
Thu Jul 25 05:30:02 EEST 2002
Kai mhn 3anakousw "den boh8as tous neous xrhstes"
An kapoios 8elei na 3ekinhsei na asxoleitai me ton phruna tou linux[0], alla
exei san desktop to freebsd[1] se i386 (kai den dia8etei allo mhxanhma), na
mia idea. disclaimer: I hate debuggers, alla fantazomai oti o gdb 8a
boh8hsei kapoion pou asxoleitai gia prwth fora me phrunes na akolou8hsei th
leitourgia tou phruna. >elementary os knowledge is assumed.
prwta diabazete ta docs tou bochs kai tou kgdb, kai thn info tou gdb. an
exete apories, mhn epixeirhsete auth th diadikasia. epishs uparxoun bugs
ston bochs & sto kgdb patch pou mporei na sunanthsete, alla exoun perasei 3
bdomades apo otan ekana th diadikasia kai den 8umamai ti akribws xreiazetai
na peiraxtei (xrhsimopoihsa palioterh ekdosh tou bochs). an exete apories
kai skefteste sobara na me rwthsete, 8a perimenete na gurisw sthn a8hna.
8eloume na bootaroume freebsd, na 3ekinhsoume ton phruna mesa ston bochs,
kai na ton tre3oume katw apo remote gdb (o opoios trexei sto freebsd).
# cd /usr/ports/emulators/bochs
(sthn parakatw grammh bazoume kai oti defines 8eloume - kalutera oxi smp)
# make install clean
ftiaxnoume h katebazoume ena image (xrhsimopoiw to debian-2.2r5) apo to site
tou bochs
katebazoume to phruna ths areskeias mas apo ena mirror, kai ton patcharoume
me to kgdb patch (kgdb.sourceforge.net). mporei na xreiastei ligo merging
(px. ebala mono to rmap patch anti tou -ac pou xrhsimopoiw, gia na meiwsw
tis diafores).
an den exoume ore3h na kanoume to compilation katw apo freebsd (8elei ligh
proergasia), mpoutaroume linux. se ka8e periptwsh, o phrunas prepei na
ginei compiled me support gia serial port kai gia ton epe3ergasth pou
e3omoiwnei o bochs.
kratame to source tree, kai metaferoume to bzImage sto /boot tou eikonikou
diskou tou bochs (px ftiaxnoume ena fs kai to dinoume san diskd h to kaime
se ena cdrw kai kanoume tis aparaithtes allages sto bochs gia na mporei na
prospelasei to cdrom (dinoume ta swsta ioctls)).
3ekiname bochs kai 8etoume ton neo phruna san boot option me ta analoga
flags pou perigrafontai sto site tou kgdb. reboot.
sto .bochsrc 8etoume san com1 px to /dev/ptyp9. trexoume ton bochs, kai
perimenoume mexri na mplokarei perimenontas sundesh apo ton gdb.
3ekiname ton gdb mesa sto source tree pou xrhsimopoihsame gia to build tou
phruna
$ cd /whatever/linux/
$ gdb vmlinux
(gdb) target remote /dev/ttyp9
kai ta eukola molis teleiwsan...
[0] paremferhs einai h diadikasia gia tous bsd phrunes
[1] h allo unix se i386
--
Make your program read from top to bottom.
- The Elements of Programming Style (Kernighan & Plaugher)
More information about the Linux-greek-users
mailing list