FreeBSD on Samsung Chromebook "SNOW" model XE303C12

The Chromebook is an affordable computer powered by Samsung Exynos 5250 (ARMv7 Cortex A15) System-On-Chip

Supported Device Drivers

Known Bugs/Limitations

Synopsis

FreeBSD ARM can be booted on the Chromebook "SNOW" using a specially-configured USB boot device that contains a U-Boot boot loader partition, an msdos FreeBSD kernel partition and a UFS root partition

A true 4GB USB device will have room for the FreeBSD sources and an object directory and will build the default CHROMEBOOK-SNOW kernel in about 14 minutes, 30 seconds

An SD Card can be used for the U-Boot and kernel partitions but is not supported by FreeBSD for the FreeBSD root. SD Card boot has proved useful for USB debugging

Source Checkout

FreeBSD SVN tag 269385 is known to work

 # svnlite co http://svn.freebsd.org/base/head@269385 /usr/src

Kernel Configuration

The default /usr/src/sys/arm/conf/CHROMEBOOK-SNOW kernel configuration file requires the following additional options to support USB root boot:

 nooptions      ROOTDEVNAME
 options        ROOTDEVNAME=\"ufs:/dev/da0p3\"

Kernel and World Build

 # make TARGET_ARCH=armv6 KERNCONF=CHROMEBOOK-SNOW buildworld buildkernel

Use a -j jobs that is appropriate for your hardware

USB Device Partitioning

Change "da0" to match your attached USB device

Warning: This will delete all data on the USB device

 # gpart delete -i 1 da0
 # gpart delete -i 2 da0
 # gpart delete -i 3 da0
 # gpart destroy da0
 # dd if=/dev/zero of=/dev/da0 bs=1m count=32
 # gpart create -s GPT da0
 # gpart add -b 1m -s 15m -t \!fe3a2a5d-4f32-41a7-b725-accc3285a309 da0
 # gpart add -b 17m -s 15m -t \!fe3a2a5d-4f32-41a7-b725-accc3285a309 da0
 # gpart add -t freebsd-ufs da0

You can optionally create a swap partition after the freebsd-ufs partition

Sample output from a 3.7GB "4GB" device is:

 # gpart show da0
=>     34  7821245  da0  GPT  (3.7G)
       34     2014       - free -  (1.0M)
     2048    30720    1  !fe3a2a5d-4f32-41a7-b725-accc3285a309  (15M)
    32768     2048       - free -  (1.0M)
    34816    30720    2  !fe3a2a5d-4f32-41a7-b725-accc3285a309  (15M)
    65536  7755743    3  freebsd-ufs  (3.7G)

Populating the U-Boot Partition

 # fetch http://commondatastorage.googleapis.com/chromeos-localmirror/distfiles/nv_uboot-snow-simplefb.kpart.bz2
 # bunzip2 nv_uboot-snow-simplefb.kpart.bz2
 # dd if=nv_uboot-snow-simplefb.kpart of=/dev/da0p1 bs=1m

Also note: http://linux-exynos.org/dist/chromebook/nv_uboot/

Populating the Kernel Partition

 # newfs_msdos /dev/da0p2
 # mount_msdosfs /dev/da0p2 /mnt
 # cp /usr/obj/arm.armv6/usr/src/sys/CHROMEBOOK-SNOW/kernel.bin /mnt/
 # umount /mnt

Populating the Root Partition

 # newfs -U /dev/da0p3
 # mount /dev/da0p3 /mnt
 # cd /usr/src/
 # make TARGET_ARCH=armv6 DESTDIR=/mnt installworld distribution
 # echo "/dev/da0p3 / ufs rw,noatime 1 1" > /mnt/etc/fstab
 # vi /mnt/etc/ttys
 < Change ttyv0 thorough ttyv4 from "off" to "on" >
 # umount /mnt

You can optionally copy in your /usr/src and /usr/obj/ to the USB image prior to unmounting

