FreeBSD Shallow Insurance

xiaoxiao2021-03-06  98

FreeBSD Shallow Insurance

Turn: Stormful's Blog

It may be the original reason for the year, or it may be because the home has just added a baby. How many months I have been in the year, I have no way to write the program. It is not a moving movie every day. I saw a post on FreeBSD starting gnome speed god speed on the BBS of www.linuxsir.com. This caused my great interest, and I used it itch.

I have heard of FreeBSD before, but I have never played. In my previous feelings, FreeBSD is a dedicated operating system that is specifically running on the server with command line operations. Haha, pure one freebsd rookie. This article records me to install, configure freebsd. On the one hand, the purpose of writing this article is to prevent me from forgotten the details of the installation; on the other hand, share the experience with FreeBSD fans. For beginners like me, I can take less detours less.

1. Which version of FreeBSD is installed?

Since I don't know about FreeBSD, I have a big problem like this simple problem. In order to find the answer, I paralped over LinuxSir's BBS. There are many freebsd prawns about version issues, which is approximately the following:

a) 4.7. It is the current stable distribution of FreeBSD-4. B) 4.8. Its current version is RC2. C) 5.0. It is a new branch of FreeBSD, it is said to support Chinese support is not too good. I chose 4.7. Oh, I am backward. When others are loading redhat 8.0, I have 7.3. Oh, more worry.

2, how to get FreeBSD

This is also a big problem for me. I got online for a long time, and I didn't find a faster download freeBSD's FTP site. Finally, I can't do it. I will try FreeBSD's hometown ftp.freebsd.org. Actually download speed is 150k / s, cool. If you use Wget to access ftp.freebsd.org, you need additional parameters - Passive-FTP. Wget - Passive-ftp -r ftp://ftp.freebsd.org/pub/freebsd/releases/i386/iso-images/4.7/

FreeBSD 4.7 has 5 light discs: -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 - r - 1 ftpuser ftpusers 648937472 OCT 8 12:47 4.7-Disc4.iso -rw-r - r - 1 ftpuser ftpusers 198672384 OCT 10 01:07 4.7-mini.iso

I learned later, in fact, I only need to download 4.7-mini.iso this disc. In FreeBSD, the installation software is basically completed by Ports.

3, install FreeBSD

In front of this section of the installation system, I will introduce my machine configuration:

CPU PIII 733 Memory 512M IDE0 60G DOS IDE1 15G IDE2 15G Linux IDE3 CDROM Sound CS4281 Video Radeon7500 Mouse PS / 2 Network VIA VT6102 RHINE II 10 / 100BaseTX ADSL I use FreeBSD hard drive installation installation freebsd. Put the FreeBSD disc image to a FAT32 partition. Two installation boot floppy disks have been made. The mirror of these two floppy disks is Floppies / Kern.flp and Floppies / MFSROOT.FLP. DOS / Windows execution: Tools / Rawrite Floppies / Kern.flp A: Tools / Rawrite Floppies / MFSROOT.FLP A: Linux Under DD IF = Kern.flp of = / dev / fd0 DD if = mfsroot.flp of = / dev / fd0 boot the machine with a floppy disk, and finally see the installation interface of FreeBSD. Oh, it is really simple, even more than the early SCO UNIX installation interface. In the installation interface I chose the hard disk installation, the results prompt I can't find the freebsd installation file, what reason? Switch to Windows, check the online check for half a day to know that freebsd's installation file must be in a DOS primary partition, and the directory where the file is stored must be the FreeBSD directory of the partition root directory. This installer is really mentally mentally, which is far more than the rending installer now. After a tip of the box, I finally found a 2G hard drive 4 years ago. Put the FreeBSD installation file on this hard disk and hang it on the IDE0. This back to freeBSD is finally found installation file.

The partition concept of FreeBSD is different from Windows and Linux. The following paragraph is I extracted from http://www.powerba.com/develop/os/unix/Article/20010601003.htm.

In FreeBSD, the concept of partition is slightly different. FreeBSD divides the hard disk into up to four slice (fragments), each SLICE can be divided into up to 8 partitions. That is, FreeBSD regards a partition in DOS / Windows as a slice. In the later narrative, the concept of FreeBSD, the hard disk partition terminology of Slice and Partition.

I personally feel that the role of Slice should be equivalent to the extension partition of Windows. I am planning to install FreeBSD on the hard drive on Ide1. Due to no experience, everything takes a default setting: a) build a slice on the entire hard disk. B) Establish a FreeBSD partition in Slice, default partition. C) Install the MBR (AD1) of Boot Manager to IDE1. D) Install the software type to select all, install the ports. Oh, I didn't know what ports at all at all. Anyway, let the installation are installed first. Soon, the installation is over. This is not how fast freebsd, but the installer has not installed how much package. Modify the BIOS, order IDE1 to boot the hard drive. So I entered FreeBSD.

