Saturday, April 6, 2019

AIX/PReP under QEMU How-To


AIX/PReP under QEMU How-To

Fetch the 40p-20190406-aix-boots branch and  compile qemu-system-ppc:

configure --target-list=ppc-softmmu

download the OFW image q40pofw-serial.rom configured  for the serial line.

create an empty hard disk image:

qemu-img create -f qcow2 aix-hdd.qcow2 8G

Concerning the VGA graphics: OFW can utilize the S3-Trio emulation done by Hervé, but AIX 5.1 can’t use it yet. For now, the serial line rules, but if you feel adventurous you can try using it omitting  the -vga none -nongraphic part.

qemu-system-ppc -M 40p -bios q40pofw-serial.rom -serial telnet::4441,server -hda aix-hdd.qcow2 -cdrom
/path/to/aix-5.1-cd1.iso  -vga none -nographic

Then in another terminal window:
telnet localhost 4441

The following text will appear:

QEMU PReP/40p, Serial #0, 128 MiB memory installed
Open Firmware, built  April 06, 2019 17:47:55
Copyright (c) 1995-2000, FirmWorks.
Copyright (c) 2014,2017,2019 Artyom Tarasenko.

Type any key to interrupt automatic startup
Boot device: /pci/ethernet  Arguments: 
The DHCP server did not specify a boot server

Boot load failed

ok

Once you see the “ok” prompt, type

ok boot cdrom:2
 
Then be patient, it takes some minutes till the first greeting appears and then some more before the installer starts.
Then answerer the installer questions. On my machine the copy process takes nearly one hour. At 93% it stalls after installing “mtools” for something like 10 Minutes, and then for another 10 minutes after “FAILURES” section, but don’t panic, eventually it will continue.

Once the install is done the emulated machine reboots to the “ok” prompt again. Type

ok boot disk

Supported AIX versions

I tested it with AIX 5.1 only. In theory it might work with 4.3.3 – 5.1 (a smoke test shows that at least the installer does start with AIX 4.3.3), let me know if you tested it. The 6015 support was officially discontinued in AIX 5.2, and probably the corresponding drivers were removed. I haven’t looked it up, as I don’t have a 5.2 media.

Networking in AIX 4.3.3 - 5.1 under QEMU

It looks like the PCNet driver (aka kent) is broken in AIX. I think the "busio" value used to look different in the previous versions. The networking can still be set up though. After performing the install, login as root and do the following (^D and ^C are Control-D and Control-C respectively):

# cat > lance-chg.asc
CuAt:
        name = "ent0"
        attribute = "busio"
        value = "0x01000000"
        type = "O"
        generic = "D"
        rep = "nr"
        nls_index = 3
^D
# odmchange -o CuAt -q "name=ent0 and attribute=busio" lance-chg.asc
# rmdev -l ent0
# mkdev -l ent0
# ifconfig en0 10.0.2.15
# ping 10.0.2.2
PING 10.0.2.2: (10.0.2.2): 56 data bytes
64 bytes from 10.0.2.2: icmp_seq=0 ttl=255 time=4 ms
64 bytes from 10.0.2.2: icmp_seq=1 ttl=255 time=3 ms
^C
#

If you try it with adifferent AIX version, before changing the busio, check first whether you have to modify it:

odmget -q "name=ent0 and attribute=busio" CuAt

In case  you get

value = "0x01000000"

you don't have to change it.

Your feedback is welcome!

Last updated on 2020.02.07

