PE machine definitions

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
kerravon
Member
Member
Posts: 316
Joined: Fri Nov 17, 2006 5:26 am

PE machine definitions

Post by kerravon »

As you may or may not know, Microsoft Windows is available for both ARM and x86 - and indeed, both platforms allow both 32-bit and 64-bit programming with small executables using msvcrt.dll for the C runtime library.

And PDOS-generic (at pdos.org) provides a mini Windows clone of all 4 of those environments.

Even though Microsoft may not be interested in porting their version to the 68000 or mainframe (S/370 or z/Arch), I am, and I would like to have official machine definition numbers for this field:

https://learn.microsoft.com/en-us/windo ... /pe-format

e.g.

IMAGE_FILE_MACHINE_AMD64
0x8664
x64


I need 32-bit 68000 and 32-bit S/370 and 64-bit z/Arch

I note that the UEFI spec uses PE too, so I was wondering if they were (now?) the official body that assigns numbers rather than Microsoft.

Either way I am reluctant to click on the UEFI spec which says "by clicking on this you agree ..." and prefer to keep a distance from them for (at least attempted) clean-room purposes.

I am happy to email them though, if the numbers don't already exist.

Any idea what the situation is? ie who controls number assignment?

Thanks. Paul.
User avatar
bellezzasolo
Member
Member
Posts: 120
Joined: Sun Feb 20, 2011 2:01 pm

Re: PE machine definitions

Post by bellezzasolo »

kerravon wrote: Thu Jul 03, 2025 11:04 pm As you may or may not know, Microsoft Windows is available for both ARM and x86 - and indeed, both platforms allow both 32-bit and 64-bit programming with small executables using msvcrt.dll for the C runtime library.

And PDOS-generic (at pdos.org) provides a mini Windows clone of all 4 of those environments.

Even though Microsoft may not be interested in porting their version to the 68000 or mainframe (S/370 or z/Arch), I am, and I would like to have official machine definition numbers for this field:

https://learn.microsoft.com/en-us/windo ... /pe-format

e.g.

IMAGE_FILE_MACHINE_AMD64
0x8664
x64


I need 32-bit 68000 and 32-bit S/370 and 64-bit z/Arch

I note that the UEFI spec uses PE too, so I was wondering if they were (now?) the official body that assigns numbers rather than Microsoft.

Either way I am reluctant to click on the UEFI spec which says "by clicking on this you agree ..." and prefer to keep a distance from them for (at least attempted) clean-room purposes.

I am happy to email them though, if the numbers don't already exist.

Any idea what the situation is? ie who controls number assignment?

Thanks. Paul.
Pretty academic, as the UEFI spec defines calling convention etc, but in fact is only defined for a subset of the architectures listed under the PE format.

Code: Select all

// PE32+ Machine type for EFI images
#define EFI_IMAGE_MACHINE_IA32 0x014c
#define EFI_IMAGE_MACHINE_IA64 0x0200
#define EFI_IMAGE_MACHINE_EBC 0x0EBC
#define EFI_IMAGE_MACHINE_x64 0x8664
#define EFI_IMAGE_MACHINE_ARMTHUMB_MIXED 0x01C2
#define EFI_IMAGE_MACHINE_AARCH64 0xAA64
#define EFI_IMAGE_MACHINE_RISCV32 0x5032
#define EFI_IMAGE_MACHINE_RISCV64 0x5064
#define EFI_IMAGE_MACHINE_RISCV128 0x5128
#define EFI_IMAGE_MACHINE_LOONGARCH32 0x6232
#define EFI_IMAGE_MACHINE_LOONGARCH64 0x6264
Whoever said you can't do OS development on Windows?
https://github.com/ChaiSoft/ChaiOS
User avatar
iansjack
Member
Member
Posts: 4814
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: PE machine definitions

Post by iansjack »

There is a type for the Motorola 68000 (0x0268) but not, apparently, for the IBM mainframes. Your best bet is to use "Unknown architecture" (0x0000).

https://github.com/torvalds/linux/blob/ ... linux/pe.h

I'm honestly surprised, with your passion for public domain, that you use Microsoft's executable file format.
Post Reply