3, Boot Manager

Before conducting other configurations, I want to solve multiple boot problems first. After all, it is too much trouble to change BIOS. When you install the Windows and UNIX class operating systems on a machine, be careful when installing all kinds of boot mananger. Previously, when I used Redhat 6.2, I have eaten a big loss. At that time, Huri Hu was installed on the MBR of the hard disk where Windows is located, and the Windows can't be guided. Later, in order to avoid errors, I used a hard drive alone and installed Boot Manager on their respective MBRs. Before, I even installed LILO on the floppy disk, just read a sector when started, slowly slowly. Later, I used Windows NT's OS Loader to make multiple boots. As with the previous work as it is, I have conducted operations:

a) DD if = / dev / ad1 of = bootsect.bsd BS = 512 count = 1 b) Copy bootsect.bsd to Windows C: / under. C) Edit Boot.ini, add a line C: /BootSect.BSD= "FreeBSD 4.7". D) Reboot the system. At this time, I saw the Boot selection menu of NT OS Loader. I want to test whether FreeBSD can be guided normally, so I chose the FreeBSD 4.7 menu item. OK, display the Boot Manager menu of FreeBSD. I press the button F1 and want to guide FreeBSD. At this moment:

.......................... The disaster happened! ! ! ........................ Don't stop this, I want to jump! ! !

what happened? Freebsd's boot manager actually jumped back to the Windows OS Loader menu. what happened? Not clear. I chose Windows 2000, I want to enter Windows, what is going on online? But ......... WINDOWS can't start. I am restarted, trying to enter the Windows result again. gosh. I quickly ran to Linux and use fdisk to see the partitions of Windows. ........ Discovery, the Windows partition on IDE0 becomes the FreeBSD partition on IDE1. That is to say, the partition of the hard disk on the IDE0 is exactly the same as the partition of the hard disk on the IDE1. Dizzy.

How can this be this? Windows is finished, I can't get online, I have to go to FreeBSD to see FreeBSD Handbook. Handbook About FreeBSD and NT OS Loader are described in this:

a) If FreeBSD and Windows are installed on the same hard disk, you can copy / boot / boot1 directly to Windows under the boot file. B) If it is not installed on the same hard disk, / boot / boot1 cannot boot FreeBSD. This time you need / boot / boot0. But you can't copy Boot0 to Windows. Boot0 is equivalent to the boot manager of FreeBSD. Each time the manager reads the partition table at a time, it is judged the operating system of the last started Active flag through the partition. When an operating system is started with Manager, the Manager rewrite the partition table. Now I know, the operation I have implemented is equivalent to (actually) copying boot0 to Windows. This is the most lack of Boot Manager I have ever seen. Have you seen more detrimental? As for how to use Windows NT OS Loader and Boot0 to use together, I don't know. Because, I didn't dare to try again. After all, reinstalling Windows takes a long time. Before installing FreeBSD, I will back up the items I am doing now to my digital camera. But my hard disk is all lost, especially our baby from birth to more than 400 photos. It's really distressed!

So the installation of FreeBSD has become a installation of Windows 2000. In the process of installing Windows 2000, I am thinking: if looking is gone, what should I do? Change, go to the small buy shop.

After this heavy blow, I really want to give up FreeBSD. Oh, but that is not my style. Not only want freebsd, but must be solved with multiple boot problems. FreeBSD's boot mannager does not dare to make a better boot mananger. I chose GRUB.

CD / USR / PORTS / SYSUTILS / GRUBMAKE INSTALL CLEAN

OK, GRUB is installed. FreeBSD's ports is really a good thing. MKDIR / BOOT / GRUBCP / USR / LOCAL / Share / GRUB / I386-FreeBSD / * / BOOT / GRUB

For safety, I made a GRUB boot floppy disk. DD if = / boot / grub / stage1 of = / dev / fd0 bs = 512 count = 1dd if = / boot / stage2 of = / dev / fd0 bs = 512 seek = 1

Start with a floppy disk to enter the GRUB interaction interface. Enter FreeBSD: root (HD1, 0, A) Kernel / Boot / Loader Enter Windows 2000 Rootnoverify (HD0, 0) ChainLoader 1

All OK, GRUB is really a good stuff. Edit /Boot/grub/menu.lst according to the grub command above. I want to install the grub on the IDE1, which is the MBR of the hard disk where FreeBSD is located. Perform the following grub command in GRUB.