155 comments:

  1. Hi Artyom,

    I get most of the was through. then it dies with the following on boot. 8-()

    AIX Version 5.1
    Illegal Trap Instruction Interrupt in Kernel
    .reset_decr+00014C twnei r5,0 r5=00000001

    KDB(0)>

    This is on an Ubuntu 16:04 Linux AMD Turion(tm) II Neo N40L Dual-Core system.

    ReplyDelete
  2. Are you building a master branch instead of the 40p-20190406-aix-boots ?

    ReplyDelete
  3. Спасибо огромное! Великолепная работа!
    AIX 5.1 установилась и загружается с образа жесткого диска (сделал в формате vmdk через VMWare). Устанавливал без параметров -vga и -serial,через последовательную консоль qemu. Но после установки выяснилось, что клавиатура работает неадекватно в начальных настроечных меню AIX. Через telnet в терминале все нормально.
    Не понял пока, возможно ли ходить в интернет из AIX. Автоматически не настраивается, хотя какие-то 2 интерфейса в меню присутствуют. Вероятно, драйверов для сетевых карт qemu в AIX нет?
    Если интернет заработает, графику можно попытаться получить через telnet в терминале, как для ранних версий SunOS делалось.
    AIX 5.2 у меня тоже нет, как и версий 4.х. Только 5.3. Еще fix pack'и для 4.3.3, 5.1 и 5.3. Но с них, наверное, не установишь систему с нуля. 5.3, впрочем, для других машин уже.

    ReplyDelete
  4. Hi Artyom,

    I think so

    keith@Arya:~/src/qemu$ git status
    On branch 40p-20190406-aix-boots

    I did a git clone, then a
    git checkout 40p-20190406-aix-boots

    then the .configure, make etc etc.

    ReplyDelete
  5. Strange, for git status shows the correct branch.
    I have it working OK. I did 'git clone --branch 40p-20190406-aix-boots --single-branch', then ./configure --target-list=ppc-softmmu, then make. I am on MacOS 13.16, though.

    ReplyDelete
  6. @GeoKM This looks weird.
    - Is the date set correctly on the host?
    - Do you have another machine to try it on?
    At the KDB prompt, can you type
    f
    and post the output here?
    Also can you run

    qemu-system-ppc -M 40p -vga ?

    (the question mark is the part of the command line) and post the output here?

    ReplyDelete
  7. @Alexander Shukin there is a way to setup the network. It may even work out of the box with AIX 4.x. I think AIX 5.1 has a bug in ne2k driver. Will update the how-to about it.

    ReplyDelete
  8. Hi Artyom,

    I have it working 8-) Yay1

    I deleted the lot and started again using Alexander's git clone method of just pulling the branch I need.

    All seems ok, took nearly 4 hours to install thought hehehehe 8-)

    Thanks heaps.

    ReplyDelete
  9. Really great, I also did the build wrong and then used Alexander's git clone method.
    Tried 5.1 and worked great. trying 4.3.2 (I dont have 4.3.3) and so far seems to be infinite wait at 'Boot device: /pci/scsi@1/disk@2,0:2 Arguments:' message, have waited about an hour so far, I will leave it overnight. Tomorrow I will try 4.1 or 4.2 install. Thanks for the great work.

    ReplyDelete
  10. @Casey, Thanks for testing! I doubt waiting overnight would help. Can you please try

    load cdrom:2

    (instead of "boot") and see if it gets to the "ok" prompt (it may restart and continue automatically). If it doesn't get to the "ok" prompt, there must be a bug in my firmware.

    ReplyDelete
  11. @GeoKM My installation took about half an hour in reality, but system in qemu told it was 5 hours 38 minutes, when 93% was done))). Something wrong with timer I think. I have i5 4200.

    ReplyDelete
  12. Hi, after the load cdrom:2 it displays the messages and almost immediately comes up with an ok. When it was appearing hung or paused it was using 100% cpu. I had already waited about 4 times as long as any delay on 5.1. I will test other versions in the morning. I am in New Zealand so it is almost midnight here. Thanks. Regards Casey

    ReplyDelete
  13. I really can't imagine how the networking can be setup! I tried all possible NICs. The 'lsdev -C' command shows ent0 available only for pcnet NIC, but en0 and et0 (logical devices) are defined only. As well as dxme0 and rcm0 (logical devices for graphics), while iga0 (physical device) is available. I found this: http://www-01.ibm.com/support/docview.wss?uid=isg1IY51257 . It's about graphics in AIX 5.2, but looks exactly like our case.
    Tried -net user mostly, but once or twice -net tap, too (with sudo qemu).All the same. I want to understand more about networking, qemu and many other things in life)))

    ReplyDelete
  14. Have a look into the networking section of the How-To. :-)

    ReplyDelete
  15. Hi,
    I tried network but I get an error when I do the mkdev -l ent0
    Method error (/usr/lib/methods/cfgkent):
    0514-050 Cannot perform the requested function because the
    specified device was not detected.
    I am only quessing that I do not have the qemu -net command correct ?
    lsdev -C shows ent0 as
    'ent0 Defined 04-03 IBM PCI Ethernet Adapter (22100020)'
    I have tried a few -net options but nothing changes.
    Regards Casey

    ReplyDelete
  16. Hi,
    I just tried 4.2.1 and it is the same as 4.3.2
    both come back with a ok if i do load cdrom:2
    I added -d guest_errors to the command line
    and just after "Boot device: /pci/scsi@1/disk@2,0:2 Arguments:"
    is displayed in telnet the primary task displays
    "invalid/unsupported opcode: 00 - 00 - 00 - 00 (00000000) 07ea6390 1"
    this is the same for both versions.
    Thanks - regards Casey

    ReplyDelete
  17. Hi, My apologies, That is also displayed on a good aix5.1 sequence.
    Regards Casey

    ReplyDelete
  18. Hi!
    I am reinstalling AIX 5.1 now as it became non-bootable (or maybe long-booting? have no patience to wait) after yesterday experiments installing additional software from 5 AIX CDs. Good news is that software may be installed via smitty while I haven't found a way to mount CDs in AIX yet (I am completely new in AIX world). As I made installation of all available software, system defaulted to boot into graphical desktop, which made it inconvenient (though possible) logging to text console.
    At that moment I saw the new Artyom's post concerning network and tried to configure it. I tried it 3 times manually. Either because I was not attentive enough (it was very late at night) or because I used Tab symbols within cat command (maybe Spaces were needed?), but I failed. odmget command showed 0x1000000 value instead of 0x01000000. Then I pasted-copied all commands from the How-To and this time succeeded! Pinging the host worked! I wanted more and via 'smitty tcpip' configured DHCP network.Probably it was necessary to reboot but I didn't do that and entered 'telnet telehack.com' on the command line. At first the site was accessed but next the connection disrupted and 'bus error' appeared. Network disappeared. Cold reboot didn't work and after hot reboot I couldn't get the command line in reasonable time.
    So, now reinstalling the system). Will try on)

    ReplyDelete
  19. Well, the system is reinstalled). And again, I've tried several times to make it right manually and finally succeeded! Tabs under cat command may be used. My mistake yesterday was typing 0 instead of O in type = "O" string. Now pinging the host works!

    Ha, it's too good to be true! I couldn't open smitty ( it could not create temporary file), could not return to shell and reboot and hot reboot gives me this:
    Starting tcpip daemons:
    0513-059 The dhcpcd Subsystem has been started. Subsystem PID is 3156.
    0513-059 The syslogd Subsystem has been started. Subsystem PID is 4646.
    0513-059 The sendmail Subsystem has been started. Subsystem PID is 4172.
    0513-059 The inetd Subsystem has been started. Subsystem PID is 5420.
    0513-059 The snmpd Subsystem has been started. Subsystem PID is 5174.
    0513-059 The dpid2 Subsystem has been started. Subsystem PID is 5678.
    0513-053 The System Resource Controller is having socket problems.
    If you specified a foreign host, try configuring Internet sockets and
    try your command again, otherwise contact System Administration.
    Finished starting tcpip daemons.

    The cursor's winking, no login prompt. Seems like I'll have to reinstall again)

    ReplyDelete
  20. I've restored my system by entering maintenance mode from CD. Just moved /etc/dhcpcd.ini.bak to /etc/dhcpcd.ini and system booted.
    Now, again, I tried to configure network in smitty tcpip.No DHCP this time. I had to specify parameters by one: first, hostname, then IP (10.0.2.15), next default gateway (10.0.2.2). Nameserver could not be adjusted (command failed). After returning to shell I could ping host and 10.0.2.3 (my router) but could not ping, say, 8.8.8.8 (Google). I decided to change the gateway to 10.0.2.3, but smitty hanged up, I had to hot reboot and now I get a new surprise:
    Starting tcpip daemons:
    0513-059 The dhcpcd Subsystem has been started. Subsystem PID is 4178.
    0513-059 The syslogd Subsystem has been started. Subsystem PID is 4400.
    0513-059 The sendmail Subsystem has been started. Subsystem PID is 4652.
    0513-059 The portmap Subsystem has been started. Subsystem PID is 4904.
    0513-059 The inetd Subsystem has been started. Subsystem PID is 5160.
    0513-059 The snmpd Subsystem has been started. Subsystem PID is 5418.
    0513-059 The dpid2 Subsystem has been started. Subsystem PID is 5676.
    0513-053 The System Resource Controller is having socket problems.
    If you specified a foreign host, try configuring Internet sockets and
    try your command again, otherwise contact System Administration.
    Finished starting tcpip daemons.

    What the hell?! Why socket again? System is unmanageable again! Don't know how to restore. Have a break:-)

    ReplyDelete
  21. I have tried a lot of combinations. Best sofar is
    I have tried fixed ip address on aix side. on host I have tried tap device.
    I get occasional packets. I may get a few pings answered. I might get to a telnet password prompt. Nothing consistant. Before doing anything I copied my .qcow2 file so I can simply copy it back at any time. Probably giving up for 24hours or so.
    Regards Casey

    ReplyDelete
  22. @Casey thanks for testing! This reduces the supported versions to 4.3.3 - 5.1. Unless anyone has a 5.2. to try.

    @Alex do you know that you can use qemu -snapshot option before testing something dangerous? Another alternative is using a backing files. After performing an install I create another qcow2 which uses the clean-install.qcow2 as a backing store, and don't touch the clean-install.qcow2 anymore until I know it's safe.

    One dumb idea why the system may get into the unusable state. Have you checked the disk space? Maybe 8 GiB is not enough for your software? Or maybe something keeps flooding the log files?

    ReplyDelete
  23. @Casey I don't use any extra command line options for the network. I suspect the inconsistency may come from the bad timing. At the moment the time in guest is rushing.

    ReplyDelete
  24. Concerning the time rush. If you'd like to help getting this problem fixed, please test qemu with the proprietary firmware P12H0456.IMG . The proprietary firmware can not boot AIX (at least 5.1, haven't checked the others), but it should be able to boot Linux/PReP or NetBSD/PReP.

    So, once you manage to boot anything with P12H0456.IMG, please check if it has the time rush as well. If there is a time rush with the proprietary firmware, then the bug is on the QEMU side. If not, it must be in my OFW.

    ReplyDelete
  25. This is impressive, thank you!

    ReplyDelete
  26. Thanks. I will try the P12H0456.IMG tomorrow. eg: about 12hours from now.
    Thanks Regards Casey

    ReplyDelete
  27. Time rushing, yes. it may cause troubles. I will test the firmware some later.
    Another thing. I am pretty sure that current default NIC for qemu is pcnet, not ne_2k (as it was before). Although your fixes improve its work. no doubt, but maybe not enough as they were made for ne_2k? I want to try specifying ne_2k on the qemu command line.
    Also later, now I have some other things to do.
    As for duplicating disk images - yes, you're right, I usually do the same, but now I'm in a rather glad agitation (for having AIX emulated has been my dream since 2015 and it comes true!) and I forget and confuse much (I wrote I have i5 4200 while it is 2400 really, for example:-))

    ReplyDelete
  28. I checked my supposition about ne2k and no, installing the system with ne2k_pci brings to absence of any network adapters and interfaces except lo.
    The problem should be in time rushing probably.
    And yes, the default NIC is pcnet.

    ReplyDelete
  29. Ops, you are right, "kent" is pcnet. I've erroneously named it ne2k. Can you take a look into the hardware list AIX 5.1 supports. Maybe there is support for any better NIC QEMU has?

    ReplyDelete
  30. Where can it be found?
    Though, I've tried all qemu NICs with AIX and ent0 becomes available with pcnet only.

    ReplyDelete
  31. Either docu, or, the hard way: on the AIX CD look up usr/sys/inst.images/devices.pci*. Translate the half words from from little endian: i.e. devices.pci.00100300 is a pci device with a vendor id 1000 and device id 0003.

    ReplyDelete
  32. As AiX is not distributed separately from hardware, there's almost nothing definite about it in, say, Release Notes.
    There is something about UNsupported hardware:
    AIX 5.1 Unsupported Devices and Machines
    The following devices and machines are not supported on AIX 5.1:
    v AIX Ultimedia Services Audio and Video devices
    v PCMCIA device support
    v 2707 Eicon ISDN DIVA MCA Adapter
    v 2708 Eicon ISDN DIVA PRO 2.0 PCI S/T Adapter

    Also:AIX 5.1 Unsupported Functions and Filesets
    The following functions and filesets are not supported on AIX 5.1:
    v 7318 Model P10/S20 Serial Communications Network Server
    v AIX Xstation Manager
    v AIX Version 3.2 Network Installation Tools
    v Remote Customer Support and Services
    © Copyright IBM Corp. 2001, 2003 33
    v SOMobjects Base Toolkit
    v Information Presentation Facility Runtime
    v X11.vsm.helps
    v X11.vsm.icons
    v X11.vsm.rte
    v libipfx.a
    v The 7318 Serial Communications Network Server that provides serial and parallel connectivity to
    Ethernet Networks
    v Network Terminal Accelerator
    v The 9333 Serial Link DASD Subsystem
    v devices.pci.b7105090
    v devices.mca.6336
    v devices.pci.331101e0

    and one more quotation:
    Supported Devices
    Device Driver support for EEH is limited to the following devices that are supported by AIX 5L for POWER
    Version 5.1:
    v Storage Adapters:
    – Fibre Channel (6227)
    – Fibre Channel (6228)
    – Fibre Channel (6239)
    – PCI SCSI RAID Devices
    – PCI Ultra SCSI Devices
    – PCI Dual Channel Ultra3 SCSI Adapter (FC 6203)
    – PCI Dual Channel Ultra2 SCSI Adapter (FC 6205)
    v Communications and connectivity (PCI bus type):
    – Token-Ring PCI 4/16 Adapter (FC 2920 and 4959)
    – IBM Ethernet 10/100 Mbps (FC 2968)
    – 10/100 Mbps Ethernet PCI Adapter II (FC 4962)
    – IBM 4-Port 10/100 Base-TX Ethernet PCI Adapter (FC 4961)
    – 10/100/1000 Base-T Ethernet PCI Adapter (FC 2975)
    – Gigabit Ethernet (FC 2969)
    – TURBOWAYS 622 Mbps PCI MMF ATM Adapter (FC 2946)
    – 2-Port Multiprotocol PCI Adapter (FC 2962)
    – 8-Port and 128-Port 232/422 Async PCI Adapters (FC 2943 and 2944)
    – IBM Gigabit Ethernet-SX PCI-X Adapter (FC 5700)
    – IBM 10/100/1000 Base-TX Ethernet PCI-X Adapter (FC 5701)
    – IBM 2-Port 10/100/1000 Base-TX Ethernet PCI-X Adapter (FC 5706)
    – IBM 2-Port Gigabit Ethernet-SX PCI-X Adapter (FC 5707)
    – S/390 ESCON CHANNEL PCI ADAPTER (FC 2751)
    – IBM ARTIC960HX 4-PORT PCI ADAPTER (FC 2947)
    – IBM ARTIC960RXD QUAD DIGITAL TRUNK ADAPTER (FC 6310)
    v Encryption adapters:
    – IBM PCI 4758 Cryptographic Coprocessor Card (FC 4958 and 4963) *
    – IBM Crypto Accelerator (FC 4960) *
    v Graphics and miscellaneous
    Chapter 2. AIX 5L for POWER Version 5.1 21
    – GXT135P Graphics Adapter (FC 2848) *
    – USB Open Host Controller (FC 2737) *

    To try the hard way I haven't yet learned mounting CDs inAIX :-)

    ReplyDelete
  33. Don't need mounting it under AIX, it's an iso9660 cd :-). Linux can do. Even Windows, maybe can work.

    ReplyDelete
  34. OK, I'm on MacOS, BetterZip archiver opens them. DiskImageMounter doesn't, for some reason.

    ReplyDelete
  35. Hmm, I see how to read the vendor/devices ids, but haven't found a way to interpret them. bacnet provides decimal ids.Though inconvenient, it can be used. But what about device ids?
    Well, now I've figured out that I need to reboot each time I assign any value via smitty tcpip. I have IP, netmask and default gateway assigned, but cannot adjust nameserver. And I can ping evrything, it seems.Though many packets get lost. And I managed to telnet to 10.0.2.3 (my router). But after pinging I lose execution rights. cannot even reboot:
    ksh: reboot: 0403-006 Execute permission denied.
    I have to press ^D, reset machine from qemu menu, close qemu and start it again.
    So I can use digital addresses only as DNS isn't configured.

    ReplyDelete
  36. Are using the qemu usermode network which is 10.0.2.x and your home network uses the same addresses? This may provide some surprises. Or are you using tap?

    Loosing execution rights is really weird. Must be a kernel crash, I guess. Have you tried observing the disk space? "alog" may provide some hints too.

    Concerning the PCI numbers, you can check them here: https://pci-ids.ucw.cz/read/PC . On the other hand I suspect the most AIX NICs would have the IBM vendor id. But there is a chance they used some convenient chips under their label. Don't know how to find that. Linux and NetBSD boot logs from the IBM machines may give some insights on what is what.

    ReplyDelete
  37. I also lost execution rights once. I am using tap interface. I get similar results. I have about 48hours before I leave on a 10 day trip. When I return I want to do a lot of study. It is 10 years since I was using aix assembler. I have ordered a nice 16 core/128gig memory ryzen box as a toy to play with and will probably have about a year to play with all this stuff nearly full time. I am hoping to learn a lot and refresh a lot. I hope to test the firmware today. regards Casey

    ReplyDelete
  38. Hi, I cant find a good boot combination with that bios.
    I tried sandalfoot CD with no bios specified (OpenBios 1.1) on standard qemu 3.1 and clock runs fast. Sleep 60 takes 15 seconds. I tried this on your aix qemu and same timing sleep 60 takes 15 seconds. In both cases machine type was 40p. Then as I do not know how much code is common I tried debian_wheezy_powerpc (openbios 1.1) with standard qemu3.1 (no machine type specified) and sleep 60 was 60 seconds. Also tried on qemu aix version (no machine type specified) and sleep 60 was 60 seconds. In both cases on debian the tap network was rock solid. How do I tell what the default machine is. ? I guess the issue is in qemu 40p code. - Thanks Regards Casey

    ReplyDelete
  39. I think the default machine is mac99 so I set that and repeated the debian test. Same result both standard and aix qemu versions (ith openbis 1.1) have good time and tap interface is rock solid.
    I will try a aix5.2 install later today. Regards Casey

    ReplyDelete
  40. Hi, I tried aix5.2 and got the following message
    ok boot cdrom:2
    Boot device: /scsi/disk@2:2 Arguments:
    Can't open disk label package
    Can't open boot device
    The same with a boot or load command.
    Thanks - regards Casey

    ReplyDelete
  41. With AIX 5.2 cd can you post the output of
    .partitions cdrom

    Thanks for your tests. Maybe the clock rush and the PCnet problems are independent.

    ReplyDelete
  42. @atar
    Yes, I've used usermode network so far, but my home network is 192.168.1.x.
    I've managed to telnet to 64.13.139.230 (telehack.com) and even start starwars there but very soon "command is respawning too rapidly" appeared and connectiion stopped. Suppose with tap network it should be better. Will try it next.
    Execution rights are lost each time I use ping, sometimes after telnetting.
    Something about disk space is wrong. At least when I type 'vi etc/filesystems' the editor complains about insufficient space. Disk image (in vmdk format) is 543M in size only. It's far less than 8G yet.
    About AIX supported qemu NICs. I think I know the truth). qemu supports attaching up to 8 NICs at once. And in smitty>devices there is a section "Install/configure devices plugged after IPL" or alike. I've tried it with all qemu NICs (attached by several at once) and failure reports were about missing filesets (with numbers) on installation media (cd1). After reboot no new ent devices appeared in lsdev -C command.
    So I think no qemu NICs except pcnet are supported in AIX 5.1.

    ReplyDelete
  43. In theory, vendor/model of a NIC can be changed in qemu source to make AIX think it's a supported one but will it work? Only if the driver fits, that is, if chips are very similar. Too hard for me to do:-)

    ReplyDelete
  44. ok .partitions cdrom
    Partition Region Boot Format Size (MB)
    1 Primary Yes 0x96 633
    ok

    Thanks - Regards Casey

    ReplyDelete
  45. @Casey, so there is no partition 2. The only chance to get it going is

    boot cdrom

    ReplyDelete
  46. @Alex, multiple slots, hmm. Forgot to mention, that my OFW supports just one additional slot (as I could not find any device to put in anyways, I thought one should be enough). But then again the devices in further slots would be detected, the only missing part is the interrupt handling.

    On the other hand, the newer AIX versions do support the virtio network, right? I wonder if it's possible to make the drivers work under 5.1.

    ReplyDelete
  47. Hi, Is ok to PM you on facebook,? (I found your facebook page)
    Regards Casey (Ken Jones)

    ReplyDelete
  48. I sent you a facebook pm.
    If we need to it should be relatively easy to write a device driver for AIX that
    gives us what we need. There is docs on writing aix device drivers. Something for me to think about and study while I am away. Probably worth looking at clock issue first. Very quick timeouts would cause many issues. The sandalfoot clock was 15sec instead of 60 seconds but aix was about 8 seconds instead of 60seconds. That makes for very quick timeouts. Regards Casey

    ReplyDelete
  49. It seems the message "command is respawning too rapidly" I often see in AIX also has to do with that.

    ReplyDelete
  50. @Alex "command is respawning too rapidly" is about lft0, right? You just need to un-configure/disable the low function terminal.

    ReplyDelete
  51. yeah,quite right! disabled. Much better without it,thanks!

    ReplyDelete
  52. Hmm, it returns every time. After login TERM is set to 'dumb', I want it to be vt320, tried to set it in etc/profile, /etc/rc, etc/environment, no result.

    ReplyDelete
  53. You've got PM. And for the things like TERM I think https://aixportal.ru/forums/forum/power-systems/ might be a good place to ask.

    ReplyDelete
  54. Hi!
    Found a solution to TERM and lft incoveniece.Just inserted 'rmdev -l lft0' and 'TERM=vt320;export TERM' into .profile. Now it's satisfying.)
    Tried your new FW image. Seems like the system works slower. It comes slower to OK prompt and also slower to login prompt.And after login it's slower.Though it's strange for me - I've always thought OSes don't use any programs from FW (except MS DOS or similar).
    But it looks like time is ticking correctly (6 5 4 3 2 1 before OK prompt feel like real seconds).
    Ping works slower,too. transmitting packets time(shown) is from 33 to 16000 ms (while with older FW from 44 to 4000 ms). The percentage of lost packets is from 15% to 29% (from 50% to 86% with older one).
    Artyom, I remember the time when you only started playing with 40p. Then when I tried to reach KDB from AIX 5.1 disk after you I had to increase the CPU frequency in qemu source for more than 100 times to get to the prompt in reasonable time.Could something like that be done with timer? I know from emaculation.com that timing is wrong now in mac99 and and g3beige machines, too.
    Rights for executions after pinging are lost as well.

    ReplyDelete
  55. It has come to me suddenly: virtio driver for AIX 7.2 is for 64 bit machines. But 40p is a 32bit one.Hardly it will work. Unless it is open sourced. Then it could be edited.

    ReplyDelete
  56. True, if it's not open sourced, we can't re-use it.

    ReplyDelete
  57. That driver could,in theory, work in 7.1 or in 6.x but there almost certainly is another problem. Once upon a time I tried to use usb drivers from Windows XP in NT 4 and the system told there was no kernel support for it. To add that to Windows kernel was(and still is) much too high for me. The same goes for AIX:-).

    ReplyDelete
  58. Concerning the timer: the problem is that it's already too fast. Making the speed normal would slow the things down. Imagine there is a "sleep 10" in a start-up script. With the clock rush it would be something like 2 seconds. The same happens with all possible timeouts. So, maybe we should try to find out if we currently hit any timeouts, and try improving the emulation the way that the hardware responds (with ack or nack) before the timeout is hit.

    ReplyDelete
  59. Still, as virtio is well-documented, a high-skilled AIX programmer could write the drivers from the scratch I suppose.

    ReplyDelete
  60. Yes, virtio requires just PCI and DMA. And we have both, so that should be possible.

    ReplyDelete
  61. I like the idea of looking to see if we are relying on any timeouts and changing things so we do not wait on the timeout. It makes sense. Doing a device driver would be a interesting project, but for me the learning time will be extensive. The code does not bother me but coming up to speed on the overall environment will be considerable. It is something I will think about in time but it is likely someone else will beat me to it.

    ReplyDelete
  62. Fixed clock rush and PCNet irq routing in the OFW, updated the links in the how-to.

    ReplyDelete
  63. Looks like the link for FW is broken&

    ReplyDelete
  64. A correct link:
    https://github.com/artyom-tarasenko/openfirmware/releases/download/40p-20190413/q40pofw-serial.rom

    ReplyDelete
  65. Tried the new firmware. Works a charm! The network is fast(although user mode), no losing execution rights so far. Accessed 64.13.139.230(telehack.com) in a second, started starwars(an asci movie), everything's alright. Want to try tap network and 2 NICS simultaneously. It failed for me with older FW.
    Artyom, you're a champion!:-)

    ReplyDelete
  66. Thanks for the feedback! Glad it works. And thanks for reporting the broken links. Fixed them.

    ReplyDelete
  67. Succeeded to start 2 tap networks: a bridged one for global network and the other for local net. (I don't know any way for IP forwarding in MacOS like it may be done in Linux, so a tap device may be configured either for local networking or for global net only). Managed even to start xterm from the guest AIX system on host! Next step is graphical desktop over network>

    ReplyDelete
  68. Wanted to say thanks ! Really amazing work, tried both AIX 5.1 and AIX 4.3.3 and all work. Currently Im going to try 5.3.

    ReplyDelete
  69. Runnig /usr/bin/X11/xdm inside the AIX emulation (make sure network is up for example 10.0.2.12) you can get the remote X11 from the host via Xephyr -screen 980x640 -ac -query 10.0.2.12 :3

    ReplyDelete
  70. absolutely fantastic, what a great achievement, works fantastic. Regards Casey

    ReplyDelete
  71. For some reason each time I reboot my second tap interface ent1 takes the value of 0x1000120. Have to manually change it: odmchange -o CuAt -q "name=ent1 and attribute=busio lance-chg.asc (file edited for ent1). Then I can configure en1 (for local network).
    I use 'Xephyr -screen 800x600 -ac 10.0.2.15 :1' on the host to start X applications. However I have to 'export DISPLAY=10.0.2.2:1.0' in guest. Next I can start xterm. It works correct though complains for missing fonts. I can also run startx and get a simple desktop with aixterm, the one Astr0baby showed in his video in Twitter. But the keyboard layout in aixterm is absolutely mad)), and is hard to use. xdm won't start at all on my system. Don't know why.

    ReplyDelete
  72. Xephyr :1 -screen 800x600 ac 10.0.2.15 in fact).

    ReplyDelete
  73. Thanks for the feedback guys, looking at my OFW repository on GitHub (https://github.com/artyom-tarasenko/openfirmware) which has just one star (effectively zero because the only one was given by a robot to all Forth-related projects) I thought there are no users for it. Even my qemu repository has 8 stars, I guess because there are more users interested in SPARC than in AIX/PReP.

    ReplyDelete
  74. Installing the latest RPMs from http://www.perzl.org/aix/ works really well, one has to go through the RPM dependency hell on the aged AIX 5.1 but its well worth it. Michael Perzl has the up2date GCC compilers, tools and stuff to get one going researching this wonderful OS.

    ReplyDelete
  75. I see 3 stars there at your repository now, Artyom. What does it depend on?

    ReplyDelete
  76. It does Depend on the number of people clicked on the star icon. :-) It's the GitHub equivalent of "like".

    ReplyDelete
  77. Wow, totally awesome! I have AIX 4.3.3 running on my 2006 MacPro with the Linux Subystem on Windows 10!

    ReplyDelete
  78. 40p currently has a memory limit of 192mb. Any chance of getting more memory?

    ReplyDelete
  79. It makes no sense I think as AIX recognises only 128mb.

    ReplyDelete
  80. Alexander Shukin, I remember using AIX 4.3.3 with 2GB of memory.

    ReplyDelete
  81. Yes, the 128MiB is the limit of the current OFW, not AIX. I was too lazy to implement memory detection. Y'know, 128 MiB should be enough to everyone, so atm it's hard coded. You can change and rebuild OFW if you want 192 MiB.

    Concerning the memory limit: can you please check the 40p memory map? If there is a hole above 192MiB, the limit can be easily increased. But if there is something like PCI bus - alas. And if we can go above 512MiB it would be worth implementing OFW memory size auto-detection for me.

    ReplyDelete
  82. atar,

    I dont know how to check the 40p memory map :(

    But, you did a great job with this ofw, thank you very much.

    ReplyDelete
  83. The memory map can either be found in the docs, or assuming that the QEMU 40p model is close enough to the reality, with "info mtree" in the qemu monitor.

    But actually, how can the additional memory be utilized? 128 MiB was a lot at the time of AIX 4.3.3.

    ReplyDelete
  84. atar,

    I remember running AIX 4.3.3 with 2GB of memory, and it was very useful for db applications. If I remember correctly, each process can use up to 2.5GB in that version.
    PowerPC R601 used in 40p model support up to 2GB for sure.

    More memory will help with performance of the file system and better performance in CDE.

    Your work will help companies that have migrated from legacy systems based on AIX but need to keep servers running from time to time to access old data when needeed. These system require more memory.

    I have my self an old f50, a h70 and a f80, if you need anything that I can help.

    ReplyDelete
  85. I don't think there is an interest from the companies. Unlike with Solaris, no company contacted me to run any old stuff on AIX. I guess they either migrated to the newer IBM hardware and AIX versions, or migrated from AIX completely.

    So, I mostly do it for the enthusiasts like Alex or Jayson. I remember CDE was quite slick on a SPARCstation with 32MiB of RAM. Was it not like this in the PPC world?

    In any case building a PReP compatible machine emulation with more RAM and building OFW for it is not that difficult. I just have some other projects to work on.

    ReplyDelete
  86. atar,

    Companies dont look for AIX emulation because it was historically never possible (except for very old version) and also because AIX executables remain compatible in newer versions (and maybe because AIX is still a commercial product so I am not sure if emulation is 100% legal).

    Today it is easy to keep an old machine just to run something not business-critical. But I am seeing more and more machines failing (oxidation, capacitor failure, disk failure), and newer techs don't want to learn about these ancient systems - they are very different from a x86 platform.


    I have some rpm for aix 4.3 and 5.1, and successfully installed bash (I hate ksh sorry), perl, apache, php, gcc in AIX 5.1 under qemu under debian in Windows 10 (WSL). AWESOME.

    While writing this comment I Just mounted a NFS share and started a 1.8GB database and tried some queries. It was smoothly considering only 128mb of RAM.

    qemu performance was on par with a PPC R601 (my machine has a Core i7).

    ReplyDelete
  87. Actually you can do a lot with virtualized AIX 5.1 under qemu-system-ppc - I have just compiled
    Prboom and can play Doom/Doom2 on it ... its quite snappy
    https://twitter.com/astr0baby/status/1121856987556450304

    ReplyDelete
  88. If someone's interested: HPUX can work in qemu-system-hppa now: https://t.co/hUVitbkCJ4

    ReplyDelete
  89. Any chance for network boot via nim . Idea is to try to install aix 5.3 from nim via rs6000 server.
    Install from original install media does not work while problem with nonexistent boot partition.

    ReplyDelete
  90. There is a video on how to install AIX via NIM server: http://androidmafia.ru/video/ZsNszt88xfM
    If I get it right, NIM server can be run off HMC(which can be run from, e.g., a virtual Windows or directly from VirtualBox).
    I sometimes think about using HMC in VBox (have it installed already) for creating LPAR in qemu-system-ppc64 and next, for installing IBM System i in qemu. But haven't yet figured out how to establish network between qemu and VBox. Once it is done, HMC in VBox could be used for installing AIX via NIM as well.
    Sadly, I couldn't yet get focused on this so far.((

    ReplyDelete
  91. I haven't tried NIM, but even if it works it makes a little sense to do it with AIX 5.3 on the 40p emulation: this version has no drivers for PReP devices.

    ReplyDelete
  92. Is this model of VM only 32bit machine?

    ReplyDelete
  93. what is the qemu version used in the article.
    qemu-system-ppc --version

    ReplyDelete
  94. @Anonymous The version which you'll get after building the branch 40p-20190406-aix-boots. Should work with the current master as well, since the patches have been accepted in the upstream.

    ReplyDelete
  95. @Weizhong Gong yes, it's 32 bit only. I think there were no 64 bit PReP machines in the wild.

    ReplyDelete
  96. I try to running qemu-system-ppc, the lastest 4.1.0 on fedora 30 and on Windows 7.
    I have the trouble :
    boot cdrom:2
    ...
    boot device: /pci/scsi@1/disk@2,0:2 Arguments
    AIX Version 5.1

    and wait, wait, a night..

    ReplyDelete
  97. Does it work any better if you do it with my 40p-20190406-aix-boots branch?

    ReplyDelete
  98. Hello atar,
    I git the branch
    https://github.com/artyom-tarasenko/qemu/tree/40p-20190406-aix-boots
    dnf install libfdt-devel
    ...
    make
    ...
    CC util/memfd.o
    /home/prep/qemu-40p/qemu/util/memfd..c:40:12: (Sorry in french)
    erreur: la déclaration statique de "memfd_create" suit une déclaration non statique
    40 | static int memfd_create (const char *name, unsigned int flags)
    |
    Dans le fichier inclus depuis /usr/include/bits/mman-linux.h:111,
    depuis /usr/include/bits/mman.h:34,
    depuis /home/prep/qemu-40p/qemu/include/sysemu/os-posix.h:29,
    depuis /home/prep/qemu-40p/qemu/include/qemu/osdep.h:104,
    depuis /home/prep/qemu-40p/qemu/util/memfd.c:28:
    /usr/include/bits/mman-shared.h:50:5 note: la déclaration précédente de "memfd_create" était ici
    50 | int memfd_create (const char *__name, unsigned int __flags) __THROW;
    |
    make: *** [/home/prep/qemu-40p/qemu/rules.mak:69: util/memfd.o] Error 1

    Best regards,
    Pascal

    ReplyDelete
  99. @pviltard can you try building it with the FDT supplied with qemu? Actually for the PReP target FDT is not used, so any code which compiles should do.

    ReplyDelete
  100. And, btw above I wrote that all the patches were accepted in the upstream which is not true. At least one patch is still not accepted (thanks to Mark for pointing this out), so for now you have to use my branch.

    ReplyDelete
  101. Hello Artyom,

    It is your branch :
    git clone https://github.com/artyom-tarasenko/qemu.git
    Clonage dans 'qemu'...
    remote: Enumerating objects: 398961, done.
    remote: Total 398961 (delta 0), reused 0 (delta 0), pack-reused 398961
    Réception d'objets: 100% (398961/398961), 112.67 MiB | 19.67 MiB/s, fait.
    Résolution des deltas: 100% (324304/324304), fait.
    [root@JACOB qemu]# mkdir build
    [root@JACOB qemu]# cd build
    [root@JACOB qemu]# make
    ...
    CC util/memfd.o
    same error with static declaration memfd_create
    best regards,
    Pascal

    ReplyDelete
  102. Hello Artyom,

    [root@JACOB build]# dnf remove libfdt-devel
    ...
    Suppression de : libfdt-devel-1.4.7-3.fc30.x86_64 1/1
    ...
    [root@JACOB build]# ../configure

    ERROR: DTC (libfdt) version >= 1.4.2 not present. Your options:
    (1) Preferred: Install the DTC (libfdt) devel package
    (2) Fetch the DTC submodule, using:
    git submodule update --init dtc

    I choose the first option.
    Best Regards,
    Pascal

    ReplyDelete
  103. Hello Artyom

    I could install and test aix5.1 successfully with QEMU emulator version 3.0.92/Fedora release 29.

    But i am unable to install aix5.3 using similar steps.

    What is the qemu recommended for aix5.3 and os
    Pl provide some hint.
    regards
    VRC

    ReplyDelete
  104. Hello!
    5.1 is last AIX on prep machine IMHO.
    Higher you can not install on qemu, just 7.2 on 64 bit qemu when you have right install media :-) .

    Crni

    ReplyDelete
  105. Hello Artyom,
    I don’t get a chance to see Qemu ppc work. I desintall version 4.1, installed the official version of fedora qemu.x86_64 2:3.1.1-2.fc30.
    boot cdrom:2
    ...
    MAC address
    The MAC address in the EEPROM is invalid
    NVRAM

    Nothing there
    Nothing there
    ethernet
    Nothing there

    normal ?

    Pascal

    ReplyDelete
  106. This comment has been removed by the author.

    ReplyDelete
  107. Hi guys,

    I'm running AIX 4.3.3 off of a Debian 10 VM on an Ubuntu 18.04 Server. (On the Ubuntu Server, Virtualbox runs the Debian VM with a bridge adapter (PCnet-PCI II) on which QEMU is running AIX 4.3.3).
    A static IP is assigned to the Debian VM through which the user can launch QEMU.
    My end goal is just to be able to transfer files remotely through ftp or ssh on a static IP OR transfer files through the VM on some kind of shared drive.
    AIX doesn't seem to detect my network adapter (it is not defined nor available, i only have loopback). I've tried multiple options for -net nic and -net tap.

    1) Does anyone have any suggestions so that it detects my ethernet adapter? I was thinking of removing the Debian VM and running QEMU directly off the Ubuntu Server.

    2) Is there a way to use a directory on the Debian VM as a shared folder with QEMU? (In this case, configuring the network is not necessary)

    I would appreciate any help.

    ReplyDelete
  108. I haven't tried the networking under AIX 4.3.3, but it's likely to be the same as under 5.1. Have you tried to use the odmchange trick described in the how-to?

    ReplyDelete
  109. Good evening and happy new year

    I am interested for AIX working in qemu. Now i know with your work
    i can have 5.1 version of AIX working. I have a little problem I can't make
    the net work. So i can't go further. I have a qemu version of your GIT on
    WINDOWS 7 compiled by myself with MSYS2 for 32 bits because i ahve a 32 bits
    WINDOWS 7 machine. So i can install AIX51 directly.
    Now i am blocked with the configuration of the Network. I hope for the new year
    have an AIX 51 working on my old PC with qemu. I like to work with WIN7 32 bits
    because i am an old man.

    Thanks for making a dream a real reallity

    Best regards

    ReplyDelete
  110. The user networking (SLIRP) should work just the same as described for Linux.

    ReplyDelete
  111. Good morning

    Yes The user networking (SLIRP) work on Debian 9.3.0 on a VMWARE
    machine on WIN 7 ans so we can install openssh on the AIX5.1 guest
    Then we can use the qcow2 file to transfert on the AIX5.1 on qemu
    installed on the WIN 7 machine. Then you cant boot AI5.1 without the
    SLIRP interface but with the follwing instructions
    -L pc-bios -net nic,model=pcnet -net user,hostfwd=tcp::5555-:23,hostfwd=tcp::7777-:22
    so you can use Putty and Winscp on the WIN 7 machine.
    For the WINSCP configuration ypu must use the SFTP protocol
    with the Advance configuration for the session with
    no optimiser la taille du tampon de connexion et 120 secondes avant
    Time out
    So you can transfer what you want from the WIN 7 to the AI5.1 guest
    Thanks a lot

    ReplyDelete
  112. Hello!

    Is there any way to attach it more than 7 virtual disks? When a I try to do that, Qemu displays "machine type does not support if=scsi,bus=1,unit=[0,1,2...]" message for each aditional virtual drive and quits.

    Thanks.

    ReplyDelete
  113. It should be possible to add another SCSI adapter and attach to it 7 more disks, but I haven't tested it. I think you'll need adding residual data to the second scsi node manually in order to make it visible for AIX. It's been a while, but I think I added them only for the first adapter. OTOH they were necessary to make it bootable, maybe a non-bootable adapter would be detected with the residual data automatically generated for PCI devices.

    Out of curiosity, why do you need more than 7 disks?

    ReplyDelete
  114. Thanks for replying, @atar. It's just for testing purposes.
    At this time I'm trying to get e1000 virtual card and 64bit kernel working. Is it possible? Best regards.

    ReplyDelete
  115. Do you have AIX 5.1 drivers for e1000? Then it should work. BTW I would be grateful if you point to location where to get them.

    I don't think a 64 bit kernel would work with PReP: there were no 64 bit PReP machines produced by IBM, afaik.

    ReplyDelete
  116. Hi all and amazing work!

    Have any of you made network to work in 4.3.3? I can see the ethernet appear during boot but the card is not recognised, i have tested with pcnet and e2k variants to no avail...

    Command to start aix
    ppc-softmmu/qemu-system-ppc -M 40p -bios q40pofw-serial.rom -serial telnet::4441,server -hda aix-hdd.qcow2 -vga none -nographic -netdev tap,id=mynet0 -device pcnet,netdev=mynet0


    Telnet output with ethernet present.
    First stand-init:
    Calibrate
    CIF buffers
    DHCP init
    memory node
    Instruction cache on
    Decrementer
    Enable machine check exceptions
    Set Memory Map
    MMU
    Root node
    Data cache on
    Fast CPU mode
    PCI host bridge
    CPU nodes
    Initialize fixed vars
    Keyboard overrides
    Memory node
    ISA
    Power
    GPIO
    RTC
    MAC address
    The MAC address in the EEPROM is invalid
    NVRAM
    security-mode = none
    Setting configuration variables to default values.

    Nothing there
    Nothing there
    Nothing there
    ethernet
    scsi disk tape
    QEMU PReP/40p, Serial #0, 128 MiB memory installed
    Open Firmware, built April 13, 2019 09:29:23
    Copyright (c) 1995-2000, FirmWorks.
    Copyright (c) 2014,2017,2019 Artyom Tarasenko.

    ReplyDelete
  117. I haven't tried it specifically with 4.3.3, but pcnet should work. Have you checked the busio value with odmget as it's suggested in the how-to? Maybe it's broken just like in 5.1?

    ReplyDelete
  118. Thank you for your answer, I got it working by reinstalling the system starting with the card enabled, a package was installed that had the drivers and with the patch workaround in the how to above it works flawlessly!

    Now on to another question, I have a disk imaged from a Bull Estrella 350 machine, that machine had open firmware 1.2 RM11 which I converted to qcow2 format. When it boots I get the following error:

    This release of AOS does not support this hardware revision.

    Please contact your sales representative for the hardware
    requirements for this release.

    Power-cycle or reset to return to the firmware prompt.



    Is there a way to upgrade the image or modify some file to be able to boot it with this firmware?

    Thank you!!

    ReplyDelete
  119. Tricky. I was able to boot a PowerStack image up to NFS mount (it's unfortunately mounted on boot in my image, and fails hard if can't find the server, making the image effectively useless). But as I recall I had to modify qemu: the interrupt maps are different. Don't remember the details. Maybe I did it because I tried with the Motorola firmware first.

    After AOS the AIX 5.1 was much easier to debug because it had a built in KDB and the ability to turn logging on, so I switched to it.

    One thing to check is the machine type: AOS check's it on the boot, so qemu-prep is not going to work. Another thing is the chipset type. Although qemu emulates Motorola chipset, the IBM AIX won't boot if it sees it, so my firmware lies that it's an Intel one.

    Bull has a Motorola mainboard, right?

    Mototola guys didn't get the concept of OFW back then. Instead of creating the residual data via the firmware (the Powerstack II Utah firmware had the necessary tools for it, but they were not used), the Motorola engineers modified AIX bootloader to generate this data, and I think this residual data were mostly hardcoded. Otherwise it would have been possible to boot the unmodified IBM AIX on the Motorola machines (this is what effecively happens in qemu with my firmware).

    It should be possible to attach a debugger, see where the AOS IPL fails and find out what is it missing. But that would require some time and skills.

    Why do you want to have the AOS? Does it have any features which AIX 4.x doesn't have? Is it not compatible with AIX 4.x?

    ReplyDelete
  120. Yes it is a motorola mainboard, what I'm trying to do is save a working AIX 4.3 system whose hardware is 25years old. The goal is to ideally have it virtualized to preserve it without the need to rely on hardware not easily replaced.

    Can you elaborate the machine type check? Is it possible to modify it in the files of the system?
    Also what about the debbuger? Is it a documented process?

    Thank you again for your time!

    ReplyDelete
  121. Connecting gdb to qemu is documented in the qemu documentation. I don't have any documentation on AOS IPL.

    Concerning the machine check, take a look here: https://tyom.blogspot.com/2017/09/aix-under-qemu-boots-up-to-nfs.html. Estrella AIX may require some other constants, but you'll get the idea.

    Wouldn't it be easier to perform a fresh install of the IBM AIX 4.3 and copy the stuff from your image to that fresh image?

    ReplyDelete
  122. Yes it would be easier to install if I had all the applications in order to install.. thank you for the link and guidelines, I'll report back with my findings, maybe it'll help another one as well!

    ReplyDelete
  123. I have installed 4.3.3 with success configured network by using your patch and smitty to set it correctly and it works every time! Is it possible to make the machine boot from the hard disk and run as a daemon? Is it implemented or possible?

    For anyone with 4.3.3 the key is to create the tap interfaces correctly for my environment I used the commands:

    tunctl -t tap0 -u `whoami`
    brctl addif br0 tap0
    ifconfig tap0 up

    After that I start with:

    qemu-system-ppc -M 40p -bios q40pofw-serial.rom -serial telnet::4441,server -hda aix-hdd.qcow2 -vga none -netdev tap,ifname=tap0,id=mynet0,script=no -device pcnet,netdev=mynet0,mac=00:00:00:11:11:11 -daemonize


    Which after I login to console runs in the background.

    2 things I believe are missing:

    The ability to boot from disk without intervention
    The ability to run the VM at the host startup

    All and all, pretty happy as it works now!

    Can't thank you enough!

    ReplyDelete
  124. Hi again! Is it possible to get more RAM? I know 4.3.3 is capable of using more than 384MB of RAM in some DB applications.

    ReplyDelete
  125. In principle it's possible. The current value of 128 MiB is hardcoded in the OFW, but you can change it and recompile. To get more than 384 you also need to modify QEMU. I don't remember whether the limit of 384 is artificial or is caused by a device residing at 384MiB. If that's a device, it probably should be possible to move it somewhere higher. I think it's possible to build a PReP machine with at least 1GiB RAM. Then you would need to change the OFW residual data to match the physical (well, actually virtual) map.

    ReplyDelete
  126. Thank you all for this; we acatually have a need to emulate AIX 4.1.2 - i need to get networking functioning under QEMU but when i attempt to startup the QEMU AIX emulator i get the following errors:
    root@qemu-emu-template:/var/lib/qemu# ppc-softmmu/qemu-system-ppc -M 40p -bios q40pofw-serial.rom -serial telnet::4441,server -hda aix-hdd.qcow2 -vga none -nographic -netdev tap,id=mynet0 -device pcnet,netdev=mynet0 -cdrom /home/vdrmaint/Volmue_1.iso
    qemu-system-ppc: network script /etc/qemu-ifup failed with status 256
    root@qemu-emu-template:/var/lib/qemu#

    I am unsure how to go about setting up networking in QEMU is there a simple way with Ubuntu? I'm builiding a guide on the subject and would like to get this online in short order.

    Thanks again for all your wonderful work.

    ReplyDelete
  127. I forgot to ask;
    We have production servers on H50's running with 3GB of Ram (that's the upper limit for AIX 4.1) I could drop a memory map if needed. I'd need a hand and some direction on how to recompile the firmware though.

    Also I'd need a hand with the Network setup as well.

    I'd be willing to pay you for your time.

    ReplyDelete
  128. Contact me at a.tarasenko@gmail.com

    ReplyDelete
  129. Hi Atar,

    Thank you very much for the blog, it really help me to install AIX in my laptop. I have some problem with, the last part with the networking.

    I am running Debian8 Jessie

    When I am trying to configure the network , I have the next error:
    I am running IAX 4.3

    cat > lance-chg.asc

    It does not do anything

    remdev -l ent0
    ent0 Defined
    mkdev -l ent 0
    ent0 Avaliable

    ifconfig en0 10.0.2.15

    0821-510 ifconfig: error calling entry point for /usr/lib/drivers/if_en: Cannot establish connection to a remote service.

    Do you know how to fix this error. I have been trying to find the solution but I have not found anything in internet.

    Regards
    Felipe

    ReplyDelete
  130. @felipe, "cat > file" is used to write some lines into the file, just like in any unix/linux. Then control-d is used to tell that all the lines are written. You can check the content of the file with "cat file". After you created the file you have to run "odmchange" as written in the how-to.

    ReplyDelete
  131. Whenever I type boot cdrom:2 it first says :

    Boot device: /scsi/disk@2:2 Arguments:
    Rebooting in the correct mode for this client program ...

    Type 'i' to interrupt stand-init sequence
    Interacting

    and then when I type it again it returns this:

    Boot device: /pci/ide/disk@2,0:2 Arguments:

    Can't open boot device

    What have I done wrong? I followed all the steps apart from changing the paths for the files

    ReplyDelete
  132. Don't press 'i', this is a feature for debugging OFW itself.

    ReplyDelete
  133. I tried .partions and .partions cdrom and both return
    .partions?

    and when I try boot cdrom, load cdrom, boot cdrom:1 or load cdrom:1 I get

    Boot device: /scsi/disk@2: Arguments:
    The attempt to load a boot image failed.

    or

    Boot device: /scsi/disk@2:1 Arguments:
    The attempt to load a boot image failed.

    I've also tried load cdrom:2 and its the same thing as boot
    Im running a windows 10 home machine with 10gbs of RAM

    ReplyDelete
  134. No matter what I try it always comes back saying the same thing

    ReplyDelete
  135. 1. It's ".partitions" , not ".partions".
    2. What is the AIX version you are trying to boot?
    3. Are you sure you are using my qemu branch and not the upstream one? The upstream qemu won't boot AIX/PReP at the moment.

    ReplyDelete
  136. I'm finding it doesn't find the CD-ROM....

    ReplyDelete
  137. Are you using my branch of QEMU or the upstream? What ISO are you using and what error do you get?

    ReplyDelete
  138. I've since upgraded computers and kind of forgot about this but I'm going to try on my new computer and see if it works

    ReplyDelete
  139. hi every one \
    please help me ...any one have aix 5.3,5.1,5.2,6.1,6.2,7.1 and 7.2 iso file please send me link for download
    i am learn aix
    my mail id : reddy.subbu999@gmail.com

    ReplyDelete
  140. Hello Artyom, I'm trying to install AIX 4.3.3 on Qemu 3.0.0 (I've chosen that since it works with Solaris 2.6).

    My command is the following:

    qemu-system-ppc -boot d -m 192 -M 40p -bios q40pofw-serial.rom -drive file=aix4.img,bus=0,unit=0,media=disk,format=raw -drive file=/opt/_daJD/Volume_1.iso,bus=0,unit=2,media=cdrom -vga none -nographic


    The error output, network settings or not, is the following:



    ok .partitions cdrom
    Partition Region Boot Format Size (MB)

    1 Primary Yes 0x96 630
    2 Primary Yes 0x41 3
    ok boot cdrom:2
    Boot device: /scsi/disk@2:2 Arguments:
    Rebooting in the correct mode for this client program ...

    Type 'i' to interrupt stand-init sequence
    First stand-init:
    Calibrate
    CIF buffers
    DHCP init
    memory node
    Instruction cache on
    Decrementer
    Enable machine check exceptions
    Set Memory Map
    MMU
    Root node
    Data cache on
    Fast CPU mode
    PCI host bridge
    CPU nodes
    PowerPC,604
    Initialize fixed vars
    Keyboard overrides
    Memory node
    ISA
    Power
    GPIO
    RTC
    MAC address
    The MAC address in the EEPROM is invalid
    NVRAM

    Nothing there
    Nothing there
    ethernet
    Nothing there
    scsi disk tape
    QEMU PReP/40p, Serial #0, 128 MiB memory installed
    Open Firmware, built April 13, 2019 09:29:23
    Copyright (c) 1995-2000, FirmWorks.
    Copyright (c) 2014,2017,2019 Artyom Tarasenko.

    Rebooting with command: boot /pci/scsi@1/disk@2,0:2
    Boot device: /pci/scsi@1/disk@2,0:2 Arguments:
    GPR0 00000000 2FF3AEC0 00245B50 D2182ABC 00000000 00000001 2F0B2A6A 00000000
    GPR8 3B9ACA00 FD2C4BFF 00000004 00000001 0002B28C DEADBEEF 00000004 2FF22E4C
    GPR16 2FF22E60 00000000 DEADBEEF DEADBEEF DEADBEEF DEADBEEF DEADBEEF 042C5610
    GPR24 00000001 0026DD10 00000001 00000000 869530B3 000DFA40 00000000 5001E080

    MSR 00021032 CR 24222442 LR 0002B28C CTR 00000000 MQ 00000000
    XER 00000008 SRR0 0002B24C SRR1 00021032 DSISR 42000000 DAR 00000000

    IAR 0002B24C (ORG+0002B24C) ORG=00000000 Mode: VIRTUAL
    0002B240 38A00001 4082FFAC 4099FF7C 0C870000 |8...@...@..|....|
    | tweqi r7,0x0
    0002B250 41850188 38A00000 0C850000 3C843B9B |A...8.......<.;.|

    |
    0002B240 38A00001 4082FFAC 4099FF7C 0C870000 |8...@...@..|....|
    0002B250 41850188 38A00000 0C850000 3C843B9B |A...8.......<.;.|
    0002B260 3000FFFF 3884CA00 7C030010 7C862010 |0...8...|...|. .|
    0002B270 480000F8 80030220 7C9F0040 41860148 |H...... |..@A..H|
    0002B280 93E30220 38610040 4BFDB1D9 801F0024 |... 8a.@K......$|
    0002B290 80610040 7C801800 41840018 809F0028 |.a.@|...A......(|
    0002B2A0 80C10044 4086FF60 7C043000 40800020 |...D@..`|.0.@.. |

    Illegal Trap Instruction Interrupt in Kernel
    >0>


    Where am I mistaken? Many thanks.




    ReplyDelete
  141. Update:

    1) Using Qemu 3.0.0 and Aix 5.1 the output is the following:

    AIX Version 5.1
    Illegal Trap Instruction Interrupt in Kernel
    .reset_decr+00014C twnei r5,0 r5=00000001
    KDB(0)>



    2) Using Qemu 5.1.0 (or 6.0.0) and Aix 5.1 the installation stops at:

    AIX Version 5.1


    and 8 minutes later is still there.

    ReplyDelete
  142. I'm EXTREMELY sorry, my insomnia doesn't help me: I didn't catch there is *your* custom branch to install.

    So, after finding the necessary information somewhere on the web and installing your "40p-20190406-aix-boots", both the AIX 5.1 and 4.3.3 installation succeded.

    Instead, using AIX 4.3.3 with the q40pofw-vga.rom bios it doesn't boot.

    Many thanks for your great work.

    ReplyDelete
  143. hi all,

    I've installed Artyoms build of qemu* and "my" AIX 4.3 / 5.1 boots fine.

    *) git clone \
    --branch 40p-20190406-aix-boots \
    --single-branch https://github.com/artyom-tarasenko/qemu.git

    But I always got this error message:
    ifconfig en0 192.168.0.22 netmask 255.255.255.0
    ifconfig: error calling entry point for /usr/lib/drivers/if_en: Cannot establish
    connection to a remote service.

    My qemu calling is:
    /usr/local/qemu.aix.q40/bin/qemu-system-ppc \
    -M 40p \
    -bios q40pofw-vga.rom \
    -hda root.qcow2 \
    -display gtk \
    -cdrom aix-4.3.3.iso \
    -prom-env "mac=12:34:56:78:00:00:00:00" \
    -net nic,macaddr=de:ad:be:ef:42:23 -net tap,script=no,ifname=tap0

    Of course I had tried the odmchange-hack described here, but without any success
    # cat > lance-chg.asc
    CuAt:
    name = "ent0"
    attribute = "busio"
    value = "0x01000000"
    type = "O"
    generic = "D"
    rep = "nr"
    nls_index = 3
    ^D
    # odmchange -o CuAt -q "name=ent0 and attribute=busio" lance-chg.asc
    # rmdev -l ent0
    # mkdev -l ent0
    # ifconfig en0 10.0.2.15

    Is it possible to use networking inside artyoms qemu verstion at all?

    ReplyDelete
  144. I think your parameter -prom-env "mac=12:34:56:78:00:00:00:00" doesn't make any AIX-visible effect.
    I haven't tested tap networking which you are using, but user mode networking worked just like described in the How-to. In the beginning of your message it complains about 192.168.0.22, later you use 10.0.2.15. Does it complain about 10.0.2.15?

    ReplyDelete
  145. Just wondering, if anyone thought about trying running it in the IBM official Power Simulator instead of the QEMU?
    https://github.com/open-power-sdk/power-simulator

    The scripts are running the linux image. But it should be possible to run AIX as well.
    After all, the mambo is used internally in IBM for the purpose.

    ReplyDelete
  146. Thanks for your response. I've checked some things again.

    (1) of course, 12:34:56:78:00:00:00:00 is not a valid mac address, mac addresses
    have 6 octets. But it makes no difference if I use this statement or not.

    (2) using 'user' mode instead of tap does not help. Even changing the IP address
    to the 10.x.x.x subnet makes no difference.

    I am afraid I did something terribly wrong, but what?

    Question to Artyom: Are there deep changes inside your build? I tried to build the official qemu version using soft mpu too - but without success.

    ReplyDelete
  147. Since people keep PMing me, I'll answer it here for everyone.

    Yes, this build is different from the upstream qemu version. You can see the exact differences in the commit history.

    No, the upstream qemu can not run AIX 4.x - 5.x.

    ReplyDelete
  148. Hello Artiom,

    I'm trying to run your 40p-20190406-aix-boots on Slackware 15.

    It builds with some warnings like: "taking address of packed member of ‘’ may result in an unaligned pointer value [-Waddress-of-packed-member]".

    After that, launching qemu-system-ppc I get the following error:

    qemu-3.0.92-40p-20190406-aix-boots/util/cacheinfo.c:179: init_cache_info: Assertion `(isize & (isize - 1)) == 0' failed.
    Aborted


    Any chances to fix that? many thanks.

    ReplyDelete
  149. Artyom, not Artiom. I'm _SO_ sorry.

    ReplyDelete
  150. I've found my mistake, thank you anyway.

    ReplyDelete
  151. It possible to use two network cards for AIX at the same time? How are the settings?(en0 , en1)

    ReplyDelete
  152. @AliReza, I haven't tried that, but it should work. Why do you want to have two cards?

    ReplyDelete
  153. I will try one Power PC Simulate the network with multiple cards.
    How much "value" should be? Is another change necessary?

    # cat > lance-chg.asc
    CuAt:
    name = "ent۱"
    attribute = "busio"
    value = ؟
    type = "O"
    generic = "D"
    rep = "nr"
    nls_index = 3
    ^D
    # odmchange -o CuAt -q "name=ent۱ and attribute=busio" lance-chg.asc

    ReplyDelete