NetBSD
From Openmoko
(→Required tools) |
(→Required tools) |
||
Line 7: | Line 7: | ||
Hints on building it are avaliable from [[Talk:OpenMoko under QEMU#NetBSD.2Fi386|OpenMoko under QEMU on NetBSD/i386]]. | Hints on building it are avaliable from [[Talk:OpenMoko under QEMU#NetBSD.2Fi386|OpenMoko under QEMU on NetBSD/i386]]. | ||
− | The package itself is avaliable | + | The package itself is avaliable in |
http://pkgsrc-wip.sourceforge.net under qemu-neo1973. | http://pkgsrc-wip.sourceforge.net under qemu-neo1973. | ||
Revision as of 01:19, 10 October 2007
Contents |
Running NetBSD in Qemu-neo1973
A NetBSD port is only ready for kernel developers.
Required tools
You will need Qemu-neo1973.
Hints on building it are avaliable from OpenMoko under QEMU on NetBSD/i386.
The package itself is avaliable in http://pkgsrc-wip.sourceforge.net under qemu-neo1973.
Building NetBSD
You will need mkimage from u-boot. It's available in http://pkgsrc-wip.sourceforge.net under u-boot.
You'll need to download some kernel files.
In [download-area]
pick Attachment: "NetBSD/evbarm 3.1 NEO1973 syssrc 20071010"
Save Link As... syssrc-neo1973-20071010.tar.gz
and extract it over the NetBSD src tree.
From the NetBSD src tree run:
cd /usr/src
./build.sh -m evbarm tools
./build.sh -u -m evbarm kernel=NEO1973
mkimage -A arm -O netbsd -T kernel -C none -a 30008000 -e 30008110 -n "Kernel Image" -d /usr/obj/sys/arch/evbarm/compile/NEO1973/netbsd /usr/obj/sys/arch/evbarm/compile/NEO1973/netbsd.boot
You'll now have a copy of the NetBSD kernel, called netbsd.boot, that's able to be loaded by u-boot.
Prebuild NetBSD
You'll need to download a kernel.
In [download-area]
pick Attachment: "NetBSD/evbarm 3.1 NEO1973 kernel 20071010"
Save Link As... netbsd-NEO1973-20071010.gz
extract and move this kernel into place:
gzip -d netbsd-NEO1973-20071010.gz mv netbsd-NEO1973-2007101 /usr/obj/sys/arch/evbarm/compile/NEO1973/netbsd.boot
Running NetBSD
From the qemu directory edit the openmoko/flash.sh and add the line:
kernel_image="/usr/obj/sys/arch/evbarm/compile/NEO1973/netbsd.boot"
after the four "most_recent" lines.
(if you do use wip/qemu-neo1973, the line is allready there..and you should only have to uncomment the line.)
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
cd /usr/pkg/emul/neo1973; qemu-system-arm -M neo -m 130 -mtdblock openmoko/openmoko-flash.image -kernel openmoko/openmoko-kernel.bin -usb -show-cursor -serial telnet:localhost:1200,server
And from another xterm
telnet localhost 1200
and qemu will go on with the startup process.
In Qemu running u-boot,
press Space to select option "Boot".
In telnet to the serial port you should see:
host007# telnet localhost 1200 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. U-Boot 1.2.0-moko9_r0 (Aug 19 2007 - 19:17:12) DRAM: 128 MB NAND: 64 MiB Found Environment offset in OOB.. Video: 640x480x8 31kHz 59Hz NAND read: device 0 offset 0x25c000, size 0x5000 Reading data from 0x260e00 -- 100% complete. 20480 bytes read: OK USB: S3C2410 USB Deviced In: serial Out: serial Err: serial GTA01Bv4 # Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 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 3.1 (NEO1973) #0: Tue Oct 9 23:08:38 CEST 2007 noud4@host007.template:/usr/obj/sys/arch/evbarm/compile/NEO1973 total memory = 128 MB avail memory = 119 MB mainbus0 (root) cpu0 at mainbus0: ARM920T rev 0 (ARM9TDMI core) cpu0: DC enabled IC enabled WB enabled EABT cpu0: 16KB/32B 64-way Instruction cache cpu0: 16KB/32B 64-way write-back-locking-A Data cache ssio0 at mainbus0: fclk 266 MHz hclk 133 MHz pclk 66 MHz ohci0 at ssio0 intr 26 ohci0: OHCI version 1.0 usb0 at ohci0: USB revision 1.0 uhub0 at usb0 uhub0: Samsung OHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub0: 3 ports with 3 removable, self powered sscom0 at ssio0 unit 0: UART0 addr=50000000 sscom0: console (major=104) sscom1 at ssio0 unit 1: UART1 addr=50004000 ssextio0 at ssio0 lcd0 at ssio0 wsdisplay0 at lcd0 kbdmux 1 wsmux1: connecting to wsdisplay0 ssspi0 at ssio0 unit 0 ssspi1 at ssio0 unit 1 sskbd0 at ssspi1 intr 1 wskbd0 at sskbd0 mux 1 wskbd0: connecting to wsdisplay0 clock: hz=100 stathz = 64 PCLK=66500000 prescaler=2 tc=32470 ubt0 at uhub0 port 3 configuration 1 interface 0 ubt0: Cambridge Silicon Radio Bluetooth USB Adapter, rev 2.00/19.58, addr 2 ubt0: has isoc data bthci0 at ubt0 boot device: <unknown> root device:
This all thanks to and inspired by the FreeBSD page
This in comparance to the Linux dmesg