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 5.1 under QEMU

It looks like the PCNet driver (aka kent) is broken in AIX 5.1. I think the "busio" value used to look different in the previous versions. The networking can still be set up. 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 a previuos version, before changing the busio, have a look it you have to:

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 2019.04.13

94 comments:

GeoKM said...

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.

atar said...

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

Alexander Shukin said...

Спасибо огромное! Великолепная работа!
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, впрочем, для других машин уже.

GeoKM said...

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.

Alexander Shukin said...

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.

Alexander Shukin said...

MacOS 10.13.1, correctly

atar said...

@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?

atar said...

@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.

GeoKM said...

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.

Casey Jones said...

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.

atar said...

@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.

Alexander Shukin said...

@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.

Casey Jones said...

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

Alexander Shukin said...

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)))

atar said...

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

Casey Jones said...

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

Casey Jones said...

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

Casey Jones said...

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

Alexander Shukin said...

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)

Alexander Shukin said...

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)

Alexander Shukin said...

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:-)

Casey Jones said...

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

atar said...

@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?

atar said...

@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.

atar said...

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.

Anonymous said...

This is impressive, thank you!

Casey Jones said...

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

Alexander Shukin said...

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:-))

Alexander Shukin said...

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.

atar said...

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?

Alexander Shukin said...

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

atar said...

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.

Alexander Shukin said...

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 :-)

atar said...

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

Alexander Shukin said...

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

Alexander Shukin said...

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.

atar said...

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.

Casey Jones said...

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

Casey Jones said...

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

Casey Jones said...

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

Casey Jones said...

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

atar said...

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.

Alexander Shukin said...

@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.

Alexander Shukin said...

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:-)

Casey Jones said...

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

Thanks - Regards Casey

atar said...

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

boot cdrom

atar said...

@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.

Casey Jones said...

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

Casey Jones said...

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

Alexander Shukin said...

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

atar said...

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

Alexander Shukin said...

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

Alexander Shukin said...

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.

atar said...

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.

Alexander Shukin said...

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.

Alexander Shukin said...

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.

atar said...

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

Alexander Shukin said...

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:-).

atar said...

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.

Alexander Shukin said...

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

atar said...

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

Casey Jones said...

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.

atar said...

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

Alexander Shukin said...

Looks like the link for FW is broken&

Alexander Shukin said...

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

Alexander Shukin said...

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!:-)

atar said...

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

Alexander Shukin said...

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>

Astr0baby said...

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.

Astr0baby said...

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

Casey Jones said...

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

Alexander Shukin said...

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.

Alexander Shukin said...

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

atar said...

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.

Astr0baby said...

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.

Alexander Shukin said...

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

atar said...

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

Alexander Shukin said...

Didn't know). Now 4

Jason Stevens said...

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

Marlon José said...

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

Alexander Shukin said...

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

Marlon José said...

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

atar said...

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.

Marlon José said...

atar,

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

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

atar said...

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.

Marlon José said...

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.

atar said...

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.

Marlon José said...

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).

Astr0baby said...

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

Alexander Shukin said...

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

crnimrki said...

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.

Alexander Shukin said...

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.((

atar said...

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.

Weizhong Gong said...

Is this model of VM only 32bit machine?