Find / boot / grub / stage1 root (HD1, 0, A) Setup (HD1) OK, GRUB is successfully installed on the MBR of IDE1. Reboot. However, FreeBSD and Windows cannot be started in GRUB. what happened? Go back to FreeBSD, I installed the grub onto the floppy disk.

Find / boot / grub / stage1 root (HD1, 0, A) setup (fd0)

Restart, everything is normal, whether it is Windows or FreeBSD boot. This is really a ghost. Later I found that the grub installed on which IDE MBR, which Ide on the hard drive on GRUB HD0. In this case, the HD distribution in GRUB is as follows: IDE0 HD1 IDE1 HD0 IDE2 HD2 IDE3 HD3

It is therefore necessary to modify the HD in Menu.lst. But the Windows system is guided, it must be on HD0. At this time, GRUB's MAP command is required to interchange HD0 and HD1. The modified menu.lst is as follows:

Default 0Timeout 30

Title Windows 2000 MAP (HD0) (HD1) (HD1) (HD0) Rootnoverify (HD1, 0) ChainLoader 1

Title Freebsd Root (HD0, 0, A) Kernel / Boot / Loader

This time, finally everything is peaceful.

4, Crazy Mouse

I play FreeBSD's initial purpose, just want to see if gnome is so fast in FreeBSD is as fast as the prawn on LinuxSir. Therefore, after solving the multi-start problem, I immediately start configuring X-Window.

/ Stand / SysInstall Start configuring the mouse and display card. However, when configuring the mouse, it encountered problems. My mouse is a PS / 2 optical mouse. When configuring the mouse, if you choose Mouse Type as PS / 2, my mouse will be in the screen, it has become a real crazy mouse. When choosing other types, either Crazy is either moving, it has become a dead mouse. My God, how do I so unlucky?

Check the information, but there is no solution. I don't want to do any way, or Crazy is still. Change the mouse and make it immediately. Oh, but that is not my style. Finally, I have to make my idea on the FreeBSD PS / 2 mouse. FreeBSD is a little particularly good, and its MAN is very complete. Find the way the device-driven information is what "man device-name" is "Man Device-Name". FreeBSD's PS / 2 mouse is driven named PSM. Therefore, only the Man PSM can find the configuration of the PSM. The key is the Flags of PSM. The Flags Bit bit of my concern is as follows:

Bit 0-3 sampling rate of the mouse. It controls the speed of this mouse. In Windows, the sampling rate of the PS / 2 mouse is 100ppi. Therefore, Bit 3 is 1. Bit 4-7 is the mouse acceleration. Windows Mouse acceleration is generally medium. Therefore, the value of the 4bit is 8 bit 9. This bit is set, and PSM does not try to identify the type of mouse, just drive the mouse as a standard PS / 2 mouse. This is the key. This Flags can be set in the launch profile or by compiling kernel settings.

a) Setting in the configuration file: Modify /boot/kernel.conf Add the following. EN PSM0 IR PSM0 12 F PSM0 0x284 b) Compile the kernel. DRIC PSM0 AT ATKBDC? IRQ 12 in the kernel configuration file into DEVICE PSM0 AT ATKBDC? Flags 0x284 IRQ 12

In this way, crazy mice finally been uniform. But I also lost something: I can't use the roller of the mouse. Although I can't use Mouse Wheel, I still write Mouse Wheel's configuration method. First install the IMWheel package, the package converts the 4, 5 health of the mouse to the corresponding hotkey. Therefore, you should install the package with Mouse Wheel. CD / USR / PORTS / X11 / Imwheelmake Install Clean

CP / USR / X11R6 / etc / imwheelrc ~ / .imwheelrc You can modify the .imwheelrc file according to personal preferences. Add this line to the .xinitrc to launch the Imwheel.

Imwheel -k

The Wheel PS / 2 mouse has 5 health. 1 Left Click 2 Right Click 3 Middle Click 4 Wheel Up 5 Wheel Down So, you must tell mouse which button is Wheel health. In the mouse configuration of the / stand / sysinstall program, set the '-Z 4' in the Mouse Flages. Or add a line in the /etc/rc.conf file: moused_flags = "- z 4"

Oh, this is not a matter of Flags and which Flags above. The one above is the PSM's Flags, this is a moused Flags.

At the same time, you have to tell X-windows about WHEEL information. Add two lines in InputDevice Mouse: Option "Buttons" "5" option "zaxismapp" "4 5"

Of course, the above configuration is only for 5 health PS / 2 mice. If the mouse is more than 5, modify the corresponding number.

5, ADSL

