{"id":646,"date":"2013-01-20T14:55:00","date_gmt":"2013-01-20T06:55:00","guid":{"rendered":"http:\/\/note.systw.net\/note\/?p=646"},"modified":"2023-11-04T15:29:15","modified_gmt":"2023-11-04T07:29:15","slug":"compiling-freebsd-kernel","status":"publish","type":"post","link":"https:\/\/systw.net\/note\/archives\/646","title":{"rendered":"Compiling Freebsd Kernel"},"content":{"rendered":"\n<p>Freebsd kernel compile<\/p>\n\n\n\n<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..<\/p>\n\n\n\n<p><strong>compile kernel<\/strong><br><strong>1<br>\u7de8\u8b6f\u524d\u6aa2\u67e5<\/strong><br>\u6aa2\u67e5\u662f\u5426\u6709\u5b8c\u6574\u7684 FreeBSD source tree<br><strong>2<br>\u7522\u751f\u4e26\u7de8\u8f2f\u65b0\u7684kernel\u8a2d\u5b9a\u6a94<\/strong><br>#cd \/usr\/src\/sys\/amd64\/conf<br>#cp GENERIC kernel2<br>#vi kernel2<br>\u7de8\u8f2f\u5167\u5bb9\u8996\u9700\u6c42\u4fee\u6539<br><strong>3<br>\u91cd\u5efakernel\u5f8c\u91cd\u958b\u6a5f<\/strong><br>#cd \/usr\/src<br>#make buildkernel KERNCONF=kernel2<br>\u5efa\u7acb\u5b8c\u5f8c\u6703\u51fa\u73fe\u5b8c\u6210\u8a0a\u606f<br>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br>&gt;&gt;&gt; Kernel build for kernel2 completed on Fri Nov 23 17:08:10 CST 2012<br>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br>#make installkernel KERNCONF=kernel2<br>#reboot<br><strong>4<br>\u6aa2\u67e5\u662f\u5426\u7de8\u8f2f\u5b8c\u6210<\/strong><br>#uname -a<br>FreeBSD systw 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Fri Nov 23 16:58:02 CST 2012 root@systw:\/usr\/obj\/usr\/src\/sys\/kernel2 amd64<br>\u8a0a\u606f\u51fa\u73fekernel2,\u8868\u793a\u662f\u4f7f\u7528\u65b0\u6539\u7684kernel\u958b\u6a5f<br>ps:<br>\u65b0\u7684kernel\u6703\u8907\u88fd\u5230 \/boot\/kernel\/kernel<br>\u820a\u7684kernel\u5247\u79fb\u81f3 \/boot\/kernel.old\/kernel<\/p>\n\n\n\n<p>ps:<br>amd64\u662f\u7cfb\u7d71\u67b6\u69cb<br>\u5176\u4ed6\u67b6\u69cb\u9084\u6709<br>alpha<br>i386<br>pc98<br>sparc64<\/p>\n\n\n\n<p>ps:<br><strong>The kernel does not boot\u89e3\u6c7a\u65b9\u6848<\/strong><br>1 \u5728\u958b\u6a5f\u9078\u64c7\u4e2d,\u9078\u64c7 Escape to a loader prompt<br>2 \u5728prompt mode\u4e0b\u8f38\u5165<br>unload kernel<br>boot \/boot\/kernel.old\/kernel<\/p>\n\n\n\n<p>ps:<br>\u5217\u51fa\u5404\u8a2d\u5099\u8a73\u7d30\u8cc7\u8a0a<br>pciconf -lv<\/p>\n\n\n\n<p>ps:<br>pciconf &#8212; diagnostic utility for the PCI bus<br>SYNOPSIS<br>pciconf -l [-bcv]<br>pciconf -a selector<br>pciconf -r [-b | -h] selector addr[:addr2]<br>pciconf -w [-b | -h] selector addr value<\/p>\n\n\n\n<p><br>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..<\/p>\n\n\n\n<p><strong>kernel\u8a2d\u5b9a\u6a94<\/strong><br>\u4ee5HP G5 DL380\u70ba\u4f8b,kernel\u76ee\u524d\u6700\u5c11\u9700\u4fdd\u7559\u5982\u4e0b<\/p>\n\n\n\n<p>cpu HAMMER<br>ident GENERIC<\/p>\n\n\n\n<p>options SCHED_ULE # ULE scheduler<br>options PREEMPTION # Enable kernel thread preemption<br>options INET # InterNETworking<br>options SCTP # Stream Control Transmission Protocol<br>options FFS # Berkeley Fast Filesystem<br>options SOFTUPDATES # Enable FFS soft updates support<br>options UFS_ACL # Support for access control lists<br>options UFS_DIRHASH # Improve performance on big directories<br>options UFS_GJOURNAL # Enable gjournal-based UFS journaling<br>options CD9660 # ISO 9660 Filesystem<br>options PROCFS # Process filesystem (requires PSEUDOFS)<br>options PSEUDOFS # Pseudo-filesystem framework<br>options GEOM_PART_GPT # GUID Partition Tables.<br>options GEOM_LABEL # Provides labelization<br>options COMPAT_FREEBSD32 # Compatible with i386 binaries<br>options COMPAT_FREEBSD4 # Compatible with FreeBSD4<br>options COMPAT_FREEBSD5 # Compatible with FreeBSD5<br>options COMPAT_FREEBSD6 # Compatible with FreeBSD6<br>options COMPAT_FREEBSD7 # Compatible with FreeBSD7<br>options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI<br>options STACK # stack(9) support<br>options SYSVSHM # SYSV-style shared memory<br>options SYSVMSG # SYSV-style message queues<br>options SYSVSEM # SYSV-style semaphores<br>options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions<br>options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed.<br>options KBD_INSTALL_CDEV # install a CDEV entry in \/dev<br>options HWPMC_HOOKS # Necessary kernel hooks for hwpmc(4)<br>options AUDIT # Security event auditing<br>options MAC # TrustedBSD MAC Framework<br>options INCLUDE_CONFIG_FILE # Include this file in kernel<\/p>\n\n\n\n<p># Make an SMP-capable kernel by default<br>options SMP # Symmetric MultiProcessor Kernel<\/p>\n\n\n\n<p># CPU frequency control<br>device cpufreq<\/p>\n\n\n\n<p># Bus support.<br>device acpi<br>device pci<\/p>\n\n\n\n<p># Floppy drives<\/p>\n\n\n\n<p># ATA controllers<\/p>\n\n\n\n<p># SCSI Controllers<br>device mpt # LSI-Logic MPT-Fusion<\/p>\n\n\n\n<p># ATA\/SCSI peripherals<br>device scbus # SCSI bus (required for ATA\/SCSI)<br>device ch # SCSI media changers<br>device da # Direct Access (disks)<br>device cd # CD<br>device pass # Passthrough device (direct ATA\/SCSI access)<br>device ses # SCSI Environmental Services (and SAF-TE)<\/p>\n\n\n\n<p># RAID controllers interfaced to the SCSI subsystem<br>device ciss # Compaq Smart RAID 5*<\/p>\n\n\n\n<p># RAID controllers<br>device mfi # LSI MegaRAID SAS<br>device tws # LSI 3ware 9750 SATA+SAS 6Gb\/s RAID controller<\/p>\n\n\n\n<p># atkbdc0 controls both the keyboard and the PS\/2 mouse<br>device psm # PS\/2 mouse<br>device kbdmux # keyboard multiplexer<br>device vga # VGA video card driver<br>device splash # Splash screen and screen saver support<\/p>\n\n\n\n<p># syscons is the default console driver, resembling an SCO console<br>device sc<br>options SC_PIXEL_MODE # add support for the raster text mode<br>device agp # support several AGP chipsets<\/p>\n\n\n\n<p># PCCARD (PCMCIA) support<br># PCMCIA and cardbus bridge support<br>device cbb # cardbus (yenta) bridge<br>device pccard # PC Card (16-bit) bus<br>device cardbus # CardBus (32-bit) bus<\/p>\n\n\n\n<p># Serial (COM) ports<br>device uart # Generic UART driver<\/p>\n\n\n\n<p># Parallel port<\/p>\n\n\n\n<p># PCI Ethernet NICs.<\/p>\n\n\n\n<p># PCI Ethernet NICs that use the common MII bus controller code.<br># NOTE: Be sure to keep the &#8216;device miibus&#8217; line in order to use these NICs!<br>device miibus # MII bus support<br>device bce # Broadcom BCM5706\/BCM5708 Gigabit Ethernet<\/p>\n\n\n\n<p># ISA Ethernet NICs. pccard NICs included.<\/p>\n\n\n\n<p># Wireless NIC cards<\/p>\n\n\n\n<p># Pseudo devices.<br>device loop # Network loopback<br>device random # Entropy device<br>device ether # Ethernet support<br>device pty # BSD-style compatibility pseudo ttys<br>device firmware # firmware assist module<\/p>\n\n\n\n<p># The `bpf&#8217; device enables the Berkeley Packet Filter.<br># Be aware of the administrative consequences of enabling this!<br># Note that &#8216;bpf&#8217; is required for DHCP.<br>device bpf # Berkeley packet filter<\/p>\n\n\n\n<p># USB support<br>device uhci # UHCI PCI-&gt;USB interface<br>device ohci # OHCI PCI-&gt;USB interface<br>device ehci # EHCI PCI-&gt;USB interface (USB 2.0)<br>device xhci # XHCI PCI-&gt;USB interface (USB 3.0)<br>device usb # USB Bus (required)<br>device uhid # &#8220;Human Interface Devices&#8221;<br>device ukbd # Keyboard<br>device umass # Disks\/Mass storage &#8211; Requires scbus and da<br>device ums # Mouse<br># USB Serial devices<br># USB Ethernet, requires miibus<br># USB Wireless<\/p>\n\n\n\n<p># FireWire support<\/p>\n\n\n\n<p># Sound support<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Freebsd kernel compile &#8230; &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[19],"tags":[],"class_list":["post-646","post","type-post","status-publish","format-standard","hentry","category-linuxsystem"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/646","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/comments?post=646"}],"version-history":[{"count":0,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/646\/revisions"}],"wp:attachment":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/media?parent=646"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/categories?post=646"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/tags?post=646"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}