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

XML

Blog Categories

software (39)
..cocoa (21)
  ..heads up 'tunes (5)
..ruby (6)
..lisp (3)
..perl (4)
..openacs (1)
mac (20)
embedded (2)
..microprocessor (2)
  ..avr (1)
electronics (3)
design (1)
photography (25)
..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. Unregistered Visitor: An other Script
  2. Unregistered Visitor: A message in there?
  3. Unregistered Visitor: using Amazon S3
  4. Unregistered Visitor: Thank you ! Thank you ! Thank you !
  5. Unregistered Visitor: Umbrello on leopard
  6. Unregistered Visitor: Script gor generate for library
  7. Unregistered Visitor: Similar but different
  8. Unregistered Visitor: Thanks for fixing my problem!
  9. Unregistered Visitor: Pop up once the category is been defined
  10. Unregistered Visitor: smal amendment