In 96 years, I use MODEM Internet. At that time, the Internet speed was slow, and it cost is expensive, so I didn't think the Internet is how important I have, the main knowledge source is a bookstore. But now I don't have an internet that I can't live. Check the information every day, write the program is my life.

Configure the mouse, I immediately start configuring the ADSL. This time, the online check information is successful.

First, look at the Kernel configuration file, have the following. If you don't add them, and recompile the kernel. FreeBSD 4.7 is the default support for ADSL, generally not to recompile the kernel. Options Netgraph Options Netgraph_pppoE Options Netgraph_Socket Options Netgraph_ETHER OPTIONS NETGRAPH_IFACE

Second, modify /etc/ppp/ppp.conf Add the following: ADSL: SET Device PPPOE: NIC device #, for example, my configuration is Set Device PPPoE: VR0. 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 Nat Enable Yes Set Authkey A # Password

If you don't know what is the device, check if rc.conf looks for ifconfig _ ???. ? ? ? Generally, specific network devices, I am VR0. If not, use the / Stand / SysInstall configuration.

Now, you can start PPPOE through the command. PPP -Dedicated adsl If your ADSL is a monthly, you may want to start PPPoE one by boot. Especially in FreeBSD, there is no network that is difficult. You can add the content from /etc/rc.conf to start PPPoE. PPP_ENABLE = "YES" PPP_MODE = "DDIAL" PPP_NAT = "YES" PPP_PROFILE = "ADSL" The ADSL paragraph of /etc/ppp/ppp.conf's ADSL segment in the last row of /etc/ppp/ppp.conf, that is, both Consistent. If your PPPoe provider also supports Nat (Network Address Translation), you don't need to configure Gateway and DNS. ADSL MODEM is not necessarily to insert on the NIC. You can insert the ADSL MODEM on the HUB. I saw a lot of articles on the Internet: I don't understand it with two network cards to configure the ADSL LAN Access. Isn't it easier to plug the ADSL MODEM directly on the HUB? This only needs to change the network cable between Modem and Hub to the fork line. For friends who are interested in intersections, you can see http://data.96963.com/20030117/1037437.shtml. I used to have 3 computers, just in this way, huh, huh, about our friends to my house, and play Diablo.

6, Xfree86 and KDE

Finally, I have to see X-windows under FreeBSD. The current version of XFree86 in FreeBSD 4.7 is 4.2.1, the current version of KDE is 3.0.3. After FREEBSD 4.7 is installed, it will not be able to enter the Window Manager you want. But it is easy to configure, edit ~ / .xinitrc file, if you don't have this file, create this file. Modify this file based on the WM type you want to start:

a) If you want to start KDE, add Startkde in this file. B) If you want to start GNOME, add a gnome-session in this file. Then, running StartX to start the corresponding WM. Alternatively, run the StartX Startkde or StartX gnome-session to start KDE or GNOME.

After a short wait, I finally saw the KDE interface I was familiar with. On my machine, FreeBSD 4.7 starts KDE and GNOME and there is no prawn on LinuxSir to say so fast. But speaking, it is really more than Redhat and MDK.

However, I will soon discover new problems, my graphics card refresh speed is very slow. When I configure XWindow with XF86Config, I didn't see my graphics card type ATI Radeon 7500. So I am directly editing / etc / x11 / xfconfig-4 file, forcing the designated graphics driver is Radeon. I use the command grep radeon /var/log/xfree86.0.log to view the XFree86 boot log, but no Radeon content is found. It seems that my Radeon graphics driver is not loaded correctly. After half-day online search, I can find only two ways:

a) Install the DRM-KMOD package to load the Radeon.ko module. B) Upgrade XFree86 to 4.3. At this time, FreeBSD's ports play a huge power. I first installed the DRM-KMOD, the process is as follows:

WHEREIS DRM-KMOD Show: DRM-KMOD: / USR / PORTS / Graphics / DRM-KMOD CD / USR / PORTS / Graphics / DRM-KMOD Make Install Clean is fast, DRM-KMOD is successful. At this time, I can see a new module radeon.ko. I use the command kldload radeon.ko to load the module, but the error message Data Format Error appears. It's strange, I have to check online, it is said that it may be an AGP compatibility issue. It seems that only B is planned: CD / usr / ports / x11 / xfree86-4 make install clean Install XFree86 via Ports to be fast than I imagined, because it does not have any compilation operation, as if it is directly installed is a binary version. Before installing Xfree86-4, I sync my ports, the specific steps are as follows:

