Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to detect ARM architecture from iPXE script?
2018-10-26, 22:05
Post: #4
RE: How to detect ARM architecture from iPXE script?
(2018-10-26 21:38)korekhov Wrote:  Well, just as that page says, "buildarch" is not a running arch, but where it was built. Not what I'm looking for. I need to detect actual platform where my iPXE script runs.
Is that possible?

"CPU architecture for which this version of iPXE was compiled" not "where it was built" - what makes you say this?

It matches the arch part of the build command, as described in ipxe.org/appnote/buildtargets

If your iPXE is built for arm64 - it will be running on arm64 since it can't run on arm32, I'm not sure if you can run arm32 code on arm64, if you can then you will need to resort to cpu checks for that one case.

For x86, just as that page says, you will need to check cpuid if you have an i386 build to see if it is running on 64-bit hardware.

Code:
set arch ${buildarch}
# if running 64-bit builds then the CPU must be 64bit capable.
# so only check cpu capability on 32-bit builds
iseq ${arch} i386 && cpuid --ext 29 && set arch x86_64 ||
iseq ${arch} arm32 && (something magic here) && set arm64 ||

I do not know what is needed to detect arm64, so that needs some expertise from elsewhere.

Use GitHub Discussions
VRAM bin
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: How to detect ARM architecture from iPXE script? - NiKiZe - 2018-10-26 22:05



User(s) browsing this thread: 1 Guest(s)