Linux -Blue forest free software | Return to home page | Site Map | Search WWW | Contact Us |
Your current position : Homepage > Free Software > Technological exchanges >System Management


    

Blue Forest http://www.lslnet.com at 20:18 on April 6, 2006


FreeBSD shallow!

From http://www.csdn.net/Develop/Article/17/17592.shtm

Heading Adventures stormful shallow FreeBSD (bass)
  
Keyword FreeBSD
  


FreeBSD shallow!

End may be just the reason that Tim could be just a little baby because my family reasons. End of this month, too, I have no way to check their minds how to write procedures. Every day, I sat in front of a computer, not watching movies on the Internet is not present to the killing. Www.linuxsir.com bbs in the day saw a rapid rate articles on FreeBSD start Gnome. This has caused me great interest, a sense of preparation can do.

I have heard of FreeBSD, but we have never played. In the past, I feel, is devoted to FreeBSD running on the server, use the command line used for operation. Haha, just a FreeBSD novice. This article, I documented installation, configuration FreeBSD process. I wrote this article the aim is to prevent a period of time, I have forgotten the details of installation; Besides, it was to share their experience with FreeBSD lovers, like me, some of the beginners can take fewer detours.

1, installed the version of FreeBSD

Since I knew nothing about FreeBSD, like such a simple issue has become a major problem. To find the answers, I search the linuxsir the bbs. There are many versions of FreeBSD in the prawn, roughly as follows :

A) 4.7. It is FreeBSD-4 the current stable release version.
B) 4.8. It is the current version of RC2.
C) 5.0. It is a new branch of FreeBSD is said to the Chinese support is not that good.
  
I chose the 4.7 version. Oh, I just backward. When others are installed RedHat 8.0, I installed 7.3. Then, even more of his house, where he considers safe.

2, and how to obtain FreeBSD

This, to me, is a big problem. I look on the Internet for a long time and did not find a faster download FreeBSD FTP Site. No way to the final, go home ftp.freebsd.org try FreeBSD, and even download speed is 150k/s, cool. If the use wget visit ftp.freebsd.org need additional parameters --passive-ftp.
Wget-r ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/ISO-IMAGES/4.7/ --passive-ftp

FreeBSD 4.7 had a total of five CDs :
-rw-r--r-- 1 ftpuser ftpusers 639729664 Oct 10 00:11 4.7-disc1.iso
-rw-r--r-- 1 ftpuser ftpusers 666075136 Oct 9 09:17 4.7-disc2.iso
-rw-r--r-- 1 ftpuser ftpusers 654835712 Oct 8 12:13 4.7-disc3.iso
-rw-r--r-- 1 ftpuser ftpusers 648937472 Oct 8 Gutierrez 4.7-disc4.iso
-rw-r--r-- 1 ftpuser ftpusers 198672384 Oct 10 01:07 4.7-mini.iso

I later learned that the only 4.7-mini.iso need to download this CD will do. In FreeBSD, largely through Ports completed the installation of the software.

3, the installation of FreeBSD

Installation of the system in this part written before, I introduce my machine configuration :

CPU PIII 733
Memory 512M
IDE0 60G Dos
IDE1 15G
IDE2 15G Linux
IDE3 CDROM
Sound cs4281
Video Radeon7500
Ps/2 Mouse
Network VIA VT6102 Rhine II 10/100BaseTX + ADSL
  
I use FreeBSD FreeBSD install the hard disk installation. CD FreeBSD mirror Kaodao put a FAT32 Division Lane. Produced by the installation of two start diskette. This is a two disk mirror floppies/kern.flp and floppies/mfsroot.flp respectively.

DOS/Windows implemented :
A : TOOLS\RAWRITE FLOPPIES\KERN.FLP
A : TOOLS\RAWRITE FLOPPIES\MFSROOT.FLP
  
Linux implementation :
Dd if=kern.flp of=/dev/fd0
Dd if=mfsroot.flp of=/dev/fd0
  
Use floppy disks guide machine interface finally see the installation of FreeBSD. Oh, is surprisingly simple, even smaller than the earlier SCO UNIX installation interface. I chose to install the hard disk interface Lane installation, the installation of FreeBSD results suggest that I could not find documents, why? Switching to Windows, searched for a long time know the information necessary to document the installation of FreeBSD in a Dos main branch, but kept a list of necessary documents is a list of root area FREEBSD catalog. This installation procedure is quite handicapped, RedHat now lags far behind the installation procedure. Buy a personal, four years ago, they finally found a piece of 2G hard disk. Murder of this document put FreeBSD installed on the hard disk, and hang on to IDE0. This time, the installation process was finally found in the FreeBSD installation documentation.

In line with the concept of zoning FreeBSD see different between Windows and Linux. The following paragraph is an extract from my http://www.powerba.com/develop/os/unix/article/20010601003.htm.

In FreeBSD, the concept of zoning is slightly different. FreeBSD will be divided into up to four hard disk tomography (fragments), a tomography another partition can be divided into a maximum of eight (district). Lane will DOS/Windows FreeBSD is a district as a tomography. In the subsequent narrative, will be used FreeBSD notion that the disk partition tomography and terminology.

Personally, I feel tomography role in the expansion should be equivalent to the Windows Division. I intend to install FreeBSD IDE1 on the hard disk. Due to the lack of experience, the tacit all set up :
A) block in the creation of a hard disk tomography.
B) creating FreeBSD tomography zoning district acquiescence way.
C) Installation Boot Manager to the MBR IDE1 (ad1).
D) All options to install software installed Ports. Oh, I simply do not know what Ports. In any case, let installed on the first installed.
  
