# How to install NetBSD/amd64 current on MacBook Air 11 inch (mid 2012) For older MacBook, please read [how to install netbsd on an apple macbook with core2duo](http://wiki.netbsd.org/tutorials/how_to_install_netbsd_on_an_apple_macbook_with_core2duo/) This tutorial is based on it. [[!toc startlevel=2 levels=2]] ## Caution * To follow this tutorial, you must have other NetBSD or other Unix like operating system installation to create no-dkwedge kernel. * With this tutorial, your MacBook Air's default operating system becomes NetBSD! You can boot OS X with Power+option. * Do not try to install NetBSD on dkwedge partition (/dev/dk*) and with dkwedge enabled kernel, I cannot install NetBSD to hybrid MBR disk, so I have gotten "newfs: /dev/rwd0a: open for read: Device busy" error message. See [PR/39510](http://gnats.netbsd.org/39510). If you can install NetBSD to dkwedge partition, please tell me! All my attempts are failed :( * Do not install NetBSD bootselect code in sysinst. * Installing NetBSD/i386 is not tested. * I have not tested modular-xorg (X.org from pkgsrc). ## What works and what doesn't ### This stuff all seems to work fine * SATA disk drivers * Keyboard * TrackPad (as one button mouse, no multitouch extension) * USB 2.0/1.0 (no USB 3.0) * FaceTime HD Camera (uvideo device; I have not tested yet) * Keyboard backlight ### What Doesn't work * Internal BCM43224 WiFi adapter * Sound (hdaudio seems work, but if you disable boot sound, you have no audio from internal speaker) * Bluetooth device (with patches in [PR/46992](http://gnats.netbsd.org/46992), it works) ## Creating a new partition for NetBSD Probably you can resize your HFS+ partition with OS X's diskutil command. But I have not tested. Default HFS+ partition is journaled, but case insensitive. If you love case sensitive filesystem like me. Please follow the steps. ### Create OS X Recovery USB stick You can create OS X Recovery USB stick with "OS X Recovery Disk Assistant" utility in OS X. At first, create OS X Recovery USB stick. ### Boot from OS X Recovery USB Stick You can boot from the USB stick with Power+option boot. ### Remove OS X partition and create two partitions First partition is 20GB and prepared for HFS+ (journaled and case sensitive). Of cource you can choose case insensitive HFS+. Second partition is remain, about 100GB. You can create this partition as HFS+. Caution: In this step, you must select GUID partition mode. ### Install OS X to 20GB partition OS X fragments are downloaded from Apple's website. Probably you can restore your OS X image from TimeMachin. My NAS's TimeMachine functionality is broken and I cannot test it :( ### Prepare Hybrid MBR disk for classic NetBSD install #### On OS X, download and install gdisk (GPT fdisk) utility You can find GPT fdisk on [http://www.rodsbooks.com/gdisk/](http://www.rodsbooks.com/gdisk/). #### On OS X, create Hybrid MBR with gdisk utility You can find tutorial in [http://www.rodsbooks.com/gdisk/hybrid.html](http://www.rodsbooks.com/gdisk/hybrid.html). ## Prepare NetBSD install USB stick Download NetBSD current (HEAD) snapshot image from [http://nyftp.netbsd.org/pub/NetBSD-daily/HEAD/](http://nyftp.netbsd.org/pub/NetBSD-daily/HEAD/). And write with dd (on Unix like OS) or [rawrite32](http://www.netbsd.org/~martin/rawrite32/) (on Windows). ### Prepare no-dkwedge kernel Remove dkwedge related stuff (remove all "options DKWEDGE*" lines) from GENERIC kernel, and build GENERIC kernel. If you do not know how to build kernel, please read [How to build a kernel section of NetBSD kernel documentation](http://www.netbsd.org/docs/kernel/#how_to_build_a_kernel) . ### Copy no-dkwedge kernel Mount USB stick and copy no-dkwedge kernel to it. ## Boot your MacBook Air and install NetBSD with sysinst In detail, see [The NetBSD Guide](http://www.netbsd.org/docs/guide/en/index.html). Be careful, you must not install bootselect code to your disk. ### Copy no-dkwedge kernel Copy /netbsd to your / partition. ## Set NetBSD as default OS On OS X, open terminal and run % sudo bless --device /dev/disk0s4 --setBoot --legacy --verbose ## Appendix ### dmesg With Thunderbolt to Gigabit Ethernet Adapter.
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The NetBSD Foundation, Inc. All rights reserved. Copyright (c) 1982, 1986, 1989, 1991, 1993 The Regents of the University of California. All rights reserved. NetBSD 6.99.11 (NODKWEDGE) #76: Sat Sep 22 17:29:48 JST 2012 root@tellurium.elements.tetera.org:/usr/obj/sys/arch/amd64/compile/NODKWEDGE total memory = 4002 MB avail memory = 3870 MB timecounter: Timecounters tick every 10.000 msec RTC BIOS diagnostic error 0xfd### /etc/X11/xorg.conf for native X.org With this xorg.conf, you can find one problem. Real display size is 1366x768, but detected one is 1368x768 :(timecounter: Timecounter "i8254" frequency 1193182 Hz quality 100 Apple Inc. MacBookAir5,1 (1.0) mainbus0 (root) cpu0 at mainbus0 apid 0: Intel(R) Core(TM) i5-3317U CPU @ 1.70GHz, id 0x306a9 cpu1 at mainbus0 apid 2: Intel(R) Core(TM) i5-3317U CPU @ 1.70GHz, id 0x306a9 cpu2 at mainbus0 apid 1: Intel(R) Core(TM) i5-3317U CPU @ 1.70GHz, id 0x306a9 cpu3 at mainbus0 apid 3: Intel(R) Core(TM) i5-3317U CPU @ 1.70GHz, id 0x306a9 ioapic0 at mainbus0 apid 2: pa 0xfec00000, version 20, 24 pins acpi0 at mainbus0: Intel ACPICA 20110623 acpi0: X/RSDT: OemId , AslId < ,01000013> acpiecdt0 at acpi0: ACPI Embedded Controller via ECDT acpi0: SCI interrupting at int 9 timecounter: Timecounter "ACPI-Safe" frequency 3579545 Hz quality 900 hpet0 at acpi0: high precision event timer (mem 0xfed00000-0xfed00400) timecounter: Timecounter "hpet0" frequency 14318180 Hz quality 2000 acpiec0 at acpi0 (EC, PNP0C09-0): using acpiecdt0 acpivga0 at acpi0 (IGPU): ACPI Display Adapter acpiout0 at acpivga0 (DD01, 0x0100): ACPI Display Output Device acpiout1 at acpivga0 (DD02, 0x0400): ACPI Display Output Device acpiout1: brightness levels: 0 7 13 20 27 33 40 47 53 60 67 73 80 87 93 100 acpiout2 at acpivga0 (DD03, 0x0200): ACPI Display Output Device acpiout3 at acpivga0 (DD04, 0x0004): ACPI Display Output Device acpiout4 at acpivga0 (DD05, 0x0005): ACPI Display Output Device acpiout5 at acpivga0 (DD06, 0x0006): ACPI Display Output Device acpiout6 at acpivga0 (DD07, 0x0007): ACPI Display Output Device acpiout7 at acpivga0 (DD08, 0x0008): ACPI Display Output Device acpivga0: unknown output device acpiout0 acpivga0: unknown output device acpiout2 acpivga0: unknown output device acpiout3 acpivga0: unknown output device acpiout4 acpivga0: unknown output device acpiout5 acpivga0: unknown output device acpiout6 acpivga0: unknown output device acpiout7 acpivga0: connected output devices: acpivga0: 0x0400 (acpiout1): Unknown Output Device, head 0 FWHD (INT0800) at acpi0 not configured LDRC (PNP0C02) at acpi0 not configured attimer1 at acpi0 (TIMR, PNP0100): io 0x40-0x43,0x50-0x53 SMC (APP0001) at acpi0 not configured ALS0 (ACPI0008) at acpi0 not configured SBS0 (ACPI0002) at acpi0 not configured PDRC (PNP0C02) at acpi0 not configured acpibat0 at acpi0 (BAT0, PNP0C0A-0): ACPI Battery acpiacad0 at acpi0 (ADP1, ACPI0003): ACPI AC Adapter acpilid0 at acpi0 (LID0, PNP0C0D): ACPI Lid Switch acpibut0 at acpi0 (PWRB, PNP0C0C): ACPI Power Button PNLF (APP0002) at acpi0 not configured acpibut1 at acpi0 (SLPB, PNP0C0E): ACPI Sleep Button MEM2 (PNP0C01) at acpi0 not configured pci0 at mainbus0 bus 0: configuration mode 1 pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok pchb0 at pci0 dev 0 function 0: vendor 0x8086 product 0x0154 (rev. 0x09) vga0 at pci0 dev 2 function 0: vendor 0x8086 product 0x0166 (rev. 0x09) wsdisplay0 at vga0 kbdmux 1: console (80x25, vt100 emulation) wsmux1: connecting to wsdisplay0 drm at vga0 not configured vendor 0x8086 product 0x1e31 (USB serial bus, interface 0x30, revision 0x04) at pci0 dev 20 function 0 not configured vendor 0x8086 product 0x1e3a (miscellaneous communications, revision 0x04) at pci0 dev 22 function 0 not configured ehci0 at pci0 dev 26 function 0: vendor 0x8086 product 0x1e2d (rev. 0x04) ehci0: interrupting at ioapic0 pin 23 ehci0: EHCI version 1.0 usb0 at ehci0: USB revision 2.0 hdaudio0 at pci0 dev 27 function 0: HD Audio Controller hdaudio0: interrupting at ioapic0 pin 22 hdafg0 at hdaudio0: vendor 1013 product 4206 hdafg0: ADC00 2ch: Mic In [Built-In] hdafg0: DAC01 2ch: Speaker [Built-In] hdafg0: DAC02 2ch: HP Out [Jack] hdafg0: 2ch/2ch 32000Hz 44100Hz 48000Hz 88200Hz 96000Hz 192000Hz PCM16 PCM20 PCM24 PCM32 AC3 audio0 at hdafg0: full duplex, playback, capture, independent hdafg1 at hdaudio0: Intel product 2806 hdafg1: duplicate pin in association hdafg1: duplicate pin in association hdafg1: 0ch/0ch 48000Hz PCM16* ppb0 at pci0 dev 28 function 0: vendor 0x8086 product 0x1e10 (rev. 0xc4) ppb0: PCI Express 2.0 pci1 at ppb0 bus 1 pci1: i/o space, memory space enabled, rd/line, wr/inv ok ppb1 at pci0 dev 28 function 1: vendor 0x8086 product 0x1e12 (rev. 0xc4) ppb1: PCI Express 2.0 pci2 at ppb1 bus 2 pci2: i/o space, memory space enabled, rd/line, wr/inv ok vendor 0x14e4 product 0x4353 (miscellaneous network, revision 0x01) at pci2 dev 0 function 0 not configured ppb2 at pci0 dev 28 function 4: vendor 0x8086 product 0x1e18 (rev. 0xc4) ppb2: PCI Express 2.0 pci3 at ppb2 bus 3 pci3: i/o space, memory space enabled, rd/line, wr/inv ok ppb3 at pci3 dev 0 function 0: vendor 0x8086 product 0x1547 (rev. 0x03) ppb3: PCI Express 2.0 pci4 at ppb3 bus 4 pci4: i/o space, memory space enabled, rd/line, wr/inv ok ppb4 at pci4 dev 0 function 0: vendor 0x8086 product 0x1547 (rev. 0x03) ppb4: PCI Express 2.0 pci5 at ppb4 bus 5 pci5: i/o space, memory space enabled, rd/line, wr/inv ok vendor 0x8086 product 0x1547 (miscellaneous system, revision 0x03) at pci5 dev 0 function 0 not configured ppb5 at pci4 dev 3 function 0: vendor 0x8086 product 0x1547 (rev. 0x03) ppb5: PCI Express 2.0 pci6 at ppb5 bus 6 pci6: i/o space, memory space enabled, rd/line, wr/inv ok ppb6 at pci6 dev 0 function 0: vendor 0x8086 product 0x1549 (rev. 0x00) ppb6: PCI Express 2.0 pci7 at ppb6 bus 7 pci7: i/o space, memory space enabled, rd/line, wr/inv ok ppb7 at pci7 dev 0 function 0: vendor 0x8086 product 0x1549 (rev. 0x00) ppb7: PCI Express 2.0 pci8 at ppb7 bus 8 pci8: i/o space, memory space enabled, rd/line, wr/inv ok bge0 at pci8 dev 0 function 0: Broadcom BCM57762 Gigabit Ethernet bge0: interrupting at ioapic0 pin 19 bge0: ASIC unknown BCM57766 (0x57766000), Ethernet address 40:6c:8f:58:6c:c5 bge0: setting short Tx thresholds brgphy0 at bge0 phy 1: BCM57765 1000BASE-T media interface, rev. 0 brgphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto ppb8 at pci4 dev 4 function 0: vendor 0x8086 product 0x1547 (rev. 0x03) ppb8: PCI Express 2.0 pci9 at ppb8 bus 55 pci9: i/o space, memory space enabled, rd/line, wr/inv ok ppb9 at pci4 dev 5 function 0: vendor 0x8086 product 0x1547 (rev. 0x03) ppb9: PCI Express 2.0 pci10 at ppb9 bus 104 pci10: i/o space, memory space enabled, rd/line, wr/inv ok ppb10 at pci4 dev 6 function 0: vendor 0x8086 product 0x1547 (rev. 0x03) ppb10: PCI Express 2.0 pci11 at ppb10 bus 105 pci11: i/o space, memory space enabled, rd/line, wr/inv ok ehci1 at pci0 dev 29 function 0: vendor 0x8086 product 0x1e26 (rev. 0x04) ehci1: interrupting at ioapic0 pin 22 ehci1: EHCI version 1.0 usb1 at ehci1: USB revision 2.0 pcib0 at pci0 dev 31 function 0: vendor 0x8086 product 0x1e56 (rev. 0x04) ahcisata0 at pci0 dev 31 function 2: vendor 0x8086 product 0x1e03 (rev. 0x04) ahcisata0: interrupting at ioapic0 pin 19 ahcisata0: 64-bit DMA ahcisata0: AHCI revision 1.30, 6 ports, 32 slots, CAP 0xffffffffc730ff45 atabus0 at ahcisata0 channel 0 vendor 0x8086 product 0x1e22 (SMBus serial bus, revision 0x04) at pci0 dev 31 function 3 not configured isa0 at pcib0 com0 at isa0 port 0x3f8-0x3ff irq 4: ns8250 or ns16450, no fifo pcppi0 at isa0 port 0x61 midi0 at pcppi0: PC speaker sysbeep0 at pcppi0 attimer1: attached to pcppi0 acpicpu0 at cpu0: ACPI CPU acpicpu0: C1: FFH, lat 1 us, pow 1000 mW acpicpu0: C2: FFH, lat 148 us, pow 500 mW acpicpu0: C3: FFH, lat 198 us, pow 200 mW acpicpu0: P0: FFH, lat 10 us, pow 17000 mW, 1701 MHz, turbo boost acpicpu0: P1: FFH, lat 10 us, pow 17000 mW, 1700 MHz acpicpu0: P2: FFH, lat 10 us, pow 15798 mW, 1600 MHz acpicpu0: P3: FFH, lat 10 us, pow 14620 mW, 1500 MHz acpicpu0: P4: FFH, lat 10 us, pow 13467 mW, 1400 MHz acpicpu0: P5: FFH, lat 10 us, pow 12337 mW, 1300 MHz acpicpu0: P6: FFH, lat 10 us, pow 11231 mW, 1200 MHz acpicpu0: P7: FFH, lat 10 us, pow 10150 mW, 1100 MHz acpicpu0: P8: FFH, lat 10 us, pow 9090 mW, 1000 MHz acpicpu0: P9: FFH, lat 10 us, pow 8053 mW, 900 MHz acpicpu0: P10: FFH, lat 10 us, pow 7192 mW, 800 MHz acpicpu0: P11: FFH, lat 10 us, pow 6199 mW, 700 MHz acpicpu0: T0: FFH, lat 1 us, pow 6199 mW, 100 % acpicpu0: T1: FFH, lat 1 us, pow 5785 mW, 94 % acpicpu0: T2: FFH, lat 1 us, pow 5372 mW, 88 % acpicpu0: T3: FFH, lat 1 us, pow 4959 mW, 82 % acpicpu0: T4: FFH, lat 1 us, pow 4545 mW, 75 % acpicpu0: T5: FFH, lat 1 us, pow 4132 mW, 69 % acpicpu0: T6: FFH, lat 1 us, pow 3719 mW, 63 % acpicpu0: T7: FFH, lat 1 us, pow 3306 mW, 57 % acpicpu0: T8: FFH, lat 1 us, pow 2892 mW, 50 % acpicpu0: T9: FFH, lat 1 us, pow 2479 mW, 44 % acpicpu0: T10: FFH, lat 1 us, pow 2066 mW, 38 % acpicpu0: T11: FFH, lat 1 us, pow 1653 mW, 32 % acpicpu0: T12: FFH, lat 1 us, pow 1239 mW, 25 % acpicpu0: T13: FFH, lat 1 us, pow 826 mW, 19 % acpicpu0: T14: FFH, lat 1 us, pow 413 mW, 13 % coretemp0 at cpu0: thermal sensor, 1 C resolution acpicpu1 at cpu1: ACPI CPU coretemp1 at cpu1: thermal sensor, 1 C resolution acpicpu2 at cpu2: ACPI CPU acpicpu3 at cpu3: ACPI CPU timecounter: Timecounter "clockinterrupt" frequency 100 Hz quality 0 timecounter: Timecounter "TSC" frequency 1696216100 Hz quality 3000 acpiacad0: AC adapter online. uhub0 at usb0: vendor 0x8086 EHCI root hub, class 9/0, rev 2.00/1.00, addr 1 uhub0: 2 ports with 2 removable, self powered uhub1 at usb1: vendor 0x8086 EHCI root hub, class 9/0, rev 2.00/1.00, addr 1 uhub1: 2 ports with 2 removable, self powered ahcisata0 port 0: device present, speed: 6.0Gb/s wd0 at atabus0 drive 0 wd0: wd0: drive supports 16-sector PIO transfers, LBA48 addressing wd0: 113 GB, 235097 cyl, 16 head, 63 sec, 512 bytes/sect x 236978176 sectors wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133) wd0(ahcisata0:0:0): using PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133) (using DMA) uhub2 at uhub1 port 1: vendor 0x8087 product 0x0024, class 9/0, rev 2.00/0.00, addr 2 uhub2: single transaction translator uhub3 at uhub0 port 1: vendor 0x8087 product 0x0024, class 9/0, rev 2.00/0.00, addr 2 uhub3: single transaction translator uhub2: 8 ports with 7 removable, self powered uhub3: 6 ports with 5 removable, self powered uhub4 at uhub2 port 8: Standard Microsystems product 0x2512, class 9/0, rev 2.00/b.b3, addr 3 uhub4: multiple transaction translators uhub4: 2 ports with 0 removable, self powered uvideo0 at uhub3 port 1 configuration 1 interface 0: Apple Inc. FaceTime HD Camera (Built-in), rev 2.00/80.25, addr 3 video0 at uvideo0: Apple Inc. FaceTime HD Camera (Built-in), rev 2.00/80.25, addr 3 uhub5 at uhub4 port 1: Apple Inc. BRCM20702 Hub, class 9/0, rev 2.00/1.00, addr 4 uhub5: 3 ports with 0 removable, self powered uhidev0 at uhub5 port 1 configuration 1 interface 0 uhidev0: Apple Computer product 0x820a, rev 2.00/1.00, addr 5, iclass 3/1 uhidev0: 1 report ids ukbd0 at uhidev0 reportid 1: 8 modifier keys, 6 key codes wskbd0 at ukbd0: console keyboard, using wsdisplay0 uhidev1 at uhub5 port 2 configuration 1 interface 0 uhidev1: Apple Computer product 0x820b, rev 2.00/1.00, addr 6, iclass 3/1 uhidev1: 2 report ids ums0 at uhidev1 reportid 2: 3 buttons wsmouse0 at ums0 mux 0 ubt0 at uhub5 port 3 ubt0: Apple Inc. Bluetooth USB Host Controller, rev 2.00/0.86, addr 7 uhidev2 at uhub4 port 2 configuration 1 interface 0 uhidev2: Apple Inc. Apple Internal Keyboard / Trackpad, rev 2.00/2.19, addr 8, iclass 3/1 uhidev2: 9 report ids ukbd1 at uhidev2 reportid 1: 8 modifier keys, 6 key codes, apple fn key wskbd1 at ukbd1 mux 1 wskbd1: connecting to wsdisplay0 uhid0 at uhidev2 reportid 9: input=0, output=0, feature=3 uhidev3 at uhub4 port 2 configuration 1 interface 1 uhidev3: Apple Inc. Apple Internal Keyboard / Trackpad, rev 2.00/2.19, addr 8, iclass 3/0 uhidev3: 68 report ids uhid1 at uhidev3 reportid 68: input=511, output=0, feature=0 uhidev4 at uhub4 port 2 configuration 1 interface 2 uhidev4: Apple Inc. Apple Internal Keyboard / Trackpad, rev 2.00/2.19, addr 8, iclass 3/1 uhidev4: 2 report ids ums1 at uhidev4 reportid 2: 3 buttons wsmouse1 at ums1 mux 0 Kernelized RAIDframe activated pad0: outputs: 44100Hz, 16-bit, stereo audio1 at pad0: half duplex, playback, capture boot device: wd0 root on wd0a dumps on wd0b root file system type: ffs clock: unknown CMOS layout wsdisplay0: screen 1 added (80x25, vt100 emulation) wsdisplay0: screen 2 added (80x25, vt100 emulation) wsdisplay0: screen 3 added (80x25, vt100 emulation) wsdisplay0: screen 4 added (80x25, vt100 emulation)
Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection
Section "Files"
ModulePath "/usr/X11R7/lib/modules"
FontPath "/usr/X11R7/lib/X11/fonts/misc/"
FontPath "/usr/X11R7/lib/X11/fonts/TTF/"
FontPath "/usr/X11R7/lib/X11/fonts/Type1/"
FontPath "/usr/X11R7/lib/X11/fonts/75dpi/"
FontPath "/usr/X11R7/lib/X11/fonts/100dpi/"
FontPath "/usr/pkg/lib/X11/fonts/local/"
FontPath "/usr/pkg/lib/X11/fonts/TTF/"
EndSection
Section "Module"
Load "dbe"
Load "dri"
Load "dri2"
Load "extmod"
Load "glx"
Load "record"
Load "shadow"
EndSection
Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
Option "XkbOptions" "ctrl:nocaps"
EndSection
Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "wsmouse"
Option "Device" "/dev/wsmouse"
# Option "ZAxisMapping" "4 5 6 7"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Monitor Vendor"
ModelName "Monitor Model"
EndSection
Section "Device"
### Available Driver options are:-
### Values: : integer, : float, : "True"/"False",
### : "String", : " Hz/kHz/MHz",
### : "%"
### [arg]: arg optional
#Option "ShadowFB" # []
#Option "DefaultRefresh" # []
#Option "ModeSetClearScreen" # []
Identifier "Card0"
Driver "vesa"
BusID "PCI:0:2:0"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
SubSection "Display"
Viewport 0 0
Depth 1
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 4
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 8
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 15
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 16
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 24
EndSubSection
EndSection