Where Can i find an emulator to test my operating system for ARMv8? - operating-system

I am currently writing an OS based on ARMv8 processor. I want to find an emulator that acts like the processor so I can see my OS working or not and to check my work.
I am on windows 10. are there any emulators recommended ?
I searched SO but no answer. thanks.

Looks like QEMU version 2.1+ is what you want
the latest version of upstream QEMU (2.1) now includes full ARMv8 system emulation support. This means that users can use upstream QEMU to run a full 64-bit ARMv8-A kernel and filesystem, such as a 64-bit Ubuntu cloud image. This was no small endeavour as it involved emulating a completely new instruction set, exception model, CPU implementation, and more. The implementation was verified with a custom instruction verification tool (RISU) and was heavily reviewed upstream by an engaged and incredibly supportive upstream QEMU community.
source

Related

How to cross-build a debian package for Raspberry Pi OS 64 bit

I have a working debian package that I'd like to backport to the current version of Raspberry Pi OS 64 bit (not 32-bit Raspbian).
Confusingly, while Debian itself seems to be robust about enabling cross-builds in their own package, there seems to be much less official documentation about how raspberry Pi OS (64 bit) packages are built¹.
Since I'm relatively certain this should be possible, I ask:
How to take a debian .dsc / debian rules, and build, on an x86_64, a 64 bit Raspberry Pi OS 64-bit compatible image
without using QEMU to actually build the image on arm64, without access to an actual RPi,
using an existing debian package that is known to work on sid on aarch64, and should be backportable,
making sure it's actually built against the correct set of Raspbian dependencies.
I'm guess this is a rather standard thing, I just don't know how to do it. I'm happy with using containers and similar technology, as I can easily integrate that with CI.
I do not plan to use an Arm64 VM, as the software in question takes about an hour to build and test, on an x86_64 server, natively.
¹I've talked to plugwash of Raspbian fame, and as earlier versions of this question showed: there's significant confusion about the heredity of Raspbian OS 64 bit: It's not Raspbian nor based on it. But people including Wikipedia and the RPi Foundation themselves conflate Raspberry Pi OS and Raspbian ("Raspberry Pi OS, formerly Raspbian"), which is 32 bit only.
RaspberryPi documentation here has explained how to build the x64 kernel from the source. What you want is in a way exactly like that.
Notice this line on the Kernel building page:
sudo apt install crossbuild-essential-arm64
This command on your Linux host machine installs a compiler that runs on an AMD64 machine but produces a binary that runs on an ARM machine.
And this line tells the compiler to actually build the source for that architecture:
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image modules dtbs
Image modules dtbs are specific to your project. they may differ.
As for your Debian package, there is no way that you can transform an AMD64 package into an ARM one. Your package for the RaspberryPi if doesn't exist in an official or some third-party repository, must be built from the source.
Find the source code of your package and build it very similarly to RaspberryOS.
If your Package has dependencies it gets a little more complicated. First, install the dependency on your RaspberryPi. Then you should set up a sysroot on your host machine which is basically a mirror image of the preinstalled packages on RaspberryPi. Then for compiling your package you should give the sysroot address to cross compiler so that it can find dependencies.
There is another way too, you can put the source code of your package on your RaspberryPi and build it locally which can take a very long time based on the source code. Just to have a sense, Qt source code without WebEngine module took 48h for me. But Qt is big.
In conclusion, if your package binary is not on any repository you must compile it from the source.
Cross-compilation of different projects and executables are very similar to each other. To have a clear understanding of the process it can be beneficial to look for some other projects that were ported to RaspberryPi OS. Things like Qt, TagLib for android, and ...
First, I would take a look here:
https://github.com/Truelite/qt5custom for inspiration. I checked and those scritps work. However, you might have problems going completely „qemuless”; e.g. in case of QT some libraries needed to be added to host machine sysroot and qemu was simply the easiest way to add them properly: it seems to me that multiarch Debian has some deficiencies in the field of cross-compilation and the simplest way to overcome them is to pretend it’s the native one.

Is running a Windows on mac the same or very close to running windows traditionally?

