Begin main content

Developing for arm hardware with qemu

qemu is an excellent multi-platform emulator that includes arm platform emulation. I'm just playing around for now but it's pretty neat.

If you want to do likewise, check out these instructions (including a custom kernel) for getting set up. Note that either because of recent SCSI patches to the qemu source, or because I'm compiling on OSX, the images on that page got stuck in a scsi reset loop during booting. Since I didn't want scsi anyway, I simply took the scsi hardware emulation out of the linked modules (manually removed lsi53c895a.o and added ide.o piix_pci.o in the Makefile) and commented out the scsi initialisation and added ide init in the versatile platform emulation (versatilepb.c):

*** versatilepb.c	24 Sep 2006 03:40:58 +1000	1.6
--- versatilepb.c	14 Dec 2006 01:02:28 +1100	
***************
*** 10,15 ****
--- 10,22 ----
  #include "vl.h"
  #include "arm_pic.h"
  
+ 
+ /* ide support */
+ static const int ide_iobase[2] = { 0x1f0, 0x170 };
+ static const int ide_iobase2[2] = { 0x3f6, 0x376 };
+ static const int ide_irq[2] = { 14, 15 };
+ 
+ 
  /* Primary interrupt controller.  */
  
  typedef struct vpb_sic_state
***************
*** 164,169 ****
--- 171,177 ----
      NICInfo *nd;
      int n;
      int done_smc = 0;
+     int piix3_devfn = -1;
  
      env = cpu_init();
      cpu_arm_set_model(env, ARM_CPUID_ARM926);
***************
*** 194,205 ****
--- 202,219 ----
      if (usb_enabled) {
          usb_ohci_init(pci_bus, 3, -1);
      }
+ /* disable scsi hardware */
+ /*
      scsi_hba = lsi_scsi_init(pci_bus, -1);
      for (n = 0; n < MAX_DISKS; n++) {
          if (bs_table[n]) {
              lsi_scsi_attach(scsi_hba, bs_table[n], n);
          }
      }
+ */
+     piix3_devfn = piix3_init(pci_bus);
+     pci_piix3_ide_init(pci_bus, bs_table, piix3_devfn + 1);
+ 
  
      pl011_init(0x101f1000, pic, 12, serial_hds[0]);
      pl011_init(0x101f2000, pic, 13, serial_hds[1]);

Performance is pretty slow on my PPC G4 powerbook - but then that probably tracks actual arm hardware quite accurately...

08:28 AM, 13 Dec 2006 by Mark Aufflick Permalink

Delicious links

Any chance could stop putting your delicious links in your RSS feed? It's pretty darn annoying. I already subscribe to your delicious links via...delicious :) Which everyone is free to do. How about posting a little how-to on subscribing to your delicious links directly and then leaving your RSS feed for your blog entries only? As an alternative, maybe you could you provide an RSS feed sans delicious links? Cheers.

by Unregistered Visitor on 12/20/06

Add comment