Index:
简介
Requirements
Step 1 查看当前机器自检信息.
Step 2备份原内核文件.
Step 3 编辑新内核描述文件.
Step 4 启用磁盘配额.
Step 5 控制台中禁用热启动
Step 6 内核编译前后对比.
Step 2 编译后的清理工作.
F.A.Q.
Links to other sources
简介
为你自己定制专用的内核,加入一些特定功能如QUOTA,禁止控制台重启,声卡,防火墙等,总之可以自己做到很多适合自己机器的配置。
Step 1 查看当前机器的自检信息.
内核编译最好本地操作,不要远程编译。
要是你修改过/etc/make.conf文件,一定要还原此文件。
确保/etc/make.conf文件如下
Shell:
cat /etc/make.conf
# added by use.perl 2007-11-24 22:06:09
PERL_VER=5.8.8
PERL_VERSION=5.8.8
查看当前机器的自检信息,取得CPU 内存显示卡硬盘网卡等信息Shell:
dmesg | less
查看/usr/src/Makefile文件,此文件说明注意事项和具体操作步骤
Shell:
cd /usr/src/
less /usr/src/Makefile
# For individuals wanting to build from the sources currently on their
# system, the simple instructions are:
#
# 1. `cd /usr/src' (or to the directory containing your source tree).
# 2. `make world'
#
# For individuals wanting to upgrade their sources (even if only a
# delta of a few days):
#
# 1. `cd /usr/src' (or to the directory containing your source tree).
# 2. `make buildworld'
# 3. `make buildkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC).
# 4. `make installkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC).
# 5. `reboot' (in single user mode: boot -s from the loader prompt).
# 6. `mergemaster -p'
# 7. `make installworld'
# 8. `make delete-old'
# 9. `mergemaster'
# 10. `reboot'
# 11. `make delete-old-libs' (in case no 3rd party program uses them anymore)
Step 2 备份当前内核描述文件.
查看当前机器内核描述文件
Shell:
uname -a
FreeBSD WOW.freemongolia.cn 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Fri Jan 12 10:40:27 UTC 2007 root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
备份当前机器内核描述文件
复制/usr/src/sys/i386/conf/GENERIC文件到/etc/WOW (WOW表示你自定义的名称)
Shell:
cp /usr/src/sys/i386/conf/GENERIC /etc/WOW
创建一个链接到/usr/src/sys/i386/conf/GENERIC/目录
Shell:
cd /usr/src/sys/i386/conf/
ln -s /etc/WOW /usr/src/sys/i386/conf/
Step 3 编辑内核描述文件.
编辑内核描述文件
添加磁盘配额、禁用控制台中的热启动、等功能
编辑内核描述文件,vi /usr/src/sys/i386/conf/WOW
Shell:
vi /usr/src/sys/i386/conf/WOW
Editor:
# 具体选项请参考http://www.freebsd.org/doc/zh_CN.GB2312/books/handbook/kernelconfig-config.html
ident WOW #内核标记名称
增加以下内容
options QUOTA #启用磁盘配额
options SC_DISABLE_REBOOT #在控制台禁用CTRL+ALT+DEL键
存盘退出
以下2项不要注销
device scbus # SCSI bus (required for SCSI)
device da # Direct Access (disks)
Step 4 编译内核.
编译内核
根据/usr/src/Makefile文件方法,进行编译内核
1、cd /usr/src (进入编译核心目录)
Shell:
cd /usr/src
2、make buildworld(很漫长的等待大约1小时左右,有没有更漫长的事情?有。Ports安装Xorg和Gnome,3天3夜,3天3夜。嗯?好熟悉的旋律……..) (更新版本)
Shell:
make buildworld
3、make buildkernel KERNCONF=你的内核描述文件名 (default is GENERIC) (下面的WOW是我的内核描述文件名称) (正式编译核心大约用时20分钟)
Shell:
make buildkernel KERNCONF=WOW
4、make installkernel KERNCONF=你的内核描述文件名 (default is GENERIC) (安装核心大约用时1分钟)
Shell:
make installkernel KERNCONF=WOW
5、reboot (重新启动进入单人模式,重启选择4;具体操作可以查看第1章忘记root密码怎么办)
Shell:
reboot
以下几步为在单人模式下操作
mount -u(重新挂载,参数-u表示挂载后可读写)
Shell:
单人模式#mount -u
mount -a(挂载全部磁盘,参数-a表示全部磁盘)
Shell:
单人模式#mount -a
cd /usr/src (进入编译核心目录)
Shell:
单人模式#cd /usr/src
mergemaster -p (此命令用来检验内核描述文件正确性)
Shell:
单人模式#mergemaster -p
*** Comparison complete
Do you wish to delete what is left of /var/tmp/temproot?[no]
make installworld (安装所有新的系统源代码,大约用时3分钟)
Shell:
单人模式#make installworld
mergemaster 系统询问是否删除/var/tmp/temproot目录时,按d键进行删除(用来更新或修改/etc的配置文件)
Shell:
单人模式#mergemaster
How should I deal with this? [Use the existing /var/tmp/temproot]d
系统提示发现/etc/rc.d/jail文件与旧的对比有变化,按键盘q键退出查看。询问对新文件怎么处理?按i键安装?还是按d键删除?还是按m键?我们没有编辑过的文件就选择新的,所以按i键选择安装。
Shell:
*** Displaying differences between ./etc/rc.d/jail and installed version
--- /etc/rc.d/jailFri Jan 12 15:42:21 2007
q
How should I deal with this? [Leave it for later]i
系统提示发现/etc/hosts文件与旧的对比有变化,按键盘q键退出查看。询问对新文件怎么处理?按i键安装?还是按d键删除?还是按m键?我们编辑过的文件就保留旧的配置,所以按d键选择删除新的。
Shell:
*** Displaying differences between ./etc/hosts and installed version
--- /etc/hosts Sun Nov 25 05:21:04 2007
+++./etc/hosts Sun Nov 25 20:29:23 2007
q
How should I deal with this? [Leave it for later]d
系统提示发现/etc/mote文件与旧的对比有变化,按键盘q键退出查看。询问对新文件怎么处理?按i键安装?还是按d键删除?还是按m键?motd的作用就是你登入系统时出现的那个欢迎词,我们看看新的欢迎词有没有变化,所以按i键选择安装新的。
Shell:
*** Displaying differences between ./etc/motd and installed version
--- /etc/motd Sun Nov 24 21:22:58 2007
+++./etc/motdSun Nov 25 20:29:23 2007
q
How should I deal with this? [Leave it for later]i
要不要删除/var/tmp/temproot目录,直接回车就行。
Shell:
Do you wish to delete what is left of /var/tmp/temproot? [no]
reboot (重启服务器)
Shell:
单人模式#reboot
Step 5 内核编译前后对比.
激动人心的时刻来临了,等了好几个小时后,我们现在要看看是否新内核安装成功了。
内核文件大小对比
编译后:
Shell:
du -h /boot/kernel
18M /boot/kernel
du -h /boot/kernel/kernel
2.7M /boot/kernel/kernel
编译前:
Shell:
du -h /boot/kernel.old/
23M /boot/kernel.old/
du -h /boot/kernel.old/kernel
6.8M /boot/kernel.old/kernel
内核配置文件名称对比
编译后:
Shell:
uname -a
FreeBSD ohaha.3322.org 6.2-RELEASE-p8 FreeBSD 6.2-RELEASE-p8#0: Sun Nov 25 12:04:05 CST 2007 root@WOW.ohaha.3322.org:/usr/obj/usr/src/sys/WOW i386
编译前:
Shell:
uname -a
FreeBSD ohaha.3322.org 6.2-RELEASE FreeBSD 6.2-RELEASE#0: Fri Jan 12 10:40:27 UTC 2007 root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
内核编译前后SSH侦听端口协议对比
编译后(去除IPV6支持):
Shell:
netstat -an
Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp4 0 52 192.168.0.88.22 192.168.0.8.1155 ESTABLISHED
tcp4 0 0 *.22 *.* LISTEN
udp4 0 0 *.514 *.*
Active UNIX domain sockets
Address Type Recv-Q Send-Q Inode Conn Refs Nextref Addr
c4e8071cstream 0 0 0 c4e807a8 0 0
编译前:
Shell:
netstat -an
Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp4 0 0 127.0.0.1.25 *.* LISTEN
tcp4 0 0 *.22 *.* LISTEN
tcp6 0 0 *.22 *.* LISTEN
udp4 0 0 *.514 *.*
udp6 0 0 *.514 *.*
Active UNIX domain sockets
Address Type Recv-Q Send-Q Inode Conn Refs Nextref Addr
c4e7c9d8 stream 0 0 0 0 0 0
登入时欢迎信息的对比
编译后(显示更人性化,居然会有一些操作技巧提示^_^):
Shell:
FreeBSD 6.2-RELEASE-p8 (WOW) #0: Sun Nov 25 12:04:05 CST 2007
Welcome to FreeBSD!
Before seeking technical support, please use the following resources:
>.............
You may also use sysinstall(8) to re-enter the installation and
configuration utility. Edit /etc/motd to change this login announcement.
To obtain a neat PostScript rendering of a manual page, use ``-t'' switch
of the man(1) utility: ``man -t ''. For example:
man -t grep >grep.ps # Save the PostScript version to a file
or
man -t printf | lp # Send the PostScript directly to printer
编译前:
Shell:
Welcome to FreeBSD!
Before seeking technical support, please use the following resources:
>………………
注:文中所说大约XX时间,是根据不同的机器配置会有出入。主要是看你的CPU,CPU够强劲,速度就够快,时间也就会少。
编译内核时CPU和内存占用
Shell:
top
last pid: 37445; load averages: 1.01, 0.74, 0.50 up 0+03:09:41 04:04:14
35 processes: 2 running, 33 sleeping
CPU states: 92.9%user, 0.0% nice, 6.7% system, 0.4% interrupt, 0.0% idle
Mem: 26MActive, 721MInact, 141MWired, 200K Cache, 111MBuf, 107MFree
Swap: 768MTotal, 768MFree
PID USERNAME THR PRI NICE SIZE RESSTATE TIME WCPU COMMAND
37444 0 1 121 0 6568K 6028K RUN 0:00 3.00% cc1
Step 4 内核编译完后的清理.
内核编译完成后,需要进行清理为下次编译做准备:
清理编译内核后的临时文件Shell:
cd /usr/obj/
chflags -R noschg *
rm -rf *
至此内核编译安装完成。
Step 6 F.A.Q.
Links to other sources
FreeBSD使用手册
FreeBSD使用手册_内核配置
附我的内核配置文件
# GENERIC -- Generic kernel configuration file for FreeBSD/i386
#
# For more information on this file, please read the handbook section on
# Kernel Configuration Files:
#
# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html
#
# The handbook is also available locally in /usr/share/doc/handbook
# if you've installed the doc distribution, otherwise always see the
# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the
# latest information.
#
# An exhaustive list of options and more detailed explanations of the
# device lines is also present in the ../../conf/NOTES and NOTES files.
# If you are in doubt as to the purpose or necessity of a line, check first
# in NOTES.
#
# $FreeBSD: src/sys/i386/conf/GENERIC,v 1.429.2.13 2006/10/09 18:41:36 simon Exp $
machine i386
#cpu I486_CPU
#cpu I586_CPU
cpu I686_CPU
ident WOW
# To statically compile in device wiring instead of /boot/device.hints
#hints "GENERIC.hints" # Default places to look for devices.
#makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols
options SCHED_4BSD # 4BSD scheduler
options PREEMPTION # Enable kernel thread preemption
options INET # InterNETworking
#options INET6 # IPv6 communications protocols
options FFS # Berkeley Fast Filesystem
options SOFTUPDATES # Enable FFS soft updates support
options UFS_ACL # Support for access control lists
options UFS_DIRHASH # Improve performance on big directories
options MD_ROOT # MD is a potential root device
options NFSCLIENT # Network Filesystem Client
options NFSSERVER # Network Filesystem Server
options NFS_ROOT # NFS usable as /, requires NFSCLIENT
options MSDOSFS # MSDOS Filesystem
options CD9660 # ISO 9660 Filesystem
options PROCFS # Process filesystem (requires PSEUDOFS)
options PSEUDOFS # Pseudo-filesystem framework
options GEOM_GPT # GUID Partition Tables.
options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!]
options COMPAT_FREEBSD4 # Compatible with FreeBSD4
options COMPAT_FREEBSD5 # Compatible with FreeBSD5
options SCSI_DELAY=1000 # Delay (in ms) before probing SCSI
#options KTRACE # ktrace(1) support
options SYSVSHM # SYSV-style shared memory
options SYSVMSG # SYSV-style message queues
options SYSVSEM # SYSV-style semaphores
options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
options KBD_INSTALL_CDEV # install a CDEV entry in /dev
options ADAPTIVE_GIANT # Giant mutex is adaptive.
options QUOTA # Enable User's QUOTA
options SC_DISABLE_REBOOT # Disable Console Restart
options SMP # Symmetric MultiProcessor Kernel
device apic # I/O APIC
# Bus support.
device eisa
device pci
# Floppy drives
#device fdc
# ATA and ATAPI devices
device ata
device atadisk # ATA disk drives
#device ataraid # ATA RAID drives
device atapicd # ATAPI CDROM drives
#device atapifd # ATAPI floppy drives
#device atapist # ATAPI tape drives
options ATA_STATIC_ID # Static device numbering
# SCSI Controllers
#device ahb # EISA AHA1742 family
#device ahc # AHA2940 and onboard AIC7xxx devices
options AHC_REG_PRETTY_PRINT # Print register bitfields in debug
# output. Adds ~128k to driver.
#device ahd # AHA39320/29320 and onboard AIC79xx devices
options AHD_REG_PRETTY_PRINT # Print register bitfields in debug
# output. Adds ~215k to driver.
#device amd # AMD 53C974 (Tekram DC-390(T))
#device isp # Qlogic family
#device ispfw # Firmware for QLogic HBAs- normally a module
#device mpt # LSI-Logic MPT-Fusion
#device ncr # NCR/Symbios Logic
#device sym # NCR/Symbios Logic (newer chipsets + those of `ncr')
#device trm # Tekram DC395U/UW/F DC315U adapters
#device adv # Advansys SCSI adapters
#device adw # Advansys wide SCSI adapters
#device aha # Adaptec 154x SCSI adapters
#device aic # Adaptec 15[012]x SCSI adapters, AIC-6[23]60.
#device bt # Buslogic/Mylex MultiMaster SCSI adapters
#device ncv # NCR 53C500
#device nsp # Workbit Ninja SCSI-3
#device stg # TMC 18C30/18C50
# SCSI peripherals
device scbus # SCSI bus (required for SCSI)
device ch # SCSI media changers
device da # Direct Access (disks)
device sa # Sequential Access (tape etc)
device cd # CD
device pass # Passthrough device (direct SCSI access)
device ses # SCSI Environmental Services (and SAF-TE)
# RAID controllers interfaced to the SCSI subsystem
#device amr # AMI MegaRAID
#device arcmsr # Areca SATA II RAID
#device asr # DPT SmartRAID V, VI and Adaptec SCSI RAID
#device ciss # Compaq Smart RAID 5*
#device dpt # DPT Smartcache III, IV - See NOTES for options
#device hptmv # Highpoint RocketRAID 182x
#device rr232x # Highpoint RocketRAID 232x
#device iir # Intel Integrated RAID
#device ips # IBM (Adaptec) ServeRAID
#device mly # Mylex AcceleRAID/eXtremeRAID
#device twa # 3ware 9000 series PATA/SATA RAID
# RAID controllers
#device aac # Adaptec FSA RAID
#device aacp # SCSI passthrough for aac (requires CAM)
#device ida # Compaq Smart RAID
#device mfi # LSI MegaRAID SAS
#device mlx # Mylex DAC960 family
#device pst # Promise Supertrak SX6000
#device twe # 3ware ATA RAID
# atkbdc0 controls both the keyboard and the PS/2 mouse
device atkbdc # AT keyboard controller
device atkbd # AT keyboard
device psm # PS/2 mouse
device kbdmux # keyboard multiplexer
device vga # VGA video card driver
device splash # Splash screen and screen saver support
# syscons is the default console driver, resembling an SCO console
device sc
# Enable this for the pcvt (VT220 compatible) console driver
#device vt
#options XSERVER # support for X server on a vt console
#options FAT_CURSOR # start with block cursor
device agp # support several AGP chipsets
# Power management support (see NOTES for more options)
#device apm
# Add suspend/resume support for the i8254.
device pmtimer
# PCCARD (PCMCIA) support
# PCMCIA and cardbus bridge support
#device cbb # cardbus (yenta) bridge
#device pccard # PC Card (16-bit) bus
#device cardbus # CardBus (32-bit) bus
# Serial (COM) ports
device sio # 8250, 16[45]50 based serial ports
# Parallel port
device ppc
device ppbus # Parallel port bus (required)
device lpt # Printer
device plip # TCP/IP over parallel
device ppi # Parallel port interface device
#device vpo # Requires scbus and da
# If you've got a "dumb" serial or parallel PCI card that is
# supported by the puc(4) glue driver, uncomment the following
# line to enable it (connects to the sio and/or ppc drivers):
#device puc
# PCI Ethernet NICs.
#device de # DEC/Intel DC21x4x (``Tulip'')
#device em # Intel PRO/1000 adapter Gigabit Ethernet Card
#device ixgb # Intel PRO/10GbE Ethernet Card
#device txp # 3Com 3cR990 (``Typhoon'')
#device vx # 3Com 3c590, 3c595 (``Vortex'')
# PCI Ethernet NICs that use the common MII bus controller code.
# NOTE: Be sure to keep the 'device miibus' line in order to use these NICs!
device miibus # MII bus support
#device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet
#device bfe # Broadcom BCM440x 10/100 Ethernet
#device bge # Broadcom BCM570xx Gigabit Ethernet
#device dc # DEC/Intel 21143 and various workalikes
#device fxp # Intel EtherExpress PRO/100B (82557, 82558)
#device lge # Level 1 LXT1001 gigabit Ethernet
#device nge # NatSemi DP83820 gigabit Ethernet
#device nve # nVidia nForce MCP on-board Ethernet Networking
#device pcn # AMD Am79C97x PCI 10/100(precedence over 'lnc')
#device re # RealTek 8139C+/8169/8169S/8110S
#device rl # RealTek 8129/8139
#device sf # Adaptec AIC-6915 (``Starfire'')
#device sis # Silicon Integrated Systems SiS 900/SiS 7016
#device sk # SysKonnect SK-984x &SK-982x gigabit Ethernet
#device ste # Sundance ST201 (D-Link DFE-550TX)
#device stge # Sundance/Tamarack TC9021 gigabit Ethernet
#device ti # Alteon Networks Tigon I/II gigabit Ethernet
#device tl # Texas Instruments ThunderLAN
#device tx # SMC EtherPower II (83c170 ``EPIC'')
#device vge # VIA VT612x gigabit Ethernet
#device vr # VIA Rhine, Rhine II
#device wb # Winbond W89C840F
device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'')
# ISA Ethernet NICs. pccard NICs included.
#device cs # Crystal Semiconductor CS89x0 NIC
# 'device ed' requires 'device miibus'
#device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards
#device ex # Intel EtherExpress Pro/10 and Pro/10+
#device ep # Etherlink III based cards
#device fe # Fujitsu MB8696x based cards
#device ie # EtherExpress 8/16, 3C507, StarLAN 10 etc.
#device lnc # NE2100, NE32-VL Lance Ethernet cards
#device sn # SMC's 9000 series of Ethernet chips
#device xe # Xircom pccard Ethernet
# Wireless NIC cards
device wlan # 802.11 support
#device wlan_wep # 802.11 WEP support
#device wlan_ccmp # 802.11 CCMP support
#device wlan_tkip # 802.11 TKIP support
#device an # Aironet 4500/4800 802.11 wireless NICs.
#device ath # Atheros pci/cardbus NIC's
#device ath_hal # Atheros HAL (Hardware Access Layer)
#device ath_rate_sample # SampleRate tx rate control for ath
#device awi # BayStack 660 and others
#device ral # Ralink Technology RT2500 wireless NICs.
#device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs.
#device wl # Older non 802.11 Wavelan wireless NIC.
# Pseudo devices.
device loop # Network loopback
device random # Entropy device
device ether # Ethernet support
device sl # Kernel SLIP
device ppp # Kernel PPP
device tun # Packet tunnel.
device pty # Pseudo-ttys (telnet etc)
device md # Memory "disks"
device gif # IPv6 and IPv4 tunneling
device faith # IPv6-to-IPv4 relaying (translation)
# The `bpf' device enables the Berkeley Packet Filter.
# Be aware of the administrative consequences of enabling this!
# Note that 'bpf' is required for DHCP.
device bpf # Berkeleypacket filter
# USB support
device uhci # UHCI PCI->USB interface
device ohci # OHCI PCI->USB interface
device ehci # EHCI PCI->USB interface (USB 2.0)
device usb # USB Bus (required)
#device udbp # USB Double Bulk Pipe devices
device ugen # Generic
device uhid # "Human Interface Devices"
device ukbd # Keyboard
device ulpt # Printer
device umass # Disks/Mass storage - Requires scbus and da
device ums # Mouse
#device ural # Ralink Technology RT2500USB wireless NICs
#device urio # Diamond Rio 500 MP3 player
device uscanner # Scanners
# USB Ethernet, requires miibus
#device aue # ADMtek USB Ethernet
#device axe # ASIX Electronics USB Ethernet
#device cdce # Generic USB over Ethernet
#device cue # CATC USB Ethernet
#device kue # Kawasaki LSI USB Ethernet
#device rue # RealTek RTL8150 USB Ethernet
# FireWire support
#device firewire # FireWire bus code
#device sbp # SCSI over FireWire (Requires scbus and da)
#device fwe # Ethernet over FireWire (non-standard!)
简介
Requirements
Step 1 查看当前机器自检信息.
Step 2备份原内核文件.
Step 3 编辑新内核描述文件.
Step 4 启用磁盘配额.
Step 5 控制台中禁用热启动
Step 6 内核编译前后对比.
Step 2 编译后的清理工作.
F.A.Q.
Links to other sources
简介
为你自己定制专用的内核,加入一些特定功能如QUOTA,禁止控制台重启,声卡,防火墙等,总之可以自己做到很多适合自己机器的配置。
Step 1 查看当前机器的自检信息.
内核编译最好本地操作,不要远程编译。
要是你修改过/etc/make.conf文件,一定要还原此文件。
确保/etc/make.conf文件如下
Shell:
cat /etc/make.conf
# added by use.perl 2007-11-24 22:06:09
PERL_VER=5.8.8
PERL_VERSION=5.8.8
查看当前机器的自检信息,取得CPU 内存显示卡硬盘网卡等信息Shell:
dmesg | less
查看/usr/src/Makefile文件,此文件说明注意事项和具体操作步骤
Shell:
cd /usr/src/
less /usr/src/Makefile
# For individuals wanting to build from the sources currently on their
# system, the simple instructions are:
#
# 1. `cd /usr/src' (or to the directory containing your source tree).
# 2. `make world'
#
# For individuals wanting to upgrade their sources (even if only a
# delta of a few days):
#
# 1. `cd /usr/src' (or to the directory containing your source tree).
# 2. `make buildworld'
# 3. `make buildkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC).
# 4. `make installkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC).
# 5. `reboot' (in single user mode: boot -s from the loader prompt).
# 6. `mergemaster -p'
# 7. `make installworld'
# 8. `make delete-old'
# 9. `mergemaster'
# 10. `reboot'
# 11. `make delete-old-libs' (in case no 3rd party program uses them anymore)
Step 2 备份当前内核描述文件.
查看当前机器内核描述文件
Shell:
uname -a
FreeBSD WOW.freemongolia.cn 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Fri Jan 12 10:40:27 UTC 2007 root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
备份当前机器内核描述文件
复制/usr/src/sys/i386/conf/GENERIC文件到/etc/WOW (WOW表示你自定义的名称)
Shell:
cp /usr/src/sys/i386/conf/GENERIC /etc/WOW
创建一个链接到/usr/src/sys/i386/conf/GENERIC/目录
Shell:
cd /usr/src/sys/i386/conf/
ln -s /etc/WOW /usr/src/sys/i386/conf/
Step 3 编辑内核描述文件.
编辑内核描述文件
添加磁盘配额、禁用控制台中的热启动、等功能
编辑内核描述文件,vi /usr/src/sys/i386/conf/WOW
Shell:
vi /usr/src/sys/i386/conf/WOW
Editor:
# 具体选项请参考http://www.freebsd.org/doc/zh_CN.GB2312/books/handbook/kernelconfig-config.html
ident WOW #内核标记名称
增加以下内容
options QUOTA #启用磁盘配额
options SC_DISABLE_REBOOT #在控制台禁用CTRL+ALT+DEL键
存盘退出
以下2项不要注销
device scbus # SCSI bus (required for SCSI)
device da # Direct Access (disks)
Step 4 编译内核.
编译内核
根据/usr/src/Makefile文件方法,进行编译内核
1、cd /usr/src (进入编译核心目录)
Shell:
cd /usr/src
2、make buildworld(很漫长的等待大约1小时左右,有没有更漫长的事情?有。Ports安装Xorg和Gnome,3天3夜,3天3夜。嗯?好熟悉的旋律……..) (更新版本)
Shell:
make buildworld
3、make buildkernel KERNCONF=你的内核描述文件名 (default is GENERIC) (下面的WOW是我的内核描述文件名称) (正式编译核心大约用时20分钟)
Shell:
make buildkernel KERNCONF=WOW
4、make installkernel KERNCONF=你的内核描述文件名 (default is GENERIC) (安装核心大约用时1分钟)
Shell:
make installkernel KERNCONF=WOW
5、reboot (重新启动进入单人模式,重启选择4;具体操作可以查看第1章忘记root密码怎么办)
Shell:
reboot
以下几步为在单人模式下操作
mount -u(重新挂载,参数-u表示挂载后可读写)
Shell:
单人模式#mount -u
mount -a(挂载全部磁盘,参数-a表示全部磁盘)
Shell:
单人模式#mount -a
cd /usr/src (进入编译核心目录)
Shell:
单人模式#cd /usr/src
mergemaster -p (此命令用来检验内核描述文件正确性)
Shell:
单人模式#mergemaster -p
*** Comparison complete
Do you wish to delete what is left of /var/tmp/temproot?[no]
make installworld (安装所有新的系统源代码,大约用时3分钟)
Shell:
单人模式#make installworld
mergemaster 系统询问是否删除/var/tmp/temproot目录时,按d键进行删除(用来更新或修改/etc的配置文件)
Shell:
单人模式#mergemaster
How should I deal with this? [Use the existing /var/tmp/temproot]d
系统提示发现/etc/rc.d/jail文件与旧的对比有变化,按键盘q键退出查看。询问对新文件怎么处理?按i键安装?还是按d键删除?还是按m键?我们没有编辑过的文件就选择新的,所以按i键选择安装。
Shell:
*** Displaying differences between ./etc/rc.d/jail and installed version
--- /etc/rc.d/jailFri Jan 12 15:42:21 2007
q
How should I deal with this? [Leave it for later]i
系统提示发现/etc/hosts文件与旧的对比有变化,按键盘q键退出查看。询问对新文件怎么处理?按i键安装?还是按d键删除?还是按m键?我们编辑过的文件就保留旧的配置,所以按d键选择删除新的。
Shell:
*** Displaying differences between ./etc/hosts and installed version
--- /etc/hosts Sun Nov 25 05:21:04 2007
+++./etc/hosts Sun Nov 25 20:29:23 2007
q
How should I deal with this? [Leave it for later]d
系统提示发现/etc/mote文件与旧的对比有变化,按键盘q键退出查看。询问对新文件怎么处理?按i键安装?还是按d键删除?还是按m键?motd的作用就是你登入系统时出现的那个欢迎词,我们看看新的欢迎词有没有变化,所以按i键选择安装新的。
Shell:
*** Displaying differences between ./etc/motd and installed version
--- /etc/motd Sun Nov 24 21:22:58 2007
+++./etc/motdSun Nov 25 20:29:23 2007
q
How should I deal with this? [Leave it for later]i
要不要删除/var/tmp/temproot目录,直接回车就行。
Shell:
Do you wish to delete what is left of /var/tmp/temproot? [no]
reboot (重启服务器)
Shell:
单人模式#reboot
Step 5 内核编译前后对比.
激动人心的时刻来临了,等了好几个小时后,我们现在要看看是否新内核安装成功了。
内核文件大小对比
编译后:
Shell:
du -h /boot/kernel
18M /boot/kernel
du -h /boot/kernel/kernel
2.7M /boot/kernel/kernel
编译前:
Shell:
du -h /boot/kernel.old/
23M /boot/kernel.old/
du -h /boot/kernel.old/kernel
6.8M /boot/kernel.old/kernel
内核配置文件名称对比
编译后:
Shell:
uname -a
FreeBSD ohaha.3322.org 6.2-RELEASE-p8 FreeBSD 6.2-RELEASE-p8#0: Sun Nov 25 12:04:05 CST 2007 root@WOW.ohaha.3322.org:/usr/obj/usr/src/sys/WOW i386
编译前:
Shell:
uname -a
FreeBSD ohaha.3322.org 6.2-RELEASE FreeBSD 6.2-RELEASE#0: Fri Jan 12 10:40:27 UTC 2007 root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
内核编译前后SSH侦听端口协议对比
编译后(去除IPV6支持):
Shell:
netstat -an
Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp4 0 52 192.168.0.88.22 192.168.0.8.1155 ESTABLISHED
tcp4 0 0 *.22 *.* LISTEN
udp4 0 0 *.514 *.*
Active UNIX domain sockets
Address Type Recv-Q Send-Q Inode Conn Refs Nextref Addr
c4e8071cstream 0 0 0 c4e807a8 0 0
编译前:
Shell:
netstat -an
Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp4 0 0 127.0.0.1.25 *.* LISTEN
tcp4 0 0 *.22 *.* LISTEN
tcp6 0 0 *.22 *.* LISTEN
udp4 0 0 *.514 *.*
udp6 0 0 *.514 *.*
Active UNIX domain sockets
Address Type Recv-Q Send-Q Inode Conn Refs Nextref Addr
c4e7c9d8 stream 0 0 0 0 0 0
登入时欢迎信息的对比
编译后(显示更人性化,居然会有一些操作技巧提示^_^):
Shell:
FreeBSD 6.2-RELEASE-p8 (WOW) #0: Sun Nov 25 12:04:05 CST 2007
Welcome to FreeBSD!
Before seeking technical support, please use the following resources:
>.............
You may also use sysinstall(8) to re-enter the installation and
configuration utility. Edit /etc/motd to change this login announcement.
To obtain a neat PostScript rendering of a manual page, use ``-t'' switch
of the man(1) utility: ``man -t ''. For example:
man -t grep >grep.ps # Save the PostScript version to a file
or
man -t printf | lp # Send the PostScript directly to printer
编译前:
Shell:
Welcome to FreeBSD!
Before seeking technical support, please use the following resources:
>………………
注:文中所说大约XX时间,是根据不同的机器配置会有出入。主要是看你的CPU,CPU够强劲,速度就够快,时间也就会少。
编译内核时CPU和内存占用
Shell:
top
last pid: 37445; load averages: 1.01, 0.74, 0.50 up 0+03:09:41 04:04:14
35 processes: 2 running, 33 sleeping
CPU states: 92.9%user, 0.0% nice, 6.7% system, 0.4% interrupt, 0.0% idle
Mem: 26MActive, 721MInact, 141MWired, 200K Cache, 111MBuf, 107MFree
Swap: 768MTotal, 768MFree
PID USERNAME THR PRI NICE SIZE RESSTATE TIME WCPU COMMAND
37444 0 1 121 0 6568K 6028K RUN 0:00 3.00% cc1
Step 4 内核编译完后的清理.
内核编译完成后,需要进行清理为下次编译做准备:
清理编译内核后的临时文件Shell:
cd /usr/obj/
chflags -R noschg *
rm -rf *
至此内核编译安装完成。
Step 6 F.A.Q.
Links to other sources
FreeBSD使用手册
FreeBSD使用手册_内核配置
附我的内核配置文件
# GENERIC -- Generic kernel configuration file for FreeBSD/i386
#
# For more information on this file, please read the handbook section on
# Kernel Configuration Files:
#
# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html
#
# The handbook is also available locally in /usr/share/doc/handbook
# if you've installed the doc distribution, otherwise always see the
# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the
# latest information.
#
# An exhaustive list of options and more detailed explanations of the
# device lines is also present in the ../../conf/NOTES and NOTES files.
# If you are in doubt as to the purpose or necessity of a line, check first
# in NOTES.
#
# $FreeBSD: src/sys/i386/conf/GENERIC,v 1.429.2.13 2006/10/09 18:41:36 simon Exp $
machine i386
#cpu I486_CPU
#cpu I586_CPU
cpu I686_CPU
ident WOW
# To statically compile in device wiring instead of /boot/device.hints
#hints "GENERIC.hints" # Default places to look for devices.
#makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols
options SCHED_4BSD # 4BSD scheduler
options PREEMPTION # Enable kernel thread preemption
options INET # InterNETworking
#options INET6 # IPv6 communications protocols
options FFS # Berkeley Fast Filesystem
options SOFTUPDATES # Enable FFS soft updates support
options UFS_ACL # Support for access control lists
options UFS_DIRHASH # Improve performance on big directories
options MD_ROOT # MD is a potential root device
options NFSCLIENT # Network Filesystem Client
options NFSSERVER # Network Filesystem Server
options NFS_ROOT # NFS usable as /, requires NFSCLIENT
options MSDOSFS # MSDOS Filesystem
options CD9660 # ISO 9660 Filesystem
options PROCFS # Process filesystem (requires PSEUDOFS)
options PSEUDOFS # Pseudo-filesystem framework
options GEOM_GPT # GUID Partition Tables.
options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!]
options COMPAT_FREEBSD4 # Compatible with FreeBSD4
options COMPAT_FREEBSD5 # Compatible with FreeBSD5
options SCSI_DELAY=1000 # Delay (in ms) before probing SCSI
#options KTRACE # ktrace(1) support
options SYSVSHM # SYSV-style shared memory
options SYSVMSG # SYSV-style message queues
options SYSVSEM # SYSV-style semaphores
options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
options KBD_INSTALL_CDEV # install a CDEV entry in /dev
options ADAPTIVE_GIANT # Giant mutex is adaptive.
options QUOTA # Enable User's QUOTA
options SC_DISABLE_REBOOT # Disable Console Restart
options SMP # Symmetric MultiProcessor Kernel
device apic # I/O APIC
# Bus support.
device eisa
device pci
# Floppy drives
#device fdc
# ATA and ATAPI devices
device ata
device atadisk # ATA disk drives
#device ataraid # ATA RAID drives
device atapicd # ATAPI CDROM drives
#device atapifd # ATAPI floppy drives
#device atapist # ATAPI tape drives
options ATA_STATIC_ID # Static device numbering
# SCSI Controllers
#device ahb # EISA AHA1742 family
#device ahc # AHA2940 and onboard AIC7xxx devices
options AHC_REG_PRETTY_PRINT # Print register bitfields in debug
# output. Adds ~128k to driver.
#device ahd # AHA39320/29320 and onboard AIC79xx devices
options AHD_REG_PRETTY_PRINT # Print register bitfields in debug
# output. Adds ~215k to driver.
#device amd # AMD 53C974 (Tekram DC-390(T))
#device isp # Qlogic family
#device ispfw # Firmware for QLogic HBAs- normally a module
#device mpt # LSI-Logic MPT-Fusion
#device ncr # NCR/Symbios Logic
#device sym # NCR/Symbios Logic (newer chipsets + those of `ncr')
#device trm # Tekram DC395U/UW/F DC315U adapters
#device adv # Advansys SCSI adapters
#device adw # Advansys wide SCSI adapters
#device aha # Adaptec 154x SCSI adapters
#device aic # Adaptec 15[012]x SCSI adapters, AIC-6[23]60.
#device bt # Buslogic/Mylex MultiMaster SCSI adapters
#device ncv # NCR 53C500
#device nsp # Workbit Ninja SCSI-3
#device stg # TMC 18C30/18C50
# SCSI peripherals
device scbus # SCSI bus (required for SCSI)
device ch # SCSI media changers
device da # Direct Access (disks)
device sa # Sequential Access (tape etc)
device cd # CD
device pass # Passthrough device (direct SCSI access)
device ses # SCSI Environmental Services (and SAF-TE)
# RAID controllers interfaced to the SCSI subsystem
#device amr # AMI MegaRAID
#device arcmsr # Areca SATA II RAID
#device asr # DPT SmartRAID V, VI and Adaptec SCSI RAID
#device ciss # Compaq Smart RAID 5*
#device dpt # DPT Smartcache III, IV - See NOTES for options
#device hptmv # Highpoint RocketRAID 182x
#device rr232x # Highpoint RocketRAID 232x
#device iir # Intel Integrated RAID
#device ips # IBM (Adaptec) ServeRAID
#device mly # Mylex AcceleRAID/eXtremeRAID
#device twa # 3ware 9000 series PATA/SATA RAID
# RAID controllers
#device aac # Adaptec FSA RAID
#device aacp # SCSI passthrough for aac (requires CAM)
#device ida # Compaq Smart RAID
#device mfi # LSI MegaRAID SAS
#device mlx # Mylex DAC960 family
#device pst # Promise Supertrak SX6000
#device twe # 3ware ATA RAID
# atkbdc0 controls both the keyboard and the PS/2 mouse
device atkbdc # AT keyboard controller
device atkbd # AT keyboard
device psm # PS/2 mouse
device kbdmux # keyboard multiplexer
device vga # VGA video card driver
device splash # Splash screen and screen saver support
# syscons is the default console driver, resembling an SCO console
device sc
# Enable this for the pcvt (VT220 compatible) console driver
#device vt
#options XSERVER # support for X server on a vt console
#options FAT_CURSOR # start with block cursor
device agp # support several AGP chipsets
# Power management support (see NOTES for more options)
#device apm
# Add suspend/resume support for the i8254.
device pmtimer
# PCCARD (PCMCIA) support
# PCMCIA and cardbus bridge support
#device cbb # cardbus (yenta) bridge
#device pccard # PC Card (16-bit) bus
#device cardbus # CardBus (32-bit) bus
# Serial (COM) ports
device sio # 8250, 16[45]50 based serial ports
# Parallel port
device ppc
device ppbus # Parallel port bus (required)
device lpt # Printer
device plip # TCP/IP over parallel
device ppi # Parallel port interface device
#device vpo # Requires scbus and da
# If you've got a "dumb" serial or parallel PCI card that is
# supported by the puc(4) glue driver, uncomment the following
# line to enable it (connects to the sio and/or ppc drivers):
#device puc
# PCI Ethernet NICs.
#device de # DEC/Intel DC21x4x (``Tulip'')
#device em # Intel PRO/1000 adapter Gigabit Ethernet Card
#device ixgb # Intel PRO/10GbE Ethernet Card
#device txp # 3Com 3cR990 (``Typhoon'')
#device vx # 3Com 3c590, 3c595 (``Vortex'')
# PCI Ethernet NICs that use the common MII bus controller code.
# NOTE: Be sure to keep the 'device miibus' line in order to use these NICs!
device miibus # MII bus support
#device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet
#device bfe # Broadcom BCM440x 10/100 Ethernet
#device bge # Broadcom BCM570xx Gigabit Ethernet
#device dc # DEC/Intel 21143 and various workalikes
#device fxp # Intel EtherExpress PRO/100B (82557, 82558)
#device lge # Level 1 LXT1001 gigabit Ethernet
#device nge # NatSemi DP83820 gigabit Ethernet
#device nve # nVidia nForce MCP on-board Ethernet Networking
#device pcn # AMD Am79C97x PCI 10/100(precedence over 'lnc')
#device re # RealTek 8139C+/8169/8169S/8110S
#device rl # RealTek 8129/8139
#device sf # Adaptec AIC-6915 (``Starfire'')
#device sis # Silicon Integrated Systems SiS 900/SiS 7016
#device sk # SysKonnect SK-984x &SK-982x gigabit Ethernet
#device ste # Sundance ST201 (D-Link DFE-550TX)
#device stge # Sundance/Tamarack TC9021 gigabit Ethernet
#device ti # Alteon Networks Tigon I/II gigabit Ethernet
#device tl # Texas Instruments ThunderLAN
#device tx # SMC EtherPower II (83c170 ``EPIC'')
#device vge # VIA VT612x gigabit Ethernet
#device vr # VIA Rhine, Rhine II
#device wb # Winbond W89C840F
device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'')
# ISA Ethernet NICs. pccard NICs included.
#device cs # Crystal Semiconductor CS89x0 NIC
# 'device ed' requires 'device miibus'
#device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards
#device ex # Intel EtherExpress Pro/10 and Pro/10+
#device ep # Etherlink III based cards
#device fe # Fujitsu MB8696x based cards
#device ie # EtherExpress 8/16, 3C507, StarLAN 10 etc.
#device lnc # NE2100, NE32-VL Lance Ethernet cards
#device sn # SMC's 9000 series of Ethernet chips
#device xe # Xircom pccard Ethernet
# Wireless NIC cards
device wlan # 802.11 support
#device wlan_wep # 802.11 WEP support
#device wlan_ccmp # 802.11 CCMP support
#device wlan_tkip # 802.11 TKIP support
#device an # Aironet 4500/4800 802.11 wireless NICs.
#device ath # Atheros pci/cardbus NIC's
#device ath_hal # Atheros HAL (Hardware Access Layer)
#device ath_rate_sample # SampleRate tx rate control for ath
#device awi # BayStack 660 and others
#device ral # Ralink Technology RT2500 wireless NICs.
#device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs.
#device wl # Older non 802.11 Wavelan wireless NIC.
# Pseudo devices.
device loop # Network loopback
device random # Entropy device
device ether # Ethernet support
device sl # Kernel SLIP
device ppp # Kernel PPP
device tun # Packet tunnel.
device pty # Pseudo-ttys (telnet etc)
device md # Memory "disks"
device gif # IPv6 and IPv4 tunneling
device faith # IPv6-to-IPv4 relaying (translation)
# The `bpf' device enables the Berkeley Packet Filter.
# Be aware of the administrative consequences of enabling this!
# Note that 'bpf' is required for DHCP.
device bpf # Berkeleypacket filter
# USB support
device uhci # UHCI PCI->USB interface
device ohci # OHCI PCI->USB interface
device ehci # EHCI PCI->USB interface (USB 2.0)
device usb # USB Bus (required)
#device udbp # USB Double Bulk Pipe devices
device ugen # Generic
device uhid # "Human Interface Devices"
device ukbd # Keyboard
device ulpt # Printer
device umass # Disks/Mass storage - Requires scbus and da
device ums # Mouse
#device ural # Ralink Technology RT2500USB wireless NICs
#device urio # Diamond Rio 500 MP3 player
device uscanner # Scanners
# USB Ethernet, requires miibus
#device aue # ADMtek USB Ethernet
#device axe # ASIX Electronics USB Ethernet
#device cdce # Generic USB over Ethernet
#device cue # CATC USB Ethernet
#device kue # Kawasaki LSI USB Ethernet
#device rue # RealTek RTL8150 USB Ethernet
# FireWire support
#device firewire # FireWire bus code
#device sbp # SCSI over FireWire (Requires scbus and da)
#device fwe # Ethernet over FireWire (non-standard!)
发表评论
-
中国最完整的sysctl.conf优化方案
2008-02-20 16:57 2006################### 所有rfc相关的选项都 ... -
Installing FreeBSD 6 for Internet Server
2008-02-20 10:14 3795Installing FreeBSD 6 for Inter ... -
FreeBSD6.2架设之Pure-FTPd服务器
2008-02-20 10:04 1487Index: 简介 Ste ... -
FreeBSD6.2架设之服务器安装
2008-02-20 09:42 1297使用FreeBSD的理由 FreeBSD还是免费的,自由 ... -
FreeBSD6.2架设之服务器基础配置
2008-02-20 09:40 1710Index: 简介 本文目标 Step 1使 ... -
FreeBSD6.2架设之服务器系统升级
2008-02-20 09:39 1268Index: 简介 本 ... -
FreeBSD系统安装及安全调整
2008-02-20 09:37 1393FreeBSD系统安装及安全调 ... -
FreeBSD国内FTP,CVSUP,WWW镜像
2008-02-20 09:07 4378FreeBSD国内FTP,CVSUP,WWW镜像- - ...
相关推荐
在FreeBSD 6.2-RELEASE版本中,安装Apache(这里是Apache 2.2)首先需要进入Apache的ports目录 `/usr/ports/www/apache22`,然后使用`make`命令指定编译选项,例如启用多线程MPM(这里选择了worker MPM),禁用IPv6...
1、文件说明: Centos8操作系统textern-0.8-1.el8.rpm以及相关依赖,全打包为一个tar.gz压缩包 2、安装指令: #Step1、解压 tar -zxvf textern-0.8-1.el8.tar.gz #Step2、进入解压后的目录,执行安装 sudo rpm -ivh *.rpm
基于STM32的循迹避障小车资料源码(高分项目),个人大四的毕业设计、经导师指导并认可通过的高分设计项目,评审分99分,代码完整确保可以运行,小白也可以亲自搞定,主要针对计算机相关专业的正在做毕设的学生和需要项目实战练习的学习者,也可作为课程设计、期末大作业。 基于STM32的循迹避障小车资料源码(高分项目)基于STM32的循迹避障小车资料源码(高分项目)基于STM32的循迹避障小车资料源码(高分项目)基于STM32的循迹避障小车资料源码(高分项目)基于STM32的循迹避障小车资料源码(高分项目)基于STM32的循迹避障小车资料源码(高分项目)基于STM32的循迹避障小车资料源码(高分项目)基于STM32的循迹避障小车资料源码(高分项目)基于STM32的循迹避障小车资料源码(高分项目)基于STM32的循迹避障小车资料源码(高分项目)基于STM32的循迹避障小车资料源码(高分项目)基于STM32的循迹避障小车资料源码(高分项目)基于STM32的循迹避障小车资料源码(高分项目)基于STM32的循迹避障小车资料源码(高分项目)基于STM32的循迹避障小车资料源码(高分项目)基于STM32的循迹避障小车资料源码(高分项目)基于STM32的循迹避障小车资料源码(高分项目)基于STM32的循迹避障小车资料源码(高分项目)基于STM32的循迹避障小车资料源码(高分项目)基于STM32的循迹避障小车资料源码(高分项目)基于STM32的循迹避障小车资料源码(高分项目)基于STM32的循迹避障小车资料源码(高分项目)基于STM32的循迹避障小车资料源码(高分项目)基于STM32的循迹避障小车资料源码(高分项目)基于STM32的循迹避障小车资料源码(高分项目)基于STM32的循迹避障小车资料源码(高分项目)基于STM32的循迹避障小车资料源码(高分项目)基于STM32的循迹避障小车资料源码(
金属板卷自动捆扎机器step_三维3D设计图纸_包括零件图_机械3D图可修改打包下载_三维3D设计图纸_包括零件图_机械3D图可修改打包下载.zip
内容概要:本文详细介绍了SSM框架(Spring、SpringMVC、MyBatis)的相关知识,涵盖Maven项目管理工具、前端开发技术、HTTP协议及Tomcat服务器等内容。文章首先讲解了SSM框架的组成,包括Spring的IOC、DI、AOP等功能,SpringMVC的请求处理流程以及MyBatis的数据操作。接着介绍了Maven作为项目管理工具的作用,如依赖管理和项目构建,并详细描述了Maven的配置文件pom.xml的使用方法。此外,还探讨了HTTP协议的特点、请求响应格式,以及Web服务器Tomcat的基本概念和工作原理。最后,文章对前端开发技术进行了概述,包括HTML、CSS、JavaScript等基础知识,并简要介绍了Ajax技术。 适合人群:具备一定编程基础,特别是Java开发经验的研发人员,尤其是那些正在学习或使用SSM框架进行Web开发的工程师。 使用场景及目标:①理解SSM框架的工作原理及其各组成部分的功能;②掌握Maven的使用,包括项目创建、依赖管理、生命周期等;③熟悉HTTP协议的请求响应机制,能够处理常见的HTTP请求和响应;④掌握前端开发技术,如HTML、CSS、JavaScript等,能够进行简单的前端页面开发;⑤了解Tomcat服务器的工作原理及其配置方法。 阅读建议:本文内容丰富,涵盖了从后端到前端的多个方面,建议读者在学习过程中结合实际项目进行实践,尤其是在Maven项目管理和SSM框架的具体应用上,多动手操作,加深理解。同时,对于HTTP协议和前端开发技术,可以通过实际的网络请求和页面开发来巩固所学知识。
本系统以用户与管理员两类人,作为目标用户,其中用户主要功能包含用户的注册与登录,查看漫画信息进行订阅等,对账号相关信息的修改;管理员主要功能包括了对用户信息、漫画信息、订阅信息、更新通知、在线留言、社区互动等管理;管理员可以实现最高权限级别的全系统管理。 内含文档,可轻松上手。
内容概要:本文详细介绍了NEU-DET数据集,这是一个包含六种常见表面缺陷(如涂层剥落、油污、锈蚀等)的1800张灰度图像的数据集。数据集分为训练集和测试集,分别为1620张和180张。文中探讨了数据集的特点,如灰度图像的优势、标注信息的重要性以及合理的数据集划分。此外,文章展示了如何使用Python读取标注信息,并提供了使用Keras和PyTorch搭建卷积神经网络(CNN)和Faster R-CNN模型的具体代码示例,用于缺陷分类和目标检测任务。通过数据增强技术和模型优化,可以在工业缺陷检测中取得较好的效果。 适合人群:从事工业缺陷检测、计算机视觉、机器学习等相关领域的研究人员和技术人员。 使用场景及目标:适用于希望利用深度学习技术进行表面缺陷检测的研究人员。具体应用场景包括但不限于产品质量检测、自动化生产线监控等。目标是帮助用户理解和掌握如何使用NEU-DET数据集进行模型训练和评估,提高缺陷检测的准确性。 其他说明:文中提到的数据集和代码示例可以帮助初学者快速入门,同时也为高级用户提供了一些优化建议,如使用预训练模型、调整损失函数权重等。
内容概要:本文详细介绍了使用Qt/C++开发的一款多平台二维图形编辑器。该编辑器旨在提供简单直观的图形可视化编辑体验,主要功能包括创建和参数化图形、支持多种图类型、多样化的边与节点端口、自定义属性、动态维护交换列表、搜索功能、自动布局与导出、以及多种文件格式的支持。作者分享了项目的实现路径和技术细节,如通过QGraphicsView框架实现图形绘制、利用GraphViz引擎进行自动布局、采用QProcess处理跨平台进程通信、以及性能优化技巧等。 适合人群:对图形编辑器开发感兴趣的研发人员,尤其是熟悉或想要深入了解Qt/C++框架的开发者。 使用场景及目标:适用于需要开发或改进图形编辑工具的技术团队,帮助他们理解和掌握Qt/C++在图形编辑领域的应用,提高开发效率和产品质量。 其他说明:文中不仅展示了具体的代码片段,还分享了许多实用的经验和技巧,如避免性能瓶颈的方法、处理跨平台兼容性的注意事项等。这对于希望深入研究图形编辑技术和Qt/C++框架的开发者来说是非常宝贵的参考资料。
股票代码:A股600000浦发银行 2023年-2024年2年秒级数据,可用作训练和回测 数据内容: 时间戳(间隔10-12秒,精确到秒) 买/卖成交量 成交价 开/收盘价 最高/低价 另有类似的大盘秒级数据
内含文档,可轻松上手。
电子仿真教程,从基础到精通,每个压缩包15篇教程,每篇教程5000字以上。
冲击试验机sw22_三维3D设计图纸_包括零件图_机械3D图可修改打包下载_三维3D设计图纸_包括零件图_机械3D图可修改打包下载.zip
各院校专业录取分数线.zip
内容概要:本文深入探讨了逆变器虚拟同步控制(VSG)技术中的阻抗建模及其验证方法。首先介绍了VSG的基本概念和技术背景,强调了正负序阻抗对系统稳定性和电能质量的影响。随后详细讲解了阻抗建模的理论基础,包括正负序阻抗的计算方法和虚拟同步发电机的序阻抗建模。接着阐述了阻抗扫描的具体步骤,包括扫描范围、点数设置以及通过扫频法在不同频率下注入小信号并测量响应的方法。文中提供了详细的Python和MATLAB代码示例,帮助读者理解和实现阻抗建模和扫描验证。最后,通过对比实测阻抗曲线和理论模型,讨论了常见问题及解决方法。 适合人群:从事电力电子、电力系统稳定性和控制的研究人员和工程师,尤其是对VSG技术和阻抗建模感兴趣的读者。 使用场景及目标:适用于需要评估逆变器在不同工况下的电气特性,确保电力系统稳定性和优化电能质量的研究和工程实践中。主要目标是掌握VSG阻抗建模和扫频法验证的理论与实践技能。 其他说明:本文不仅提供理论知识,还附带了详细的代码实现和注释,便于读者快速上手并在实际项目中应用。此外,文中提到的一些实用技巧和注意事项也有助于提高实验效率和准确性。
c语言打字母游戏源码.zip
内容概要:本文详细介绍了基于SOGI(二阶广义积分器)和DQ变换的数字锁相环(PLL)在STM32G431芯片上的实现过程,并通过MATLAB进行了仿真验证。主要内容涵盖SOGI初始化、ADC采样配置、中断服务程序设计、DQ变换以及PLL频率跟踪等关键技术环节。文中特别强调了定点运算的应用,以提高运算效率和稳定性。同时,通过MATLAB仿真展示了系统的频率跟踪性能,在40Hz-65Hz范围内能够稳定跟踪电网频率变化,误差控制在±0.2Hz以内。此外,文章还讨论了移植性和硬件适配问题,提供了详细的代码片段和调试经验。 适合人群:从事电力电子、嵌入式系统开发的技术人员,尤其是对锁相环(PLL)和SOGI+DQ结构感兴趣的工程师。 使用场景及目标:适用于需要精确频率跟踪和相位同步的应用场合,如光伏逆变器并网、电机控制系统等。目标是帮助开发者理解和实现高效的PLL算法,确保系统在复杂电网环境下的稳定运行。 其他说明:文章不仅提供了理论分析和技术实现,还包括了大量的实践经验分享,如定点运算优化、硬件适配技巧等。对于希望深入理解PLL工作原理和实际应用的读者来说,是一份非常有价值的参考资料。
内容概要:本文档详细介绍了 MATLAB 在 Windows 和 macOS 系统上的下载与安装步骤。首先简述了 MATLAB 的应用领域,包括科学计算、数据分析和工程仿真。接着分别针对 Windows 和 macOS 用户提供了详细的安装指南,涵盖从访问官网、下载安装程序、选择许可证类型、指定安装路径、选择工具箱到最后的激活步骤。最后,通过输入特定命令验证 MATLAB 是否安装成功,确保用户能够顺利开始使用 MATLAB 进行相关工作。; 适合人群:对科学计算、数据分析和工程仿真有需求的科研人员、工程师以及学生等。; 使用场景及目标:①科研人员和工程师在工作中进行复杂的数据处理和建模;②学生学习数学、物理等相关课程时进行实验和模拟。; 阅读建议:本教程操作性强,建议读者按照步骤逐一操作,确保每一步都正确无误。遇到问题可随时查阅官方帮助文档或社区论坛,以便顺利完成 MATLAB 的安装和激活。
内容概要:本文详细介绍了Linux操作系统的概念、特点及其常见命令,旨在帮助用户掌握Linux的基础知识和操作技能。文章首先概述了Linux的操作系统特性,如免费、稳定、高效,以及其广泛的应用领域,包括服务器和个人设备。接着介绍了Linux的安装与配置,包括虚拟机的创建、分区设置、网络配置等。随后,重点讲解了Linux命令行的基本命令,涵盖文件和目录管理、用户和权限管理、进程和服务管理等方面。此外,还涉及了远程登录、文件传输、文本编辑器(如vi/vim)、定时任务、磁盘管理、网络配置、服务管理和包管理工具(如rpm/yum)。最后简要介绍了Shell编程的基础知识,包括变量、条件判断和脚本编写。 适合人群:适合初学者和有一定经验的Linux用户,特别是希望深入了解Linux系统管理和操作的IT从业者。 使用场景及目标:①帮助用户熟悉Linux操作系统的特性和应用场景;②掌握Linux系统的基本命令和操作技巧;③学会配置和管理Linux服务器,包括文件系统、用户权限、网络设置和服务管理;④能够编写简单的Shell脚本来自动化日常任务。 阅读建议:由于本文内容丰富且涉及面广,建议读者在学习过程中结合实际操作进行练习,特别是在命令行操作、文件管理、用户权限设置和Shell编程方面。对于复杂命令和概念,可以通过查阅官方文档或在线资源进一步加深理解。
内容概要:本文详细介绍了基于MATLAB的倒立摆系统状态观测器和状态反馈控制的设计与仿真。首先建立了倒立摆系统的状态空间模型,并验证了系统的能控性。然后利用LQR方法设计了状态反馈控制器,确保系统稳定并优化控制效果。接着设计了状态观测器,用于估计无法直接测量的状态变量。文中还讨论了观测器和控制器之间的协调设计,以及仿真过程中的一些注意事项和技术细节。最终通过Simulink进行了详细的仿真测试,展示了状态估计误差的快速收敛和系统的良好动态性能。 适合人群:从事控制系统设计的研究人员、工程师以及相关专业的高年级本科生和研究生。 使用场景及目标:适用于需要理解和掌握现代控制理论中状态观测器和状态反馈控制设计的实际应用场合,尤其是涉及复杂多变量系统的控制问题。目标是帮助读者深入理解这两者的协同工作原理及其在实际工程项目中的应用。 其他说明:文中提供了大量MATLAB代码片段,便于读者动手实践。同时强调了在实际工程应用中需要注意的问题,如参数选择、数值计算稳定性等。此外,还探讨了一些高级话题,如鲁棒性和非线性观测器的应用前景。
电子仿真教程,从基础到精通,每个压缩包15篇教程,每篇教程5000字以上。