It's been my understanding the OS sits on top of the hardware. Is it more or less the same to run windows from a macbook? When installing SQL on a windows partition, does this install similar to an all Windows setup?
I've heard the kernel is the main connector between hardware and basic OS, so would the mac kernel cause potential differences in operation?
Would installing the linux OS also adhere to these rules?
Thanks, and sorry for the simple question.
Generally, you are correct to say that, installing different operating systems on the same hardware would be the same. You will be able to both install Windows and Linux on the same laptop (whether that would be an Asus brand laptop, or HP, or whatever). Once you install an OS on some hardware, and the OS is able to recognize the hardware, and is able to utilize it, then you are in the clear. What's important is to install on OS that is compatible with the architecture of the computer. So if you get a Linux distro that supports x86 architecture, then you would have to install it on hardware that is with a x86 architecture.
Side note: Modern OS's are very smart and they have a wide range of architecture support (list of Linux architecture support, Windows support for ARM, Apple also has a wide range of architecture support).
Since you are asking about a macbook and Windows, then the short answer is: there won't be a problem for you to install Windows on your mac. Apple even gives you Boot Camp to easily do this (there are also quite a bit of recent tutorials on this topic as well).
So the end experience would be almost the same as having Windows on any other machine.
I've heard the kernel is the main connector between hardware and basic OS, so would the mac kernel cause potential differences in operation?
This is true. The kernel is the heart of any OS, but once you have your Windows running, it would be using its own heart and it won't touch the mac kernel. So if you remove your macOS and install only Windows, then only the Windows kernel would be taking control of the Mac hardware. But if you load your macOS, then the Mac kernel would be running and operating on the hardware.
Will Windows run faster on Mac hardware than macOS on its hardware? It's debatable and I would assume not a lot of studies have been made in that sphere. But, at least, it will run.
But what about dual-booting your macbook with Linux? Technically, it is possible (and the principle is the same), but Apple have made restrictions to their firmware, limiting the option of having both a macOS and a Linux distro at the same time. What's so different here than the case with Windows? Well mainly that the firmware of the macbook (the software embedded in the hardware of the laptop) doesn't allow for Linux to be installed. Maybe things have changed, but these are the (not so recent anymore) news I know about (I guess there are still ways of installing Linux on mac hardware).

How to compile c/cpp code for target Solaris 64bit SPARC from linux/windows

I want to compile a customized Apache module for OHS on Solaris 64bit SPARC machine. It is a Apache C code. But what I have is only Windows machine and Linux VMs. Can this achieved using Oracle developer studio IDE. Or is there any other way? Please help
You can use QEMU and run a SPARC virtual machine under emulation:
Status
The table below gives the status of the SPARC machines available in
QEMU and is correct as of the latest release:
Machine Status
sun4m Complete, supported
sun4u Beta, supported
sun4v Incomplete, unsupported
niagara Complete, supported
Pay particular attention to the exact architecture you need to compile for. You should be able to run Oracle Developer Studio on the emulated system. You may have to use an older SPARC architecture to generate binaries runnable on your target systems. For example, you might want to use something like -xarch=sparcv9.
Note that the emulated system will be S-L-O-W. Large compiles can take hours or even days. You should probably develop your Solaris-specific code on an x86 VM, and only do the final SPARC compile on the emulated system. Just be aware that you can get away with strict aliasing and alignment violations on x86 systems that will throw a SIGBUS on SPARC systems.

Building Darwin 16.6 from source?

Put succinctly I need a base for my system, since it was built on macOS Darwin seems like the logical choice as it will require the least porting effort. I know you can download up to Darwin 8.0.1 from Apple, and the full source tree is available for up to 10.0, however v8 is too old and lacks many standard modern features (i.e. a password system that doesn't restrict the root user to 10 characters, or support for the case-sensitive version of HFS+). I've tried building Darwin 9/10/11/12 from source using darwinbuild, but it always fails for various server-side reasons.
There has to be some way to create the equivalent of a vanilla Darwin 16 image. Perhaps taking an existing copy of macOS and stripping away all the closed-source stuff? Building the source that Apple provides at Apple Open Source Repository and substituting the rest of the packages required for the OS to function with source from another BSD distro? Taking an existing copy of FreeBSD and substituting the kernel with XNU? There has to be some way. Any ideas or thoughts on the ideas I suggested are welcome. Thanks.
The last xnu build instructions are for El Capitan (Darwin 15) but you might be able to follow them for Sierra (Darwin 16). The latest source available at time of writing is for 10.12.4, which isn't overly out of date.
This gets you most of the kernel of shipping macOS. It doesn't get you the driver stack - especially the SATA/AHCI stack is not open source, which could be a problem. (One of these days I'll get around to publishing our full virtio driver stack including virtio-blk and virtio-scsi drivers, with which you should be able to run without SATA in Qemu/KVM at least.)
I have no idea about getting a useful userland going - macOS/OSX uses launchd as its "init" process, and the last published source code for that is some years old. I don't know if it will need some tweaking to get it working on newer kernels.

Windows Phone 7 emulator on a VM?