You may now remove the USB device and insert it into the USB 2.0 port (between the HDMI connector and USB 3.0 port on the Chromebook

Chromebook Commands

Enable Developer Mode

The Chromebook must be placed in "Developer Mode" to enable USB/SD Card boot. This step only needs to be performed once

WARNING: This will delete all personal data and settings on your Chromebook

  1. Power the machine off using the Linux GUI or by holding down the Power button
  2. Hold down ESC and Refresh (above the "4" key) keys, and press the Power button
  3. This will enter Recovery mode. Press CTRL+D to enter Developer mode
  4. Press Enter to confirm
  5. You now see the "OS verification is OFF" screen. Press CTRL+D to continue
  6. Wait approximately 5 minutes for the procedure to complete

Access the GNU/Linux Command Line

You will need the Chromebook's GNU/Linux command line for some steps

  1. Power the machine on and either press CTRL+D at the "OS verification is OFF" screen or wait for the two tones
  2. Change to the second virtual console by pressing CTRL+ALT and the "=>" button (above the "3" key)

Enable USB/SD Card Boot

This step only needs to be performed once from the GNU/Linux command line:

localhost login: root
localhost ~ # crossystem dev_boot_usb=1
localhost ~ # reboot

To verify this setting:

localhost ~ # crossystem --all | grep dev_boot_usb
localhost ~ # dev_boot_usb    = 1    # Enable developer mode boot from USB/SD (writable)

Restart

  1. Type 'reboot' at the GNU/Linux command line if available
  2. Press the Refresh (above the "4" key) and Power keys

Power Off

  1. Click "Shut down" on the bottom left of the GNU/Linux GUI
  2. Issue the GNU/Linux or FreeBSD shutdown command
  3. Hold down the Power button

Mark the FreeBSD USB Device Bootable

This step must be performed on the GNU/Linux command line for every newly created USB or SD Card device

For a USB device:

 # cgpt add -P 12 -T 5 -S 1 -i 1 /dev/sda
 # reboot

To review the partition table:

cgpt show /dev/sda
...
Attr: priority=12 tries=5 successful=1
...

For an SD Card device:

 # cgpt add -P 12 -T 5 -S 1 -i 1 /dev/mmcblk1
 # reboot

To review the partition table:

cgpt show /dev/mmcbkl1
...
Attr: priority=12 tries=5 successful=1
...

Booting with U-Boot

  1. Insert your USB device if not inserted already
  2. Power the machine on and press CTRL+U on the
  3. Insert USB flash device to USB 2.0 port and insert SD card
  4. Power on laptop and press CTRL+U at the "OS verification is OFF" screen. If it beeps at you, your USB/SD Card is not properly configured
  5. In U-boot type:

For a USB device:

 SMDK5250 # usb start
 SMDK5250 # usb dev 0
 SMDK5250 # fatload usb 0:2 0x40f00000 kernel.bin
 SMDK5250 # go 0x40f00000

This can be saved with:

 SMDK5250 # setenv bootcmd "usb start; usb dev 0; fatload usb 0:2 0x40f00000 kernel.bin; go 0x40f00000"
 SMDK5250 # saveenv
 SMDK5250 # boot

For an SD Card device:

 SMDK5250 # mmc dev 1
 SMDK5250 # mmc rescan 1
 SMDK5250 # fatload mmc 1:2 0x40f00000 kernel.bin
 SMDK5250 # go 0x40f00000

This can be saved with:

 SMDK5250 # setenv bootcmd "mmc dev 1; mmc rescan 1; fatload mmc 1:2 0x40f00000 kernel.bin; go 0x40f00000"
 SMDK5250 # saveenv
 SMDK5250 # boot

If you have saved your U-Boot command, you can interrupt the autoboot by pressing any key

Useful information

Change GNU/Linux and FreeBSD Consoles: Hold down CTRL+ALT and press "=>" button (located above the "3" key). This is very useful when the console is flooded with "Spurious interrupt detected" messages

Remember that the FreeBSD kernel is on /dev/da0p2 should you build a new kernel

 # mount_msdosfs /dev/da0p2 /mnt
 # ls /mnt
 kernel.bin
 # cp /usr/obj/arm.armv6/usr/src/sys/CHROMEBOOK-SNOW/kernel.bin /mnt/
 # umount /mnt

Chromebook information: http://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices/samsung-arm-chromebook

Chromebook partitioning information: http://www.chromium.org/chromium-os/chromiumos-design-docs/disk-format#TOC-Partition-types

Chromebook "snow", "peach pit" and "spring" models explained: http://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices

Samsung Chromebook2 "PEACH PIT" model XE503C12

This model has a Samsung Exynos 5420 (effectively quad-core) CPU with 3.5GB of usable RAM and a supported SDHC port

The only changes to the above instructions are:

  1. The kernel config to use is CHROMEBOOK-PEACH-PIT
  2. The U-Boot firmware is available at http://linux-exynos.org/dist/chromebook/nv_uboot/nv_uboot-peach-pit.kpart

HP Chromebook 11 "SPRING" model 11-1101

This model has a Samsung Exynos 5250 Dual 1.7 GHz CPU and 2GB RAM

  1. The kernel config to use is CHROMEBOOK-SPRING
  2. The U-Boot firmware is available at http://linux-exynos.org/dist/chromebook/nv_uboot/nv_uboot-spring.kpart

arm/Chromebook (last edited 2019-09-06T21:32:05+0000 by LorenzoSalvadore)