FreeBSD

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(Add sd method for kernel testing)
Line 56: Line 56:
 
== Next steps ==
 
== Next steps ==
 
Implement console driver over uart.
 
Implement console driver over uart.
 +
 +
== Using a Kernel Testimage ==
 +
Another method of getting the kernel into the neo is to use an image for the emulated sd card.
 +
I already have a file called sd.img ( dd'ed from a 32mb usb stick).
 +
cp /usr/obj/arm/usr/src/sys/NEO1973/kernel .
 +
/usr/obj/arm/usr/src/tmp/usr/bin/objcopy -O binary kernel
 +
sudo mdconfig -a -t vnode -f sd.img
 +
sudo mount_msdosfs /dev/md0s1 /mnt/tmp
 +
sudo cp kernel /mnt/tmp/
 +
sudo umount /mnt/tmp
 +
sudo mdconfig -d -u 0
 +
arm-softmmu/qemu-system-arm -M neo -m 130 -mtdblock openmoko/openmoko-flash.image -kernel openmoko/openmoko-kernel.bin -sd sd.img -usb -show-cursor -serial telnet:localhost:1200,server
 +
In another terminal:
 +
telnet localhost 1200
 +
mmcinit
 +
fatload mmc 0 0x30008000 kernel
 +
go 0x30008000
 +
And wait for the crash :)

Revision as of 22:27, 27 September 2007

Interested in using FreeBSD on the Neo1973 or as a Host OS? Get in touch with mn -at- bsdgroup.de and andrew -at- fubar.geek.nz, they are currently exploring what to do about this.


Contents

Running FreeBSD in Qemu-neo1973

A FreeBSD port is only ready for kernel developers.

Required tools

You will need mkimage from u-boot. It's available in Ports under devel/u-boot.

You will also need Qemu-neo1973. Hints on building it are avaliable from this page.

Building FreeBSD

You will need to download http://fubar.geek.nz/files/freebsd/neo1973/neo1973-0.20070917.tar.bz2 and extract it over the FreeBSD src tree.

From the FreeBSD src tree run:


make buildworld TARGET=arm TARGET_ARCH=arm TARGET_CPUTYPE=arm920t
make buildkernel TARGET=arm TARGET_ARCH=arm TARGET_CPUTYPE=arm920t KERNCONF=NEO1973
gzip -9 usr/obj/path/to/kernel
/path/to/mkimage -A arm -O freebsd -T kernel -C gzip -a 30008000 -e 30008000 -n "Kernel Image" -d /usr/obj/path/to/kernel.gz /usr/obj/same/path/kernel.boot

You will now have a copy of FreeBSD that is able to be loaded by u-boot.

Running FreeBSD

From the qemu directory edit the openmoko/flash.sh and add the line


kernel_image="/usr/obj/path/to/kernel.boot"

after the four "most_recent" lines.

Next run


./openmoko/download.sh
./openmoko/flash.sh

This will fetch the required parts and create an image to run. They require you to have bash installed.

Finally run qemu with


arm-softmmu/qemu-system-arm -M neo -m 130 -mtdblock openmoko/openmoko-flash.image -kernel openmoko/openmoko-kernel.bin -usb -show-cursor

It will display "Kernel loading..." with no further messages.

You can append

-serial telnet:localhost:1200,server

to the qemu startup line to start a telnet server which represents the serial console, just

telnet localhost 1200

and qemu will go on with the startup process.

Useful pages

GTA02 Openness

Next steps

Implement console driver over uart.

Using a Kernel Testimage

Another method of getting the kernel into the neo is to use an image for the emulated sd card. I already have a file called sd.img ( dd'ed from a 32mb usb stick).

cp /usr/obj/arm/usr/src/sys/NEO1973/kernel .
/usr/obj/arm/usr/src/tmp/usr/bin/objcopy -O binary kernel
sudo mdconfig -a -t vnode -f sd.img
sudo mount_msdosfs /dev/md0s1 /mnt/tmp
sudo cp kernel /mnt/tmp/
sudo umount /mnt/tmp
sudo mdconfig -d -u 0
arm-softmmu/qemu-system-arm -M neo -m 130 -mtdblock openmoko/openmoko-flash.image -kernel openmoko/openmoko-kernel.bin -sd sd.img -usb -show-cursor -serial telnet:localhost:1200,server

In another terminal:

telnet localhost 1200
mmcinit
fatload mmc 0 0x30008000 kernel
go 0x30008000

And wait for the crash :)

Personal tools

Interested in using FreeBSD on the Neo1973 or as a Host OS? Get in touch with mn -at- bsdgroup.de and andrew -at- fubar.geek.nz, they are currently exploring what to do about this.


Running FreeBSD in Qemu-neo1973

A FreeBSD port is only ready for kernel developers.

Required tools

You will need mkimage from u-boot. It's available in Ports under devel/u-boot.

You will also need Qemu-neo1973. Hints on building it are avaliable from this page.

Building FreeBSD

You will need to download http://fubar.geek.nz/files/freebsd/neo1973/neo1973-0.20070917.tar.bz2 and extract it over the FreeBSD src tree.

From the FreeBSD src tree run:


make buildworld TARGET=arm TARGET_ARCH=arm TARGET_CPUTYPE=arm920t
make buildkernel TARGET=arm TARGET_ARCH=arm TARGET_CPUTYPE=arm920t KERNCONF=NEO1973
gzip -9 usr/obj/path/to/kernel
/path/to/mkimage -A arm -O freebsd -T kernel -C gzip -a 30008000 -e 30008000 -n "Kernel Image" -d /usr/obj/path/to/kernel.gz /usr/obj/same/path/kernel.boot

You will now have a copy of FreeBSD that is able to be loaded by u-boot.

Running FreeBSD

From the qemu directory edit the openmoko/flash.sh and add the line


kernel_image="/usr/obj/path/to/kernel.boot"

after the four "most_recent" lines.

Next run


./openmoko/download.sh
./openmoko/flash.sh

This will fetch the required parts and create an image to run. They require you to have bash installed.

Finally run qemu with


arm-softmmu/qemu-system-arm -M neo -m 130 -mtdblock openmoko/openmoko-flash.image -kernel openmoko/openmoko-kernel.bin -usb -show-cursor

It will display "Kernel loading..." with no further messages.

You can append

-serial telnet:localhost:1200,server

to the qemu startup line to start a telnet server which represents the serial console, just

telnet localhost 1200

and qemu will go on with the startup process.

Useful pages

GTA02 Openness

Next steps

Implement console driver over uart.