It seems that the Windows Phone 7 SDK doesn't support running inside a VM. On Parallels, the entire VM simply crashes when the emulator is starting up.
Around the web, though, a few people have reported that they were able to use it by changing a lot of the VM settings.
What do I have to change to be able to run it? I'm specially interested in Parallels, but VMWare or any other simulator that run on OSX if fine for me!
The WinPhone7 (and WinPhone8) emulator is itself a VM and few (if any) general-purpose VM's will host another VM infrastructure, which is why it crashes Parallels etc.
If you want to have the emulator run from within a different VM to the one MS provides, then you're into the realm of extracting images, toggling bits and trying to tack it into your VM of choice. Of course, the chances of the emulator then working as expected with no residual issues is as close to nil as makes no difference ;)
[Update 2013-01-30] VMWare5 & Parallels Desktop 8 now support running Hyper-V guest VM's. This is particularly useful for those wanting to develop against the Windows Phone 8 SDK which runs Windows Phone 8 guest VM's on Hyper-V.
Here's a guide to how to run Visual Studio 2012 & Windows 8 SDK (inc. the Windows Phone 8 Hyper-V-based emulator) in VMWare5 or Parallels desktop 5: Link
Note: Running Windows & Hyper-V inside a VM will be slower than running natively. Dual-booting into Windows (using Boot Camp on OSX) is stil the recommended method of developing for the Windows platform, especially if you want to use Hyper-V guest VM's.
I'm working in VMware Fusion with Expression Blend 4 RC AND the emulator.
works like a charm!
As others have said, WP7 is itself a virtual machine. Even if you can get it to run inside a virtual machine like Parallels, the performance will be abysmal. If your computer supports hardware virtualization, the emulator runs really smooth, without it it's very very sluggish. Running it inside another VM will make it even more sluggish - I am guessing to the point that it's unusable.
I know this is not the answer you want to hear, but I would recommend running Windows in Bootcamp, you will have much better experience developing and emulating.
I'm not so sure about compatibility for long term development, but in last september, I remembering trying the Windows Phone 7.1beta SDK on VirtualBox (I'm using mac SL), a free virtual machine from oracle (previously by Sun) and it works well there.
I just do a regular install of Windows 7 Home Basic (any Win7 except Starter will do, CMIIW) in the VBox with no tweaking at all, install the GuestAddition inside win7 (provided by VBox), then install the SDK. I create new WP project, arrange UI, make some codes as usual, then run it in emulator. Surprisingly, the emulator works fairly well and showing the app I've developed.
I'm not even experience any lag (my macbook is i5, 4GB ram, the VBox setting is dual core, 2GB ram, note that no other heavy mac process is on the run, so I solely run the VBox ... and iTunes for listening musics).
So if you still want to try WP SDK 7.1 on VM, why don't you try VirtualBox? My current VBox is installed with Windows 8 and have no extra space to reinstall the win7+WPSDK. If you do give a try on VBox, please report the result here to inform everyone.
I've run the Android emulator inside a VM before. It was slower, but still usable to test basic apps. Also, the Android emulator was then slow to where you couldn't tell a difference from between native or from within running Eclipse from within a virtual machine running Linux
x86-to-x86 emulation tends to be pretty fast nowadays due to both Intel and AMD CPUs having hardware to help it along. A lot of x86-to-x86 emulation also doesn't do a full emulation (see Android's emulator to see how a full emulator runs in comparison). In the x86-to-x86 case, the faster ones will try to pass as many instructions to the host OS so that a chunk of the code runs natively
People have made claims like 80-95% performance, which is pretty good. If you have a 3.2 GHz CPU, you get knocked down to around a 2.4 GHz equivalent of your CPU. That's not bad at all, and I honestly don't notice that much overhead running in a good x86-to-x86 VM
The biggest reason why the WP emulator has problems with VMs doesn't have to deal with it being a VM-in-a-VM, but it's most likely that it requires DirectX 10. This might have to do with XNA, which is Microsoft's really nifty gaming API that lets you easily port between Windows, WP, and the Xbox 360. A lot of VM programs don't support hardware 3d acceleration
On another note: if you want to use a low-end system, AMD CPUs may fare better since AMD doesn't tend to disable hardware virtualization features in their lower-end CPUs
If you're deploying to a device, you should be able to use a VM, since it's the emulator that has issues being a VM itself.
We have successfully deployed, and performance is acceptable in our environment, virtual Windows 8.1 Pro Desktop under VMware vSphere 5.5 (ESXi 5.5), and have the Windows 8 SDK and Emulator working correctly with no performance issues. (In Education - to University Labs for Windows Phone development).
The issue experienced by most, is you most have the Hypervisor pass through the Intel-VT into the VM, to effecticely create Nested Hypervisors. This is possible using VMware vSphere 5.5.
This option is available in virtual machine version 10, enabled in the vSphere Web Client - Enable Hardware Virtualisation.