Quickly installed on the end. It is not how fast FreeBSD, but the number of Package installation procedures have never installed. Bios changes, IDE1 to guide the hard disk. So, I entered the FreeBSD.


3, Boot Manager

Before carrying out other configurations, I would like to resolve the multiple channel. After all, both switching BIOS is too cumbersome. When a Windows and Unix operating systems installed in a machine, the installation of Boot Mananger all the time must be very careful. Previously, the use of the time it had suffered heavy defeat RedHat 6.2. Time, the bank had to put linux Hu installed in the MBR on the hard disk where Windows, Windows guide is not up. Finally, in order to avoid making mistakes that I use every single piece of hard disk operating system and install their own MBR Boot Manager. In the past, I even installed on diskette Lilo, the only time since launching a sector, slow slow anywhere. Later, I used Windows NT OS Loader multiple guide.

In the past such as Linux, I was a bit operation :

A) dd if=/dev/ad1 of=bootsect.bsd bs=512 count=1
B) under c:\ bootsect.bsd copy of Windows.
C) editing boot.ini, adding his c:\bootsect.bsd= "FreeBSD 4.7."
D) channel system.
  
This time, I saw an NT OS Boot Loader choice of menu. I would like to be able to test whether the normal FreeBSD guide, so I chose FreeBSD 4.7 menu items. OK, show the FreeBSD Boot Manager menu. I F1 button, trying to draw FreeBSD. This time :

. . . . . . . . . . . . . . . . . . . . . . . . . . Disaster! ! !
. . . . . . . . . . . . . . . . . . . . . . . . . . This is not blocked me and I jumped! ! !

What happens? FreeBSD Boot Manager of the Windows OS Loader again snap the menu. How else? Unclear. I chose Windows 2000, to enter Windows, the Internet is how the dark matter. But. . . . . . . . . Windows does not start up. I restart, the result is still the same again to try Windows. Halo. I immediately went to Linux, and Windows FDisk look at the district. . . . . . . . . . . Found that the IDE1 IDE0 the Windows Division into the area of FreeBSD. The hard disk is IDE0 and IDE1 zoning district on the hard drive completely different. Halo death.

How will this end? ?Windows, No Internet, I have to go to the FreeBSD FreeBSD going at HandBook. HandBook on FreeBSD and NT OS Loader is described :

A) If the FreeBSD and Windows installed in the same hard disk that can copy directly to the Windows under /boot/boot1 document as a guide.
B) if not installed in the same hard disk, /boot/boot1 can guide FreeBSD. This time we need /boot/boot0. But we can not simply copy the whole boot0 to Windows. Boot0 equivalent to the FreeBSD Boot Manager. Each time capturing the District Manager of the operation table by the district judge last active signs started operating system. When activated with a certain operating system Manager, the Manager rewriting zoning tables.

Now I know, I just equivalent to the implementation of the operation (in fact) boot0 Lane, a copy of Windows. This is the most I have seen a Boot Manager of the unscrupulous. Have you ever seen a more unscrupulous?

As to how Windows NT OS Loader and use boot0 joint together, I do not know. Because, as I dared not try. After all, it takes a very long time to re-install Windows. Before the installation of FreeBSD, for safety's sake, I do my projects Looking back now to my digital camera. But I have a lot of information on all the hard disks lost, especially our baby from birth to the now 400-plus photographs. Really distressed!

Therefore become a FreeBSD installation of Windows 2000 installed. In the process of installing Windows 2000, I think : If Looking did not, how do I do? Diverted, to open a small shop to buy.

After this heavy blow, I really wanted to give up FreeBSD. Oh, but that was not my style. Not only to FreeBSD, but must resolve the multiple problems started. The FreeBSD Boot Mannager not so, for a better on Boot Mananger. I chose the Grub.

Cd /usr/ports/sysutils/grub
Make install clean

