rwgast
Posts: 31
Joined: Sat Feb 18, 2012 10:26 pm
Contact: Website

Re: Using Qemu for my own OS and Porting projects?

Tue Feb 28, 2012 8:59 pm

Ok so im a bit worried I may not get PI, well see though. Anyways I really want to do a Linux From Scratch build for it. Im also interested in the PI for doing things like writing a PET OS and porting other operating systems.

I have never used Qemu, Ive tried Bochs with no luck. But im under the assumption it is just a machine emulator right? So can I somehow set the Qemu parameters for a PI and boot up an empty machine? Would I just use the command line people are using for debian with my own image file? What is the easiest way to make a Qemu image?

rwgast
Posts: 31
Joined: Sat Feb 18, 2012 10:26 pm
Contact: Website

Re: Using Qemu for my own OS and Porting projects?

Wed Feb 29, 2012 1:41 am

no Qemu experts here to point me in the right direction? Well heres hoping i get real hardware.

Newbie
Posts: 17
Joined: Tue Mar 06, 2012 8:00 am

Re: Using Qemu for my own OS and Porting projects?

Tue Mar 06, 2012 9:07 pm

QEMU is basically a boot environment tool traditionally used to establish an execution environment compatible with a given hardware platform (x86, ARM, Power, SPARC, etc.) that will allow an OS to boot and run as an instance on top of another OS that has already booted and is executing.  The hosted (secondary booted) OS typically accesses the foreign physical hardware through services provided by the host (initially booted) OS.  In this way, one can boot and run a variant of Linux as if it were an application running on top of Windows, or one Linux variant on top of another.  It's also possible to boot a Linux variant that runs on a completely different hardware architecture than the host OS, and there can even be multiple OSes layered on top of each other.  The latter is how the R-Pi emulator boots and runs Debian in emulation on a virtual ARM processor, on top of Ubuntu running on top of Windows on x86 hardware.  The same can be possible for running Fedora, ArchLinux, Puppy, etc., within an emulator.  When we're running on the R-Pi hardware, however, we won't need QEMU to run an emulator - we'll be running directly on ARM/GPU processor hardware.

There are literally an infinite number of options for bringing up an OS on the R-Pi.  The Linux variants that are being ported (Fedora, Debian, and ArchLinux, plus others being considered/started, e.g., Puppy, etc.) each have an ARM-compatible kernel that boots along with a binary "blob" that contains pre-compiled proprietary code for accessing the Graphics Processing Unit (GPU).  In fact, the GPU actually boots directly from the SD card using the blob and kernel files on the card, and then brings up the ARM CPU as what essentially is a glorified "traffic cop" that manages data movement between the CPU, I/O devices (USB, Ethernet, SD card, video, audio), and the GPU.  The CPU also performs the more traditional logical and integer arithmetic functions (e.g., execution of control code that doesn't deal heavily with graphics, audio, floating-point arithmetic, matrix math, etc.).

So, if your OS is just going to do the relatively straightforward job of control code execution and non-graphic/audio I/O, you can build a simple OS from existing source and/or your own code.  You will still need to interface with the blob during boot-up since that's how file I/O is apparently accomplished to some level through the GPU (my guess is because the purpose of this CPU/GPU system-on-a-chip (SoC) is primarily for graphics and audio processing in media center kinds of applications, and getting file code and data to and from persistent storage is most important to keep the GPU as busy as possible).  Looking at the source for the kernels being ported would probably be the best way to get an idea of how to interface with the blob, since we don't (and won't) have access to the blob source, and the R-Pi team do have access to the proprietary info (at least to some degree) in order to aid in kernel and OS porting.

I hope this oversimplified explanation is of some use to you, and I'm sure the R-Pi team could explain this differently, if not also better.

tufty
Posts: 1456
Joined: Sun Sep 11, 2011 2:32 pm

Re: Using Qemu for my own OS and Porting projects?

Tue Mar 06, 2012 10:07 pm

Have a poke around in my .sig

Simon

Return to “Other projects”