about photos bookshelf portfolio blog home
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...

12:28 AM, 14 Dec 2006 by Mark Aufflick Permalink | Comments (1)

XML

Blog Categories

software (4)
  ..heads up 'tunes (4)

Notifications

Icon of Envelope Request notifications

Syndication Feed

XML

Recent Comments

  1. Mark Aufflick: all good ideas
  2. Unregistered Visitor: Excellent!
  3. Mark Aufflick: Hey thanks
  4. Unregistered Visitor: Fantastic entry
  5. Mark Aufflick: Bah - dashboard widgets
  6. Unregistered Visitor: Nice
  7. Mark Aufflick: elegant maths (as opposed to elegant rabbit)
  8. Unregistered Visitor: Does that really matter?
  9. Mark Aufflick: Inspiration
  10. Unregistered Visitor: Perhaps...