OK, good grub installed. FreeBSD's Ports is a good thing.
Mkdir /boot/grub
Cp /usr/local/share/grub/i386-freebsd/* /boot/grub

For safety's sake, I started making a grub floppy disks.
Dd if=/boot/grub/stage1 of=/dev/fd0 bs=512 count=1
Dd if=/boot/stage2 of=/dev/fd0 bs=512 seek=1

Launched into the grub floppy disk interface with the world.
Enter FreeBSD :
Root (hd1,0, a)
Kernel /boot/loader
  
Into Windows 2000
Rootnoverify (hd0,0)
Chainloader +1

These are OK, Grub is a good Eastern. In light of the above editorial /boot/grub/menu.lst Grub orders. I want to install GRUB IDE1, FreeBSD is located on the hard disk MBR. GRUB GRUB implemented in the following order.

Find /boot/grub/stage1
Root (hd1,0, a)
Setup (hd1)
  
OK, GRUB successfully installed in the MBR on IDE1. Reboot. However, in GRUB FreeBSD and Windows were not activated. How else? Return FreeBSD, I GRUB to install diskette.

Find /boot/grub/stage1
Root (hd1,0, a)
Setup (fd0)

Restart, everything will be all right, whether Windows or FreeBSD guide is no problem. This is a gui. Later, I found, GRUB installation to which the MBR IDE, the IDE hard disk which will run for the GRUB things hd0. In my circumstances, the GRUB hd distributed as follows :

IDE0 hd1
IDE1 hd0
IDE2 hd2
IDE3 hd3

It was necessary to amend the menu.lst hd. However, the guidance system in Windows, we need hd0 on. GRUB on the map when it needs to order and exchange hd0 hd1. After the revised menu.lst as follows :

Default 0
Timeout 30

Windows 2000 title
Map (hd0) (hd1)
Map (hd1) (hd0)
Rootnoverify (hd1,0)
Chainloader +1

Title FreeBSD
Root (hd0,0, a)
Kernel /boot/loader

This time, and finally all the Pacific.



4, crazy mouse

FreeBSD I play with the original purpose, which is to look at whether FreeBSD initiated GNome linuxsir like the prawn who said so quickly. Therefore, in solving the multiple problems started, I immediately began distribution of X-Window.

/stand/sysinstall
  
Mouse and display card distribution began. However, the distribution of the mouse when they encounter a problem. My mouse is a PS/2 mouse photoelectric. In the allocation of the mouse, choose type of ps/2 mouse, the mouse will be on the screen lush and I became really crazy rats. Choose other types, either still crazy, or bleeding into the dead rats. I Tianya, how I so unlucky that way.

Internet data, but no solutions. Try various means, or is still crazy. Change the mouse, so immediately. Oh, but that was not my style. FreeBSD ps/2 mouse in the end the only thing driving population. FreeBSD it is especially good that it is very complete information on the man. Device Driver on the way to find out the information? "Device-name man." FreeBSD are driven by the ps/2 mouse psm. So we can only find out the man psm psm configuration. Psm lies in the flags. I am concerned about the flags bit spaces are as follows :

0-3 bit the mouse sampling rate. It controlled the speed of the mouse. In Windows, ps/2 mouse sampling rate of 100ppi. Therefore bit 3 to 1.
4-7 is a bit accelerated mouse. Windows were generally middle-accelerated mouse. Therefore, the value is 8 Band
If the bit bit nine home spaces psm never try to identify the type of mouse, only ps/2 mouse as a standard mouse driver. This is the key.
  
The flags can start the configuration file set up, can be translated through the kernel installed.

A) in the configuration file, add the following provision : an amendment /boot/kernel.conf content.
  
En psm0
Ir psm0 12
F psm0 0x284
   
B) compiler kernel. Kernel configuration file in place

Atkbdc? irq device psm0 at 12
Revise
0x284 irq 12 flags at atkbdc? device psm0

This crazy rat was finally subdued. But I also lost some things : I do not use the mouse roller. Although I will not 车 mouse, but mouse 车 still be included in the allocation method bars here. Imwheel package must first install the software put the mouse 4 and 5 healthy converted into the corresponding hotkey. Therefore, in order to install the software necessary to use mouse 车.

Cd /usr/ports/x11/imwheel
Make install clean

Cp /usr/X11R6/etc/imwheelrc ~/.imwheelrc
You can amend their personal preferences. Imwheelrc documents. In. Xinitrc added below this line to start imwheel.

Imwheel k

火 ps/2 mouse, a total of five healthy.
One left click
2 right click
3 middle click
4 车 up
5 车 down
Therefore, you need to tell what the key is moused 车 healthy. /stand/sysinstall Procedures in the distribution of the mouse, the mouse flages installed into 'z 4'. /etc/rc.conf Documents in his or adding :
Moused_flags= "z 4"

Oh, and the above mentioned here flages flags which is not about to die. Psm above is that the flags, the flags are moused.

Meanwhile, you have to tell X-Windows on 车 information. InputDevice mouse in adding about two lines :
Option "Buttons" "5"
Option "ZAxisMapping" "4 5"

Of course, the above-mentioned terms of the allocation is for five healthy ps/2 mouse. If more than five healthy mouse, the corresponding revised figures.



5, ADSL

In 96 years time, I use the Internet Modem. Slow access time, but expensive, so I did not think of how important the Internet, the main source of knowledge bookstores. But now I can hardly live without the Internet. Daily data and writing procedures is my life.

End allocation of the mouse, I immediately began deployment of ADSL. This relatively smooth, successful distribution on the Internet and look up the information quickly.

First, check Kernel Configuration File, the following number. If they are not included, and re-editing kernel. FreeBSD 4.7 pairs of ADSL is giving tacit support to the general public without having to re-translation kernel.
Options NETGRAPH
Options NETGRAPH_PPPOE
Options NETGRAPH_SOCKET
Options NETGRAPH_ETHER
Options NETGRAPH_IFACE

Second, the amended /etc/ppp/ppp.conf add the following text :
Adsl :
PPPoE : # equipment such as network adapter device set my PPPoE:vr0 device configuration is set.
Set mru 1492
Set mtu 1492
Set dial
Set Login
Set ifaddr 10.0.0.1/0 10.0.0.2/0
Add default HISADDR
Senat enable yes
Authname set a user name #
Authkey set a password #

What is not clear if equipment to detect rc.conf find ifconfig_???. ? ? ? Network General is specific equipment, I was vr0. If not, use /stand/sysinstall allocation.

Now, what can be ordered through the start pppoe.
Ppp -dedicated adsl

If your ADSL is a monthly basis, you may want to start pppoe switched on. Especially in FreeBSD, it is not stranding network. /etc/rc.conf Can add some content to be automatically activated pppoe.
Ppp_enable= "yes"
Ppp_mode= "ddial"
Ppp_nat= "yes"
Ppp_profile= "adsl"
The above examples of the last line of adsl adsl and the corresponding /etc/ppp/ppp.conf, is both to maintain unity. If your provider also supported pppoe Senat (NETWORK ADDRESS TRANSLATION), you do not have the distribution gateway and dns.

Adsl modem does not necessarily included in the network card. Undermining adsl modems can be inserted there. I have read many articles that used two LAN Access network adapter configuration adsl article, I do not understand. Adsl modem inserted directly undermining not put on more simple? Only need to change their modems and undermining cross lines between the lines. Interested friends how to produce overlapping lines can be found http://data.96963.com/20030117/1037437.shtml. When I have three computer is connected to the Internet in this way, huh, huh, friend to me every day about online fighting Diablo.


6, XFree86 and KDE

Finally learned about the FreeBSD operating under the X-Window. China XFree86 in FreeBSD 4.7 is the current version 4.2.1, KDE 3.0.3 is the current version. End FreeBSD 4.7 installation, you may not want to enter the Window Manager. It was very simple configuration, editing ~/.xinitrc document, if the document did not create the document. According to the WM types you want to start amending the document :

A) To start KDE, the paper added startkde.
B) If we start GNOME, the paper added gnome-session.
  
Then, the operation startx started corresponding WM. Alternatively, the direct operating gnome-session startx startkde or startx to start KDE or GNOME.

After a short wait, I can finally see my familiar with the KDE interface. In my machine, FreeBSD 4.7 linuxsir start of the KDE and GNOME do not say who the prawn so fast. But conscience is indeed faster than RedHat and MDK.

However, I quickly found a new issue, I have a very slow speed chip renewable. When I used xf86config allocation XWindow time, I do not see my ATI Radeon 7500 chip types. Therefore, I direct editing /etc/X11/XFConfig-4 documents compulsory Display Driver is radeon. I use grep radeon /var/log/XFree86.0.log order to detect the start XFree86 log, but found no radeon content. It appears that the driver was not correct radeon chip loading. After a half-day of online search, I found only two possible solutions :

A) The installation drm-kmod package to loading radeon.ko module.
B) upgrade to XFree86 4.3.
  
At this time, the FreeBSD Ports played a great power. Drm-kmod I first installed, the process is as follows :

Whereis drm-kmod
Drm-kmod : /usr/ports/graphics/drm-kmod show :
Cd /usr/ports/graphics/drm-kmod
Make install clean
   
Soon, drm-kmod on the installation a success. This time, I can see a new radeon.ko the module. I used to load the module radeon.ko kldload order, but a wrong message Data Format Error. Really strange, I had to check the Internet, said the problem could be AGP compatible. It only plans to use the b :

Cd /usr/ports/x11/XFree86-4
Make install clean
   
XFree86 installed through ports faster than I imagined, because it does not operate any translation, it seems that the installation is a direct binary version. XFree86-4 installed, I synchronization of my Ports, specific steps are as follows :

If not installed cvsup packages installed cvsup.
Whereis cvsup
/usr/ports/net/cvsup Show :
Cd /usr/ports/net/cvsup
Make install clean
Thus, the installation of a cvsup. ~/ /usr/share/examples/cvsup/ports-supfile To put copies of documents, editing ~/ports-supfile. *default Host ports where his modify their contents into the ftp address. Due to the size of a very large Ports, the Ports of a document must be compressed into tgz 17, 8M, so it is best to find a mirror sites. FreeBSD mirror briefly Surprisingly, a domestic mirror cvsup.cn.freebsd.org. Executive orders are now synchronized Ports :
   
2 g L cvsup ~/ports-supfile
   
A few minutes later, after upgrading ports, and a few minutes later, the upgrade to get XFree86. XWindow start, and then look /var/log/XFree86.0.log, she has been upgraded to 4.3, but in normal radeon driven home. Now, I have already upgraded the XFree86, KDE then you are upgrading the bars. FreeBSD is the KDE freebsd.kde.org official website. , Where you can download the binary release version kde3. However, I use the Ports to install kde3 :

Cd /usr/ports/x11/kde3
Make install clean
   
This time, I saw a lot of translated information. , I was once in the compiler under kde3 SuSe, it is a painful process. All you have to rely on the relationship between themselves. But in FreeBSD's Ports, everything becomes simple. Ports have completed all the things for me, huh, huh, except that the above two lines into healthy order. But translating KDE months long process, I spent the last 24 hours. So I turned off the monitor, go to sleep.

The next day, I see my new KDE, KDE 3.1. Very good, very beautiful, some of those really XP style icon.





7, Ports, and Software Package

Now my FreeBSD system is a very pure, almost without installing any software. In Linux, I have not used the software installed wget and curl. An 装Linux at the time, I generally choose to install all the software, but I do not know what 99% of the software used. The reason to choose to install all missed what worries me is that although there are RedHat rpm, it will be months of the installation package is not an easy task and in many cases depends on your luck and ability.

FreeBSD is in the package and what kind of management mechanism? FreeBSD has a package management mechanism, but not like RedHat RPM is only one rpm order FreeBSD packages managed by a team composed of order. As each of the parameters are very few orders, it would seem easier to use. These orders are as follows :

Pkg_add to install software
Pkg_delete unloading software
Pkg_create creating software releases
Pkg_info show information software
Pkg_update software upgrade
A summary of all software installed generating pkg_version

All pkg_??? orders on the software support, and automatic processing capability is very strong. Oh, of course, the order is not automatic unloading pkg_delete all rely on the software, but if you have no intention of doing that will not work.

At present, the most commonly used and is pkg_add pkg_info. Only need a simple "pkg_add Bao Bao were ̲ version. Tgz "orders can be completed installation of a package. If the need for other software packages will be automatically installed in the order. If you download all four of the ISO CD FreeBSD 4.7, the software you have a huge reservoir. If you want to install a list of all the package, needed only pkg_add * order. But only one-time installation of 200 software pkg_add. If you want to put it four ISO Lane, the one-time package are installed on the use pkg_add probably is not simple, but there was no need in a sysinstall a choice of this order with the following test :

Cd package where Contents
Find. -name "*.tgz" Pkg_add {} 12th -exec

Oh, wait patiently bars. This approach, although feasible, the use of FreeBSD, I had no intention of doing that person.

My favorite method is to use pkg_add pkg_add Remote Installation :

Pkg_add-r packets were

Ftp.freebsd.org to the order will automatically download and install software, if the software does not depend on the installation of the software, it will automatically download and install. Of course, you may not use ftp.freebsd.org, and the use of other mirror sites faster. FTP_PASSIVE_MODE the order environment is a very important variable in the value of the tacit consent of the circumstances under which the environmental variables is yes. It controls fetch use passive mode operation, which is required by ftp.freebsd.org.

While there are thousands of software on FreeBSD, you can use the following order to see if there are 6,578 software packages. But this is far from all.

Pea ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-4.7-release/Latest/ | wc-l-s

Let us use the following order to see how many ports, there are software packages :

Cd /usr/ports
Find. -name "Pkg-descr" | wc

Now, there are 8,014 ports in the software can be installed. Ports in the end what it is then? Ports in my eyes is a huge directory structure, it has the structure gradual breakdown of various software packages, and the final list is a specific software package. In a list of specific software packages generally where there are four documents :

Makefile
Distinfo
Pkg-descr
Pkg-plist
  
Distinfo the document contains a number of documents and software downloaded from the Internet md5 information, or anything else. Pkg-descr packet contains a description of information, which is registered to FreeBSD's package management database. When used pkg_info to check the contents of a packet, the information will be displayed. Pkg_plist document includes installation of the packages to install and unloading of the package of documents and to delete the list of the documents and catalog information management packages have registered to the library for FreeBSD and pkg_delete pkg_info use. FreeBSD's package management depot located /var/db/pkg catalog.

Here the most important documents Makefile. It describes the need to download, which documents the envelope, the envelope on what packages. This document control the downloading and installation of the testing on all processes. It can be said that the process is very complicated, huh, huh, it is not necessary for the mild adventures Lane said. However, users manipulate very simple. Only need to install a roll following operations :

Cd /usr/ports/??/??/ packet Contents
Make install clean build
  
You can use clean, but downloading and compiling the provisional document may have tremendous. Software such as KDE, you may have to spend a few 100 megahertz of hard disk space. As Ports software is downloaded from the Internet and then install the compiler, sometimes resulting in the installation of a web site may be able to defeat. In most cases, this situation need not worry, Ports will be the first to the main points of the software download that if he did not make it to the Makefile description of the other download sites, it will not succeed ftp.freebsd.org to download. If there is no ftp.freebsd.org, Oh installation failure. Such cases are rare, but it did, for example sourceforge.net to domestic users are closed. Oh, damn you to the Americans. When I encountered when installing mplayer this time avifile.sourceforge.net it falters, it is not nothing. You can find a proxy server on the Internet, using a browser to that site through proxy servers, for example avifile.sourceforge.net. Unable to download the software to find and download it to /usr/ports/distfiles catalog. Then continue to make bars.

I ftp.freebsd.org repeatedly mentioned here, it is acquiescence ports in the main station. It is not the only choice, if you think it is too slow to MASTER_SITES environmental variables can be amended at the other mirror sites.

If you do not know which one to the list of software in the ports, the solution can be used below :

A) If you know the precise name of the software, such as wget can be used :
Whereis wget
   
B) If you do not know the exact name, then search with it :
  
Cd /usr/ports
Make search key=???
   
Some say the BSD Ports is the house that the remark was but, really delicious meal together.

Installation is installed on the remaining installed. Xmms, mplayer, opera, mozilla, phoenix, like what equipment installed on any bars. Before, I was always worried about too little support FreeBSD software, I now completely at ease. Phoenix often encountered in the installation of low perl version, use use.perl port order.




8, a Chinese FreeBSD

It is very irritating, but can do nothing about it. Speaking of these, most of the XFree86 and MW into Chinese, and the Linux operating a Chinese operation is basically the same. Put copies of Windows simsun.ttc /usr/X11R6/lib/X11/fonts/TrueType/simsun.ttf Road. KDE is used to operate the simplest installation process and the size of the fonts installed. KDE revision of the ancillary functions of the regional and country / region and language changes KDE theme and the appearance of fonts. For the shell, add the following text :

A) sh bash or revise ~/.profile added :
LC_ALL=zh_CN.EUC
LANG=zh_CN.EUC
LC_CTYPE=zh_CN.EUC
Export LC_CTYPE LC_ALL LANG

B) tcsh (this is FreeBSD acquiescence) to amend ~/.cshrc added :
Setenv LC_ALL zh_CN.EUC
Setenv LANG zh_CN.EUC
Setenv LC_CTYPE zh_CN.EUC

When you re-enter the KDE time, we can see a very nice interface. For KDE procedures, such Speaking on the list. But as a non-KDE xmms procedures, or do not see simsun font. Had no choice but to implement the following operations :

A) The installation package ttfm
B) the fonts.dir other documents generated simsun
Cd /usr/X11R6/lib/X11/fonts/TrueType
Ttfm --add xttfm simsun.ttf
C) amend XF86Config-4 documents in the Files of Lane, insert the following :
FontPath "/usr/X11R6/lib/X11/fonts/TrueType"
Lane of the Module to ensure that the following line :
Load "xtt"
   
KDE re-entry, then we can see xmms simsun smile. As I seldom use GNOME, there is no finished, not knowing how finished GNOME.

Speaking End styles, it has added a man input. I have previously used chinput feel so so. Reported a mood to try something a bit ports search unexpectedly chinput. Really happy.

Cd /usr/ports/chinese/chinput3
Make install clean build
  
Laws ~/.xinitrc, before the commencement of the order WM, KDE is startkde example, add the following line :

Export XMODIFIERS=@im=Chinput
Chinput &
  
Re-enter the KDE use CTRL+SPACE, huh, huh, see the importation Chinput input method. But to tell the truth, chinput really is a very general. Internet room and see if there is any better. So, I found a very good Chinese online forum FreeBSD, http://community.freebsdchina.org. The Forum has an installed at the CAS xsim http://community.freebsdchina.org/phpBB/viewtopic.php?t=1921. Xsim What, I wonder, is the input method anyway. Equipped with a try. Xsim in Ports there is not, to download a http://sourceforge.net/projects/xsim. Now that the contents of the said articles are taken from above.

Download xsim-0.3.9.4.tar.gz
Download xsim--data-freebsd-gb2312.tar.gz
Downloaded to /tmp/xsim
Tar zxvf xsim-0.3.9.4.tar.gz
Tar zxvf xsim-data-freebsd-gb2312.tar.gz
Cd xsim-0.3.9.4
Please explain to readers installed
. /configure --with-cn-locale=EUC
Make
Make install
Cd. . /
Xsim-data-freebsd-gb2312.tar.gz put into the paper bag to untie (mpg across a catalog)
Put this catalog
/usr/local/xsim/
China

Then, for some confirmation work
Confirmed the existence of /usr/X11R6/lib/X11/locale/zh_CN/XI18N_OBJS
Document
If not, can copy this /usr/X11R6/lib/X11/locale/zh/XI18N_OBJS

Laws /usr/X11R6/lib/X11/locale/zh_CN/XI18N_OBJS
Notes of his entourage had __XlcEucLoader

Amend. Xinitrc or documents xsession
Adding
Export XMODIFIERS=@im=XSIM
Xsim &


I gradually in accordance with the above operation, operation completed quickly. I withdrew from KDE and then re-enter, huh, huh, the KDE eye. Suggested DCOP wrong. How else? In. Xinitrc and eliminate XMODIFIERS xsim, KDE also normal. Later, I found that when I started startx xsim.core found a list of the documents. Haha, it seems xsim anomaly in the time from the start. Actually, this is not a message that the above problems, but I think they are smart. Compiler xsim ago, I watched the README.cn xsim that document, in which he mentions that it can achieve their mission of the state kde put on the wound. So I added a time in configure parameters :

. /configure --with-cn-locale=EUC --enable-status-kde3
  
我把--enable-status-kde3参数去掉重新配置编译:
  ./configure --with-cn-locale=EUC
  make clean
  make
  make install
  
然后,进入KDE,这回一切正常。xsim很正常的调用出来了。但我感觉xsim也很一般。

上面的错误虽然浪费了我很长时间,但让我对XIM服务器有了一定的了解,对我下面的配置工作有了很大的帮助。如果在加载XIM服务器后,进入不了WM,比如KDE或GNOME,基本上就是WM和XIM之间无法建立联接的原因。DCOP通讯超时,WM就退出了。无法建立联接基本上是由下面两种原因造成的:

  a)XIM服务器异常退出。就象上面发生的情况。
  b)XIM服务器没有正常的初始化。这大多数始由于LC_ALL、LC_CTYPE和LANG这些locale环境变量造成的。
  
在BSD里,中文locale是zh_CN.EUC,这对于那些判断locale的输入法来说就成了很大的问题。这些输入法都查看locale是否是zh_CN.GB2312或zh_CN。

我在RedHat下使用过小企鹅输入法fcitx,挺好用的,在linuxsir上有它的很多信息。那么,在FreeBSD上能不能用它呢?试试看把。我下载了小企鹅输入法的输入法的源代码包fcitx-1.8.2.tar.gz。我对于XIM几乎没有什么了解,但连蒙带唬的编译软件包却是我的特长。先make一下试试,呵呵出错。那就修改一下Makefile吧:

  把Makefile中的如下内容
  CFLAGS= -O2 -fno-strength-reduce
  INC =  -I/usr/X11R6/include -I
  LIB = -L/usr/X11R6/lib -lX11
  修改成
  CFLAGS= -O2 -fno-strength-reduce -DSIGUNUSED=32
  INC =  -I/usr/X11R6/include -I. -I/usr/local/include/
  LIB = -L/usr/X11R6/lib -lX11 -L/usr/local/lib -liconv

再make一下,呵呵,当然成功了。但fcitx还是不好使。嗯,研究研究。fcitx源代码写的非常工整,看上去很养眼睛。软件模块划分也非常清楚,因此跟踪起来也非常容易。埃,国内要是多一些这样的程序员就好了。fcitx的作者所在的公司真是好福气。

大致上,我简单修改了fcitx的代码。由于我只是想让它再FreeBSD上运行,因此没有作什么判断,而是暴力修改。

修改文件xim.c,查找关键字IMOpenIM所在的行。删除该行,把它替换成如下内容:

   ims = IMOpenIM (dpy,
    IMModifiers, "Xi18n",
    IMServerWindow, im_window,
    IMServerName, imname,
    IMLocale, "zh_CN",
    IMServerTransport, transport,
    IMInputStyles, input_styles,
    IMEncodingList, encodings,
    IMOnKeysList, on_keys,
    IMProtocolHandler, MyProtoHandler,
    IMFilterEventMask, filter_mask,
    NULL);

该行下面几行,有3个函数调用IMSetIMValues,可以注释掉。当然,不注释掉也行。呵呵,但最后一个IMSetIMValues调用令我非常费解。

现在,fcitx可以正常运行了,但看不到汉字。编辑文件window.c,查找关键字XCreateFontSet,找到第二个匹配。第一个是XFT模式的。在函数XCreateFontSet前加一行:

    setlocale (LC_CTYPE, "zh_CN.EUC");
   
重新make,make install。修改~/.xinitrc 文件,添加如下内容:
  export XMODIFIERS=@im=fcitx
  fcitx &
  
重新进入KDE,一切OK。由于我没有仔细看fcitx的源代码,因此上面的修改是否要造成不良后果,我就不知道了。不过这篇文章就是用fcitx在FreeBSD下写的。感谢fcitx的作者。修改了你的代码,你可别生气呀。

汉化的XFree86和KDE后,下一个要解决的问题就是FreeBSD的中文文件名问题。这才是真正的FreeBSD汉化。不过操作起来很简单。在FreeBSD中,当你用ls中文文件名的时候,看到的不是各种乱码,而是多个?号或者-号。这时候,需要安装gnuls和gbfs包。使用上面的Ports操作,可以很容易安装他们。安装后reboot系统。你会在启动信息里看到一些错误信息:

module_register: module cd9660 already exists!
linker_file_sysinit "cd9660.ko" failed to register! 17

如果你没有看清楚,查看/var/log/message。查看/usr/local/etc/rc.d看到里面多了一个启动脚本gbfs.sh。其内容是用kldload加载/usr/local/modules下的模块。到/usr/local/modules/下看看,看到里面有两个模块文件cd9660.ko和msdos.ko。使用kldload来手动加载cd9660.ko。依然显示上面的错误。上网查资料才知道,需要修改kernel配置文件注释掉以下几行:
options        MSDOSFS                 #MSDOS Filesystem
options        CD9660                  #ISO 9660 Filesystem
options        CD9660_ROOT             #CD-ROM usable as root, CD9660 required
然后重新编译并安装内核。ok先试试,反正FreeBSD编译内核的速度奇快。编译、安装内核后,reboot。但错误依然。这是怎么回事?这时,我在想为什么要注释掉上面呢三行,难道说要让FreeBSD不支持msdos和cd文件系统?显然不是,因为我还是可以mount上fat分区。我想,这可能是要强制FreeBSD对msdos和cd文件系统的支持在module模式下运行。而我在/etc/fstab中添加了在启动时mount我的fat分区的内容。因此FreeBSD先使用了原来的msdos.ko。当gbfs.sh加载自己的msdos.ko时,当然回出现错误了。ok,试试看。把/modules/cd9660.ko和/modules/msdos.ko备份一下。然后把/usr/local/modules/msdos.ko和/usr/local/modules/cd9660.ko拷贝到/modules下,删除/usr/local/etc/rc.d/gbfs.sh。reboot系统。在~/.cshrc下增加如下内容:

  alias ls 'gnuls --show-control-chars'

这回看看msdos下的中文文件名。哈哈,OK了。




9、奇怪的UDMA错误

每次我启动FreeBSD的时候,都会在dmesg中出现下面的错误:

ad1s1a: UDMA ICRC error reading fsbn 255 of 96-127 (ad1s1 bn 255; cn 0 tn 4 sn 3) retrying

呵呵,可不是只出现一行,而是出现一打。有时,在控制台上还会反复出现。这时怎么回事?以前没时间处理它,现在可要研究研究了。上网查查,基本上没有什么结果。看看man吧。man ata。ata是ATA/ATAPI控制器的驱动。它说ata总是尝试使用控制器通道的最高速率来初始化。在我的机器上就是udma66。如果初始化失败,它会把相应的通道降到PIO模式。这就是上面那个错误的原因。但是可以使用atacontrol来控制。使用atacontrol mode 0命令看看,我的IDE1果然工作在PIO4模式。我的BIOS告诉我,我的IDE1是udma33,使用atacontrol mode 0 1 udma33后,我的IDE1控制器,回到了udma33模式。但我不知道,pio4和udma33在FreeBSD上的速度到底有多达的差距。我写了一个perl脚本来测算速度,脚本如下:

#!/usr/bin/perl

`rm Looking.rar`;
$t = time();
`cp /usr/Looking.rar .`;
$t = time() - $t;

print "$t\n";

Looking.rar这个文件有270M。我记录下了两种模式下运行该脚本的时间。
                  REBOOT后第一次运行的速度           多次运行后的速度
PIO4              57秒                              29秒
UDMA33            27秒                              11秒

这个速度上的差距真的是非常惊人。但我不知道如何强制ata在udma模式下运行,只好写了一个脚本放到/usr/local/rc.d下,该脚本叫ata.sh,内容如下:

/sbin/atacontrol mode 0 1 udma33
/sbin/atacontrol mode 1 1 udma33

尽管那些错误在启动的时候依然存在,但我的心里感觉好多了。



10、后记

我到http://www.kde-look.org/上找了一个好看的桌面开始了我幸福的FreeBSD生活。我做的最后一件事情是删除了我的RedHat 7.3。这并不是说,FreeBSD比Linux强。我虽然是一名程序员,但我不是搞系统内核的,我没有资格评判哪种系统更优秀。我只是一个玩家,一个使用者。FreeBSD的纯净、单纯、强大,深深的赢得了我的心。世界上只有一个FreeBSD,区别只是版本问题。FreeBSD是那么的不追求名利。你原意使是就使,FreeBSD绝不去推销自己。而现在的Linux世界却充满了商业,令我的心真的很烦。现在,世界终于安宁了。

:roll:

FreeBSD浅度历险

...

好象写得蛮有意思的.  :)

FreeBSD浅度历险

谢谢提供!!!

FreeBSD浅度历险

FreeBSD到现在为止还是一个纯洁的学术性系统,也是由于这种特性,很多商业软件支持跟linux无法相比~
sigh
因为商业公司认为他们无法控制core team这帮榆木脑袋的家伙

FreeBSD浅度历险

...

是啊,商业大型数据库linux下能跑,FreeBSD就只能看着人家咽口水~~~

FreeBSD浅度历险

[quote][i]原帖由 "红袖添香" 发表:[/i]
...

是啊,商业大型数据库linux下能跑,FreeBSD就只能看着人家咽口水~~~[/quote]

给他们多一点时间好吗>;>;>;???

FreeBSD浅度历险

嗯,我很少看完过文章的,但这篇还是认真读了一下的,至少有1/3是好东东,推荐!

FreeBSD浅度历险

[quote][i]原帖由 "zyme"]嗯,我很少看完过文章的,但这篇还是认真读了一下的,至少有1/3是好东东,推荐![/quote 发表:[/i]
花了一个钟头的时间看完了!(过程中给领导叫去N次!)偶不能评价写得好不好,因为偶发现我跟作者完全是不同档次的人!!偶比他低了不知道N的N次方级!!!

这篇文章不单止收藏、还打印出来保存好呢!!

想想看,自己真的很菜!!

FreeBSD浅度历险

偶崇拜,偶收藏。

FreeBSD浅度历险

太好了,咱们这个版又出了一个大佬级人物。

FreeBSD浅度历险

偶花了1.5元才看完的,因为我在网吧,失业中,惨~~~~~~~~

哎,什么世道,我再哭~~~~~~~~

FreeBSD浅度历险

[quote][i]原帖由 "白狐狸" 发表:[/i]
偶花了1.5元才看完的,因为我在网吧,失业中,惨~~~~~~~~

哎,什么世道,我再哭~~~~~~~~[/quote]

塞翁失马,焉知非福~~~

FreeBSD浅度历险

一点提示~
关于drm的部分如果您使用的是ATI的Rage Radeon
Matrox G200 G400和Voodoo3/5的显示卡,安装这个
drm-kmod的话将会提供这些显卡的3d加速功能,注意这个并不是这些显卡的驱动而是3d加速支持软件,如果想使用的话需要在ports里面安装完毕之后在/usr/local/etc/rc.d里面把drm.sh.sample改名成drm.sh然后需要在内核配置文件中添加device agp否则无法挂载这些模块

FreeBSD浅度历险

[quote][i]原帖由 "白狐狸" 发表:[/i]
偶花了1.5元才看完的,因为我在网吧,失业中,惨~~~~~~~~

哎,什么世道,我再哭~~~~~~~~[/quote]

没拿笔记本抄下来啊?!哎…………赶快花点钱买一个笔记本抄下来!!!好好珍藏啊!! :lol:

FreeBSD浅度历险

[quote][i]原帖由 "memoza"]太好了,咱们这个版又出了一个大佬级人物。[/quote 发表:[/i]


那位老大好象没来过这里喔!!!可惜啊!!谁能把他拖过来啊?!这个任务就交给163老大了。

FreeBSD浅度历险

对于大家来说一个好消息是XSIM已经于昨天加入了freebsd的ports计划,方便了大家的使用

FreeBSD浅度历险

最难忘的经典文章!

FreeBSD浅度历险

有这样技术的,还有这样耐心写下这篇文章的人真的不太多哦。
号召大家向他看齐!!!!!!!!! :oops:  :!:  :twisted:  :idea:

FreeBSD浅度历险

[quote][i]原帖由 "liuhudi" 发表:[/i]
有这样技术的,还有这样耐心写下这篇文章的人真的不太多哦。
号召大家向他看齐!!!!!!!!! :oops:  :!:  :twisted:  :idea:[/quote]最好能把这位虾拉到我们这个版来!!!

FreeBSD浅度历险

看看是个佬人,不是新手 :shock:  :shock:



Copyright © 1999-2000 LSLNET.COM. All rights reserved. 蓝森林网站 版权所有。 E-mail : webmaster@lslnet.com