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 2001################### 所有rfc相关的选项都 ... -
Installing FreeBSD 6 for Internet Server
2008-02-20 10:14 3782Installing FreeBSD 6 for Inter ... -
FreeBSD6.2架设之Pure-FTPd服务器
2008-02-20 10:04 1479Index: 简介 Ste ... -
FreeBSD6.2架设之服务器安装
2008-02-20 09:42 1284使用FreeBSD的理由 FreeBSD还是免费的,自由 ... -
FreeBSD6.2架设之服务器基础配置
2008-02-20 09:40 1699Index: 简介 本文目标 Step 1使 ... -
FreeBSD6.2架设之服务器系统升级
2008-02-20 09:39 1265Index: 简介 本 ... -
FreeBSD系统安装及安全调整
2008-02-20 09:37 1381FreeBSD系统安装及安全调 ... -
FreeBSD国内FTP,CVSUP,WWW镜像
2008-02-20 09:07 4369FreeBSD国内FTP,CVSUP,WWW镜像- - ...
相关推荐
利用Simulink实现混合储能系统在直流微网中的下垂控制策略研究:保持直流母线电压稳定的实践与探究,Simulink仿真下的光储直流微网混合储能系统下垂控制策略优化研究(注意版本要求为2021A以上),混合储能系统 光储微网 下垂控制 Simulink仿真 注意版本2021A以上 由光伏发电系统和混合储能系统构成直流微网。 混合储能系统由超级电容器和蓄电池构成,通过控制混合储能系统来维持直流母线电压稳定。 混合储能系统采用下垂控制来实现超级电容和蓄电池的功率分配,蓄电池响应低频量,超级电容响应高频量。 通过改变光照来影响光伏出力,控制混合储能系统保持微网直流母线电压稳定在380V,不受光伏出力变化影响。 ,混合储能系统; 光储微网; 下垂控制; Simulink仿真; 版本2021A; 直流母线电压稳定; 光伏出力变化; 超级电容器; 蓄电池。,2021A+混合储能系统:光储微网下垂控制Simulink仿真研究
内容概要:本文档是针对JavaScript这一跨平台解释型语言的详尽入门手册,首先概述了JavaScript的概念及其重要特性,强调它不仅适用于前端同时也活跃于Node.js的服务器环境之中,从而成为全栈开发的重要技能。紧接着文档阐述了JavaScript的基本语法元素如变量声明、数据类型、运算符及控制结构,让新手理解JavaScript的语法规则,并通过函数与对象操作加深印象。之后介绍了一些常见的实用工具和高级用法,例如模板字符串、解构赋值以及异步编程手段(比如Promise)。对于想要深入探索的应用场景给出了广泛的指引,无论是传统的web开发还是新兴领域的IoT或自动化脚本编写皆有所涉猎。 适合人群:对于那些没有编程背景或有其他编程经验但仍希望了解并擅长运用JavaScript的个人来说非常适合。 使用场景及目标:目的是向初学者提供足够的理论指导和技术实践机会,使他们能够在不同平台上利用JavaScript创造出有意义的作品;不论是想要从事专业软件开发或是业余项目爱好者都能够从中受益。 其他说明:文档还提供了大量权威且有用的外部链接供进一步深造学习,包括但不限于主流的在线课程、权威的技术参考资料及充满活力的支持社区。
1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。
级联H桥SVG无功补偿系统在不平衡电网中的三层控制策略:电压电流双闭环PI控制、相间与相内电压均衡管理,级联H桥SVG无功补偿系统在不平衡电网中的三层控制策略:电压电流双闭环PI控制、相间与相内电压均衡管理,不平衡电网下的svg无功补偿,级联H桥svg无功补偿statcom,采用三层控制策略。 (1)第一层采用电压电流双闭环pi控制,电压电流正负序分离,电压外环通过产生基波正序有功电流三相所有H桥模块直流侧平均电压恒定,电流内环采用前馈解耦控制; (2)第二层相间电压均衡控制,注入零序电压,控制通过注入零序电压维持相间电压平衡; (3)第三层相内电压均衡控制,使其所有子模块吸收的有功功率与其损耗补,从而保证所有H桥子模块直流侧电压值等于给定值。 有参考资料。 639,核心关键词: 1. 不平衡电网下的SVG无功补偿 2. 级联H桥SVG无功补偿STATCOM 3. 三层控制策略 4. 电压电流双闭环PI控制 5. 电压电流正负序分离 6. 直流侧平均电压恒定 7. 前馈解耦控制 8. 相间电压均衡控制 9. 零序电压注入 10. 相内电压均衡控制 以上十个关键词用分号分隔的格式为:不
1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。
基于主从博弈的动态定价策略与电动汽车充电管理优化在智能小区的实践(MATLAB+CPLEX gurobi实现),基于主从博弈理论的智能小区电动汽车充电与代理商动态定价策略优化研究,MATLAB代码:基于主从博弈的智能小区代理商定价策略及电动汽车充电管理 关键词:电动汽车 主从博弈 动态定价 智能小区 充放电优化 参考文档:《基于主从博弈的智能小区代理商定价策略及电动汽车充电管理》基本复现 仿真平台:MATLAB+CPLEX gurobi平台 主要内容:代码主要做的是一个电动汽车充电管理和智能小区代理商动态定价的问题,将代理商和车主各自追求利益最大化建模为主从博弈,上层以代理商的充电电价作为优化变量,下层以电动汽车的充电策略作为优化变量,通过优化得出最优电价策略以及动态充电策略。 ,电动汽车; 主从博弈; 动态定价; 智能小区; 充放电优化; MATLAB; CPLEX; gurobi平台。,基于主从博弈的电动汽车充电管理与定价策略优化MATLAB代码实现
基于Matlab语言实现的设计项目 2、适用人群:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业或毕业设计中的部分功能,作为“参考资料”使用。 3、解压说明:本资源需要电脑端使用WinRAR、7zip等解压工具进行解压,没有解压工具的自行百度下载即可。 4、免责声明:本资源作为“参考资料”而不是“定制需求”,代码只能作为参考,不能完全复制照搬。不一定能够满足所有人的需求,需要有一定的基础能够看懂代码,能够自行调试代码并解决报错,能够自行添加功能修改代码。由于作者大厂工作较忙,不提供答疑服务,如不存在资源缺失问题概不负责,谢谢理解。
资源内项目源码是均来自个人的课程设计、毕业设计或者具体项目,代码都测试ok,都是运行成功后才上传资源,答辩评审绝对信服的,拿来就能用。放心下载使用!源码、说明、论文、数据集一站式服务,拿来就能用的绝对好资源!!! 项目备注 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、大作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.md文件(如有),仅供学习参考, 切勿用于商业用途。 4、如有侵权请私信博主,感谢支持
Labiew噪音与振动检测模块源码揭秘:傅里叶变换与倍频程技术应用于实际项目,LabVIEW平台噪声与振动检测模块源码解析:基于傅里叶变换与倍频程原理的实用功能模块,已成功应用于实际项目,虚拟产品退换政策严谨执行,Labiew噪音与振动检测模块源码,改功能模块已运用到实际项目,原理是利用傅里叶变和倍频程实现的,产品一旦发概不 。 需要的可以联系哟 ,Labiew源码; 噪音与振动检测模块; 傅里叶变换; 倍频程; 实际项目运用,Labiew傅里叶变换倍频程噪音振动检测模块源码
基于Comsol多物理场仿真的光伏集热器异形体建模技术研究,探索comsol多物理场仿真技术:光伏集热器异形体建模应用,comsol多物理场仿真,光伏集热器,异形体建模 ,comsol多物理场仿真; 光伏集热器仿真; 异形体建模,Comsol多物理场仿真在光伏集热器及异形体建模中的应用
器官3D分割-基于WinForm框架开发的医学影像系统源码+sln+演示视频(毕设基于c#和python开发).zip 【项目简单介绍】 主要功能 肺炎诊断 器官 3D 分割 该系统具备肺炎诊断和器官 3D 分割的功能,并模仿了罗万科技的系统界面风格。 python和c#开发实现
MATLAB可以用于开发水果识别系统。这种系统通常利用机器学习和图像处理技术,对输入的水果图像进行特征提取和分类识别。以下是开发水果识别系统的一般步骤: 1. 数据收集:收集包含各种水果类别的图像数据集。 2. 数据预处理:对图像进行预处理,包括裁剪、缩放、灰度化等操作。 3. 特征提取:从每个水果图像中提取特征,例如颜色直方图、纹理特征、形状特征等。 4. 数据标记:为每个图像标记水果类别,形成训练集和测试集。 5. 模型训练:使用机器学习算法(如支持向量机、卷积神经网络等)对训练集进行训练,建立水果识别模型。 6. 模型测试:使用测试集对模型进行测试和评估,调整模型超参数以提高准确率。 7. 系统集成:将训练好的模型集成到MATLAB应用程序中,实现水果识别功能。 8. 用户界面设计:设计用户友好的界面,以便用户上传水果图像并查看识别结果。 MATLAB提供了丰富的图像处理工具箱和机器学习工具箱,可以帮助开发者快速构建水果识别系统。通过结合这些工具箱,可以实现水果的快速、准确识别。
COMSOL声子晶体仿真研究:一维至三维能带与带隙分析及色散曲线弹性波声波分析,声子晶体仿真:COMSOL代做能带图、带隙图及弹性波、声波分析与优化设计,COMSOL代做 声子晶体仿真,一维,二维,三维能带图,带隙图,色散曲线,弹性波,声波。 ,COMSOL代做;声子晶体仿真;一维/二维/三维能带图;带隙图;色散曲线;弹性波仿真;声波分析,COMSOL声子晶体仿真专家:一至三维声波模拟及能带图绘制
Matlab Simulink仿真探究Flyback反激式开关电源性能表现与优化策略,Matlab Simulink仿真探究Flyback反激式开关电源的工作机制,Matlab Simulimk仿真,Flyback反激式开关电源仿真 ,Matlab; Simulink仿真; Flyback反激式; 开关电源仿真,Matlab Simulink在Flyback反激式开关电源仿真中的应用
陪读租房系统(源码+数据库+论文+ppt)java开发springboot框架javaweb,可做计算机毕业设计或课程设计 【功能需求】 本系统有三个角色:管理员、租客和房主,要求具备以下功能: (a) 管理员;管理员使用本系统涉到的功能主要有:首页、个人中心、租客管理、房主管理、房源信息管理、房源类型管理、教育书籍管理、文章分类管理、租房信息管理、合同信息管理、在线咨询管理、咨阅回复管理、教育论坛、系统管理等功能。 (b) 租客;进入前台系统可以实现首页、房源信息、教育书籍、教育论坛、公告信息、后台管理等功能进行操作。 (C) 房主;进入系统可以实现首页、个人中心、房源信息管理、租房信息管理、合同信息管理、在线咨询管理、咨询回复管理等功能进行操作。 【环境需要】 1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.数据库:MySql 5.7/8.0等版本均可; 【购买须知】 本源码项目经过严格的调试,项目已确保无误,可直接用于课程实训或毕业设计提交。里面都有配套的运行环境软件,讲解视频,部署视频教程,一应俱全,可以自己按照教程导入运行。附有论文参考,使学习者能够快速掌握系统设计和实现的核心技术。
vue3的一些语法以及知识点
1、文件内容:libicu-doc-50.2-4.el7_7.rpm以及相关依赖 2、文件形式:tar.gz压缩包 3、安装指令: #Step1、解压 tar -zxvf /mnt/data/output/libicu-doc-50.2-4.el7_7.tar.gz #Step2、进入解压后的目录,执行安装 sudo rpm -ivh *.rpm 4、更多资源/技术支持:公众号禅静编程坊
水果销售商城(源码+数据库+论文+ppt)java开发springboot框架javaweb,可做计算机毕业设计或课程设计 【功能需求】 水果购物网站用户可以注册登录,在首页开通会员卡,查看水果,购买水果,查看水果信息,以及个人中心修改个人资料,在自己的后台查看自己的购买记录等。 水果购物网站管理员功能:个人中心管理,用户管理,会员管理,会员卡管理,开通会员记录管理,积分管理,水果管理,购买水果订单管理,积分兑换管理,积分兑换记录管理,加积分记录管理,减积分记录管理。 【环境需要】 1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.数据库:MySql 5.7/8.0等版本均可; 【购买须知】 本源码项目经过严格的调试,项目已确保无误,可直接用于课程实训或毕业设计提交。里面都有配套的运行环境软件,讲解视频,部署视频教程,一应俱全,可以自己按照教程导入运行。附有论文参考,使学习者能够快速掌握系统设计和实现的核心技术。
基于Matlab的双输入深度学习模型构建指南:处理序列与图像数据的创新性应用,Matlab双输入深度学习模型搭建指南:如何处理两种输入数据并实现创新与优势,Matlab搭建双输入深度学习模型,双输入网络。 相比普通的单输入网络,双输入网络能处理两种输入数据,在科研上也更具有优势和创新性。 如何用Matlab搭建双输入网络也是困扰本人很长时间的一个问题,现已弄明白。 注意,需要Matlab 2022b及以上版本,以下版本估计是都不行。 本程序是两个输入全为一维序列的情况(第二个输入序列是第一个输入序列的特征值,或者变后的序列)。 也可改为两边输入都是图像,或者一边输入图像,一边输入图像的一维特征序列。 本程序工作如下: 1、加载数据,两种输入数据一一对应,第二个数据是第一个数据做FFT之后的序列,属于一个类别。 两种数据样本数相等,序列长度不相等。 2、搭建双输入网络,此网络一边是CNN-LSTM,一边是CNN。 3、训练。 4、测试,输出准确率。 注:程序可直接运行,包教会和调通。 可以有偿修改为两边输入都是图像,或一边输入图像一边输入序列的模型。 可有偿替数据,调通程序。 程序注释详
包含十大管理49个过程组的输入与输出和解释,还有EVA铮值管理的公式汇总和解释