If you do not have a CVSUP package, install CVSUP first. Whereis CVSUP Display: / usr / ports / net / cvsup CD / USR / PORTS / NET / CVSUP Make Install Clean, CVSUP is installed. Copy / USR / Share / Examples / CVSUP / PORTS-SUPFILE file to ~ / down, edit ~ / ports-support. * The content of the DEFAULT HOST is modified to the FTP address where Ports is located. Because Ports is very large, a ports that compresses the TGZ file should be 17, 8m, so it is best to find a mirror site. Check out FreeBSD's mirror, there is actually a domestic mirror cvsup.cn.freebsd.org. Now do the following command, synchronize ports: cvsup -g -l 2 ~ / ports-suppile After a few minutes, the PORTS upgrade is completed, after a few minutes, Xfree86 upgrades will be done. Start XWindow, then view /var/log/xfree86.0.log, and it has been upgraded to 4.3, and the Radeon drive home is normal. Since I have upgraded Xfree86, then the KDE is upgraded. The official site of KDE under FreeBSD is FreeBSD.kde.org. There, you can download the Binary Release version of KDE3. However, I am using Ports to install KDE3:

CD / USR / PORTS / X11 / KDE3 Make Install Clean, I saw a lot of compilation information. In the past, I compiled a KDE3 in SUSE, which is really a painful process. All relying on relationships You must control yourself. But in the freebsd ports, everything is so simple. Ports have completed all things for me, huh, in addition to the two lines above. Compiling KDE is a long process, last time I have been almost 24 hours. So I turned off the monitor and went to sleep.

The next day, I saw my new KDE, KDE 3.1. Very good, very beautiful, those icons are really a Some XP style.

7, Ports, Package and Software

Now my FreeBSD is still a very pure system, there is almost no package. The software WGET and CURL I have used under Linux are not installed. When installing Linux, I usually choose to install all the packages, but 99% of the software I don't know what to do. The reason why I have to choose all installation is what I am worried about, although there is rpm on the redhat, but the installation package to be successfully installed is not easy. Many cases you want to see your luck and ability. What is the package management mechanism under FreeBSD? FreeBSD also has a package management mechanism, but it is not an RPM command with RPM, and FreeBSD's package management is made up of a set of commands. Since the parameters of each command are very small, it seems that it seems easier to use. These orders are as follows:

PKG_ADD Installation Pack PKG_DELETE Uninstall Pack PKG_CREATE Creating Pub Pack PKG_Info Display Package Information Pkg_UPDate Upgrade Pack PKG_UPDATE Upgrade Pack PKG_Version Generates All PKG_ ??? Commands All PKG_ ??? commands support software packs, and automated processing capabilities Very strong. Oh, of course, the pkg_delete command is not automatically uninstalling all the relying software packages, but if you are, there is nothing wrong with it.

Currently, I use PKG_ADD and PKG_INFO. Simply "pkg_add package name _ package version .tgz" command can complete a package installation. If this package needs other packages that this command will be installed automatically. If you download all 4 FreeBSD 4.7 ISO CD, you have a huge software library. If you want to install all Package in a directory, just use the command pkg_add *. But PKG_ADD can only install 200 packages at one time. If you want to place the four ISO's package on the four ISOs, I am afraid, but I don't need one to choose in sysinstall, try the following command:

The directory found for the CD package find. -Name "* .tgz" -exec pkg_add {} /;

Oh, wait patiently. Although this method is feasible, but people who use FreeBSD, I am afraid that no one is in this way.

My favorite PKG_ADD method is to use the remote installation of PKG_ADD:

PKG_ADD -R package name

This command will automatically download and install the package to ftp.freebsd.org, if the package has a package that does not have installed, it will also download and install it. Of course, you can use ftp.freebsd.org to use other faster mirror sites. An environment variable ftp_passive_mode is very important to the command, by default, the value of this environment variable is YES. It controls the FETCH operation using the Passive mode, which is required for ftp.freebsd.org.

Although there are thousands of packages on FreeBSD, you can use this command to see if there are 6578 packages. But this is far from all.

Curl -l -s ftp://ftp.freebsd.org/pub/freebsd/ports/i386/packages-4.7-release/LATEST/ | WC

Let's use the following command to see how many packages in Ports:

CD / usr / portsfind. -Name "pkg-descr" | WC

Now, there is 8014 installed packages in my ports. So what is Ports? Ports is a huge directory structure in my eyes, which is classified in this structure to classify various packages, and the final directory is a specific package. There are usually four files in a directory where a specific package is located: makefile distinfo pkg-descr pkg-plist file Distinfo contains the MD5 information of some files to download from the web, or nothing. PKG-DESCR includes a description of the package that is registered in the FreeBSD's package management library. This information is displayed when viewing the content of a packet with pkg_info. The PKG_PLIST file contains the files and directories to be installed when installing the package, and the files and directories to be deleted when the package is uninstalled, which also register to the FreeBSD package management library for PKG_INFO and PKG_DELETE. FreeBSD's package management library is located in / var / db / pkg directory.

