Annotation of wikisrc/ports/evbarm/qemu_arm.mdwn, revision 1.4
1.1 riz 1: [[!meta title="NetBSD/evbarm under QEMU"]]
2:
1.3 ryoon 3: This page attempts to document running NetBSD/evbarm under the
4: [QEMU](http://wiki.qemu.org/Main_Page) open source processor emulator.
5: This can be extremely useful for development and testing.
1.1 riz 6:
7: # Introduction
1.4 ! ryoon 8: QEMU emulates ARM's Integrator/CP board. You can run NetBSD under it.
! 9: Older NetBSD had the problem to run under QEMU's emulated Integrator/CP
! 10: board.
! 11: Sergio López had created the patch for NetBSD current and had posted
! 12: to port-arm mailing list in [6 Febrary, 2013](http://mail-index.NetBSD.org/port-arm/2013/02/06/msg001739.html).
1.1 riz 13:
14: # Requirements
1.4 ! ryoon 15: * pkgsrc/emulators/qemu 1.6.2 and 1.7.0
! 16: * INTEGRATOR_CP kernel of NetBSD/evbearm 6.99.28 or later
! 17: (some provious versions should work, but not tested)
! 18:
! 19: ## Preparing QEMU
! 20: You can install latest qemu with the following commands.
! 21: It is assumed that your pkgsrc tree is in /usr/pkgsrc directory.
! 22:
! 23: # cd /usr/pkgsrc/emulators/qemu
! 24: # make install
! 25:
! 26: ## Preparing NetBSD userland and kernel
! 27: You can create INTEGRATOR_CP kernel, and kernel/userland tarball with
! 28: the following commands.
! 29: It is assumed that your NetBSD src tree is in /usr/src directory.
! 30:
! 31: $ cd /usr/src
! 32: $ ./build.sh -U -T /usr/tools/evbearm-el -O /usr/obj/evbearm-el \
! 33: -D /usr/NewWorld/evbearm-el -R /usr/release/evbearm-el \
! 34: -m evbearm release
! 35: $ ./build.sh -U -T /usr/tools/evbearm-el -O /usr/obj/evbearm-el \
! 36: -D /usr/NewWorld/evbearm-el -R /usr/release/evbearm-el \
! 37: -m evbearm kernel=INTEGRATOR_CP
! 38:
! 39: # Booting
! 40: INTEGRATOR_CP kernel has no disk drive support.
! 41: You should setup netboot environment.
! 42:
! 43: ## Setting up netboot environment
! 44: You can use existing NetBSD or other Unix like operating system environment
! 45: for host netboot.
! 46: You can also utilize qemu-system-amd64 or qemu-system-i386 to host
! 47: netboot.
! 48:
! 49: tftp is not needed, kernel is specified in commandline of qemu-system-arm.
! 50: Only NFS root is needed.
! 51: In detail see [Diskless NetBSD howto's Setting up the NFS server section](http://www.netbsd.org/docs/network/netboot/nfs.html).
! 52:
! 53:
! 54: # Booting INTEGRATOR_CP kernel
! 55: You can boot INTEGRATOR_CP kernel with the following commandline.
! 56: It is assumed that the host machine uses bge0 to connect to your network.
! 57:
! 58: # ifconfig bridge0 create
! 59: # brconfig bridge0 add bge0
! 60: # ifconfig bridge0 up
! 61: # ifconfig tap0 create
! 62: # ifconfig tap0 0.0.0.0 up
! 63: # brconfig bridge0 add tap0
! 64: $ qemu-system-arm -M integratorcp -cpu arm1136 -m 512m -kernel netbsd.gz.ub -serial stdio -net nic -net tap,fd=3 3<>/dev/tap0
! 65:
! 66: # After booted
! 67: You will get the following boot messages.
! 68:
! 69: Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
! 70: 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014
! 71: The NetBSD Foundation, Inc. All rights reserved.
! 72: Copyright (c) 1982, 1986, 1989, 1991, 1993
! 73: The Regents of the University of California. All rights reserved.
! 74:
! 75: NetBSD 6.99.28 (INTEGRATOR_CP) #0: Sat Jan 11 23:47:15 UTC 2014
! 76: ryo_on@bismuth.elements.tetera.org:/usr/obj/evbearm-el/sys/arch/evbarm/compile/INTEGRATOR_CP
! 77: total memory = 255 MB
! 78: avail memory = 246 MB
! 79: sysctl_createv: sysctl_create(machine_arch) returned 17
! 80: timecounter: Timecounters tick every 10.000 msec
! 81: mainbus0 (root)
! 82: cpu0 at mainbus0 core 0: ARM1136J-S r1p3 (ARM11J V6J core)
! 83: cpu0: DC enabled IC enabled WB disabled EABT
! 84: cpu0: isar: [0]=0x140011 [1]=0x12002111 [2]=0x11231111 [3]=0x1102131, [4]=0x141, [5]=0
! 85: cpu0: mmfr: [0]=0x1130003 [1]=0x10030302 [2]=0x1222110 [3]=0
! 86: cpu0: pfr: [0]=0x111 [1]=0x1
! 87: cpu0: 4KB/32B 4-way L1 Instruction cache
! 88: cpu0: 64KB/32B 4-way write-through L1 Data cache
! 89: vfp0 at cpu0: VFP11
! 90: vfp0: mvfr: [0]=0x11111111 [1]=0
! 91: ifpga0 at mainbus0: Build 0, Rev A, Manufacturer Unknown, ASB, Little-endian,
! 92: ifpga0: FPGA unknown, SYSCLK 2.00MHz
! 93: ifpga0: vendor 0x0000 product 0x0000 (miscellaneous prehistoric)
! 94: pci_configure_bus done
! 95: sm0 at ifpga0 addr 0xb8000000 irq 27
! 96: sm0: SMC91C111, revision 1, buffer size: 8192
! 97: sm0: MAC address 52:54:00:12:34:56, default media MII (internal PHY)
! 98: plcom0 at ifpga0 addr 0x6000000 irq 1
! 99: plcom0: console
! 100: plcom1 at ifpga0 addr 0x7000000 irq 2
! 101: plrtc0 at ifpga0 addr 0x5000000
! 102: pci0 at ifpga0 bus 0
! 103: pci0: i/o space, memory space enabled
! 104: timecounter: Timecounter "clockinterrupt" frequency 100 Hz quality 0
! 105: clock: hz=100 stathz = 100 profhz = 500
! 106: timecounter: Timecounter "ifpga" frequency 62500 Hz quality 100
! 107: boot device: <unknown>
! 108: root device: sm0
! 109: dump device:
! 110: file system (default generic):
! 111: root on sm0
! 112: nfs_boot: trying DHCP/BOOTP
! 113: nfs_boot: DHCP next-server: 192.168.81.249
! 114: nfs_boot: my_domain=elements.tetera.org
! 115: nfs_boot: my_addr=192.168.81.167
! 116: nfs_boot: my_mask=255.255.255.0
! 117: nfs_boot: gateway=192.168.81.1
! 118: root on 192.168.81.249:/exports/integratorcp
! 119: root file system type: nfs
! 120: init path (default /sbin/init):
! 121: init: trying /sbin/init
! 122:
! 123:
! 124: You will see many error messages from src/sys/arch/evbarm/ifpga/ifpga_clock.c.
! 125:
! 126: statclockhandler: Statclock overrun
! 127:
! 128: After NetBSD is booted, you can setup sm0 network interface with dhcpcd command.
! 129:
! 130: # dhcpcd sm0
1.1 riz 131:
132: # Using QEMU to debug the kernel
133: - there is info elsewhere on the wiki about this; maybe adapt to ARM
134: and link?
135:
136: # Additional links
137:
138: # What works
139:
140: # What needs work
1.2 wiki 141:
142: # more info
CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb