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 | Comments (1)

XML

Blog Categories

software (41)
..cocoa (23)
  ..heads up 'tunes (5)
..ruby (6)
..lisp (4)
..perl (4)
..openacs (1)
mac (21)
embedded (2)
..microprocessor (2)
  ..avr (1)
electronics (3)
design (1)
photography (26)
..black and white (6)
..A day in Sydney (18)
..The Daily Shoot (6)
food (2)
Book Review (2)

Notifications

Icon of envelope Request notifications

Syndication Feed

XML

Recent Comments

  1. Mark Aufflick: Re: the go/Inbox go/Sent buttons
  2. Unregistered Visitor: How do make a button to jump to folder
  3. Unregistered Visitor: Note I've updated the gist
  4. Unregistered Visitor: umbrello is now an available port on macPorts
  5. Unregistered Visitor: Updated version on Github
  6. Unregistered Visitor: Modification request.
  7. Unregistered Visitor: Accents and labels with spaces
  8. Unregistered Visitor: Mel Kaye - additional info
  9. Unregistered Visitor: mmh
  10. Mark Aufflick: Thank you