Makefile when this is the most important file. It describes which files need to download this package, which is relying on which packages are rely. This file controls all the processes that download and install detection dependence. Its work process can be said to be very complicated, huh, huh, there is no need to say in a shallow experience. However, it is very simple to manipulate users. To install a package, you only need to do the following:

CD / USR / PORTS / ?? / ?? / package catalog Make Build Install Clean You can not use Clean, but the temporary files generated by downloading and compiling can be very huge. A package like KDE may take up a hundred trillion hard disk space. Since Ports is downloading packages from the Internet and then compiling installations, sometimes some sites may not go to causing the installation to fail. In most cases, don't worry that there will be this situation, Ports will first download on the main station of the software. If it is not successful, it will download on other sites described by Makefile, if it is not successful, it will go to FTP. Freebsd.org is downloaded, if there is no ftp.freebsd.org, huh, installation failed. This situation rarely occurs, but not, such as SourceForge.net is closed to domestic users. Oh, the dead Americans. When I met this situation when I installed Mplayer, I didn't go on Avifile.SourceForge.Net, but it was not a way. You can find a proxy server online, using the browser to pass the proxy server to that site, such as avifile.sourceforge.net. Find the package that cannot be downloaded, download it to the / usr / ports / distfiles directory. Then continue Make.

Here I repeatedly mention ftp.freebsd.org, which is the default master of Ports. But it's not the only choice, if you think it's too slow, you can modify the environment variable master_sites to point to other mirror sites.

If you don't know where a software is in the directory of Ports, you can use the following method to resolve:

a) If you know the exact name of the software, if you wget, you can use: Whereis wget b) If you don't know the accurate name, you will look at the search: CD / usr / ports make search key = ??? Someone said Ports is the BSD's signature, this is really a little, it is a delicious meal.

The rest is to install the installation and install it. XMMS, MPLAYER, OPERA, Mozilla, Phoenix, what do you want to install? I have been worried about supporting FreeBSD too little software, and now I am completely relieved. When you install Phoenix, you will have a case where the Perl version is too low, use the use.perl port command. 8, FreeBSD's Chinese

This is really annoying, but there is no way. These Chinese, in fact, most of them are Chinesea for XFree86 and MW, so the operation is basically the same as the Chinese operation on Linux. Put Windows SIMSUN.TTC copy channel /usr/x11r6/lib/x11/FONTS/TRueTyPe/SIMSun.ttf. The simplest operation is to install the font with the font installer of KDE. Modify country / regions and languages ​​in KDE and auxiliary feature, modify KDE's appearance and fonts in the subject. Add the following for different shells:

a) For SH or BASH modifications ~ / .profile Add: lc_all = zh_cn.euc lang = zh_cn.euc lc_cType = zh_cn.euc export lc_all lang lc_cType

b) For TCSH (this is freeBSD default) modification ~ / .cshrc Add: setENV LC_ALL EN_CN.EUC STENV LANG EN_CN.EUC STENV LC_CTYPE EN_CN.EUC

When you enter KDE again, you can see very beautiful Chinese interface. For KDE programs, this is like this. But for non-KDE programs like XMMS, you can't see the SIMSUN font. No way, I have to do the following:

a) Install TTFM package B) Generate SIMSUN's FONTS.DIR and other file CD / USR / X11R6 / lib / x11 / fonts / trueType TTFM - ADD XTTFM SIMSUN.TTF C) Modify XF86Config-4 files, add as follows in Files segments Content: fontpath "/ usr / x11r6 / lib / x11 / fonts / trueType" ensures as follows: Load "XTT" re-enters KDE, then XMMS can see the SIMSUN font. Since I rarely use gnome, there is no Chinese, nor I don't know how to Chinese GNOME.

After the Chinese is complete, it is necessary to add a man input method. I used CHINPUT before, I felt. Reporting the mood of the mood, Search, Ports, actually there is chinput. It's really happy.

CD / USR / PORTS / CHINESE / CHINPUT3 Make Build Install Clean Modify ~ / .xinitrc, before starting the WM command, for KDE is startKDE, add as follows:

Export XModifiers = @ im = chinput chinput & re-enters KDE, use Ctrl Space, huh, I saw the input chinput input method. But it is true, chinput is really very general. Look online, see if there is better. So, I found a very good Chinese FreeBSD Forum on the Internet, http://community.freebsdchina.org. There is a drainage in this forum http://community.freebsdchina.org/phpb/viewtopic.php?t=1921. Xsim is what, don't know, anyway is an input method. Pack one try. Xsim is not in ports and downloads one of http://sourceforge.net/projects/xsim. The following content is taken from the previous post. Download XSIM-0.3.9.4.tar.gz Download XSIM - Data-FreeBSD-GB2312.TAR.GZ Download to / TMP / XSIMTAR ZXVF XSIM-0.3.9.4.tar.gztar ZXVF XSIM-DATA-FreeBSD-GB2312.TAR. GZCD XSIM-0.3.9.4 Please read the installation instructions yourself ./configure --with-cn-locale = eucmakemake installcd ../ Put the file unpacked in the XSIM-DATA-FreeBSD-GB2312.TAR.GZ package (full A DAT directory) put this directory into / usr / local / xsim /

Then, conduct some confirmation work confirmation presence / usr / x11r6 / lib / x11 / local / zh_cn / xi18n_objs file if not, you can copy this / usr / x11r6 / lib / x11 / local / zH / XI18N_OBJS

Modify / usr / x11r6 / lib / x11 / local / zh_cn / xi18n_objs comment __XLCEUCLOADER's line

Modify the .xinitrc or Xsession file to join export xmodifiers = @ @ = xsimxsim &

I follow the contents of the above steps and soon. I quit KDE and then re-entered it, huh, KDE. Prompt DCOP error. what happened? After the .xinitrc removes XModifiers and XSIM, KDE is normal. Later I found out that I found a XSim.core file in the directory when I started StartX. Haha, it seems that Xsim exits when it is started. In fact, this is not a problem with the post above, but I am smart. Before compiling XSim, I saw the XSim's readme.cn file, which mentioned that it enabled her own status creative on the task bar of KDE. So I added a parameter when I execute Configure:

./configure --with-cn-locale = Euc --enable-status-kde3 I remove the --enable-status-kde3 parameter Reconfigured compile: ./configure --with-cn-locale = Euc Make Clean make make make Install then, enter KDE, this is everything possible. XSim is very normal. But I feel XSim is also very general.

The above mistakes have been wasted for a long time, but let me have a certain understanding of the XIM server, which has a great help to the following configuration work. If the XIM server is loaded, WM is not entered, such as KDE or GNOME, basically the reason why the WM and XIM cannot establish a connection. DCOP communication timeout, WM is exited. Unable to establish a joint is basically caused by the following two reasons: a) XIM server abnormally exits. Just like the situation above. B) The XIM server is not normal initialization. Most of this started due to lc_all, lc_cType, and lang these locale environment variables. In BSD, Chinese Locale is zh_cn.euc, which has become a big problem for those who judge the input method of Locale. These input methods view whether Locale is zh_cn.gb2312 or zh_cn.

I used the small penguin input method under red to, very easy to use, there are many information on LinuxSir. So, can you use it on FreeBSD? Try it. I downloaded the source code package fcitx-1.8.2.tar.gz of the input method of the small penguin input method. I have little understanding of Xim, but even the compilation package is my special. Try it first, huh, huh, huen. Then modify Makefile:

CFLAGS = -O2 -FNO-Stregs = -O2 -FNO-Stregs -reduce -dsigunused = 32 inc = -i / usr / x11r6 / include -i. -i / usr / local / include / lib = -l / usr / x11r6 / lib -lx11 -l / usr / local / lib -liconv

Go again, huh, ok, of course, success. But FcitX is still not good. Well, research research. The Fcitx source code is very gentle, it looks very well. Software module is also very clear, so it is also very easy to track. Egypt, if there are more such programmers in China. The company where the FcitX author is really a good blessing.

In general, I simply modified the FcitX code. Since I just want it to run freebsd, there is no judgment, but violence modification.

Modify the file xim.c, find the row in the keyword IMOpenIM. Delete this line, replace it into the following:

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);

There are several lines below this line, and there are 3 functions to call IMSetImValues, which can be commented away. Of course, don't comment. Oh, but the last imsetimvalues ​​call makes me very well.

Now, FcitX can run normally, but you can't see Chinese characters. Edit files Window.c, find the keyword xcreatefontset, find the second match. The first is XFT mode. Before the function xcreatefontset: setLocale (lc_cType, "zh_cn.euc"); re-make, make install. Modify ~ / .xinitrc file, add the following: export xmodifiers = @ im = fcitx fcitx & re-enters KDE, everything OK. Since I didn't look carefully, I didn't know if I had a bad consequence in the above modification. However, this article is written in FreeBSD with fcitx. Thanks to the author of FCITX. Modify your code, don't you be angry?

After the Chinese Xfree86 and KDE, the next question to be solved is the Chinese file name issue of FreeBSD. This is the real freebsd Chinese. But it is simple to operate. In FreeBSD, when you use the LS Chinese file name, see it is not a variety of garbled, but multiple? No. or - number. At this time, you need to install GNULS and GBFS packages. Use the above Ports to make it easy to install them. After installing the Reboot system. You will see some error messages in the startup information:

Module_register: Module CD9660 Already Exists! Linker_file_sysinit "CD9660.ko" Failed to Register! 17

If you don't see clear, check / var / log / message. View /usr/local/etc/rc.d See a startup script GBFS.SH. Its content is the module loaded under / usr / local / modules with KldLoad. To / usr / local / modules / take a look, see two module files CD9660.KO and MSDos.ko inside. Use KldLoad to manually load CD9660.ko. Still displaying the above error. Online check data, you need to modify the Kernel configuration file comment out: options msdosfs # msdos FileSystemOptions CD9660 #iso 9660 FileSystemOptions CD9660_ROOT # CD-ROM usable as root, CD9660 Required then recompile and install the kernel. OK first try, anyway, FreeBSD compiles the kernel's speed. Compile, after installing the kernel, reboot. But the error is still. How is this going? At this time, I am thinking about why I want to get out of the three lines. Is it necessary to let FreeBSD does not support MSDOS and CD file systems? Obviously, because I can still on the FAT partition. I think this may be to force FreeBSD to support MSDOS and CD file systems in Module mode. And I added the contents of my FAT partition when I started in / etc / fstab. Therefore, FreeBSD first uses the original MSDOS.ko. When gbfs.sh loads its own MSDOS.ko, it is of course an error. OK, try it. Back up / Modules/cd9660.ko and /modules/msdos.ko. Then copy /us/local/modules/msdos.ko and/usr/local/modules/cd9660.ko to / modules, remove /usr/local/tc/rc.d/gbfs.sh. Reboot system. Add below ~ / .cshrc: Alias ​​Ls 'gnuls --Show-Control-Chars'

This look at the Chinese file name under MSDOS. Haha, ok.

9, strange UDMA error

Every time I start FreeBSD, I will appear below in Dmesg:

AD1S1A: UDMA ICRC ERROR READING FSBN 255 of 96-127 (AD1S1 BN 255; CN 0 TN 4 SN 3) Retrying

Oh, it's not only a line, but there is a fight. Sometimes, it will also appear repeated on the console. What happened at this time? I haven't had time to handle it before, and now you have to study research. Check online, basically there is no result. Take a look at Man. MAN ATA. ATA is the drive of the ATA / ATAPI controller. It said that ATA always tries to initialize the maximum speed of the controller channel. On my machine is UDMA66. If the initialization fails, it will drop the corresponding channel to the PIO mode. This is the reason why the above mistake. But you can use Atacontrol to control. Use the Atacontrol Mode 0 command to see, my IDE1 works in Pio4 mode. My BIOS tells me that my IDE1 is UDMA33, after using Atacontrol Mode 0 1 UDMA33, my IDE1 controller returns to UDMA33 mode. But I don't know, PIO4 and UDMA33 have up to the speed in FreeBSD. I wrote a Perl script to measure the speed, the script is as follows:

#! / usr / bin / perl

`rm looking.rar`; $ t = time ();` cp /usr/looking.rar.`; $ t = time () - $ T; print "$ T / N";

Looking.rar This file has 270m. I recorded the time running the script in two modes. Reboot After the first running speed multiple times, the speed PIO4 57 seconds 29 seconds UDMA33 27 seconds 11 seconds

The gap in this speed is really amazing. But I don't know how to force the ATA to run in UDMA mode, I have to write a script to /usr/local/rc.d, the script is atta.sh, the content is as follows:

/ sbin / attacontrol mode 0 1 UDMA33 / SBIN / ATACONTROL MODE 1 1 UDMA33

Although those mistakes still exist when they start, my heart feels much.

10, post

I went to http://www.kde-look.org/ found a good desktop and started my happy FreeBSD life. The last thing I did was deleted my RedHat 7.3. This is not to say, FreeBSD is strong than Linux. Although I am a programmer, I am not engaged in the system kernel, I have no qualification to judge which system is better. I am just a player, a user. FreeBSD is pure, simple, strong, deeply won my heart. There is only one freebsd in the world, the difference is just the version problem. FreeBSD is so do not pursue fame and fortune. Your origin is made, FreeBSD will never sell yourself. The current Linux world is full of business, making my heart very annoying. Now, the world is finally peaceful.

转载请注明原文地址:https://www.9cbs.com/read-106742.html

New Post(0)