Page 1 of 1
QEMU questions
Posted: Mon Nov 21, 2011 4:03 pm
by DavidCooper
I haven't asked about this before because no one else appears to have any difficulty with QEMU, so I just gave up on it and stuck to using Bochs and real machines. To start with, I managed to download QEMU from the official site and found a program capable of extracting it first from .gz and then .tar, but that was as far as I could get - it looks as if you need to compile it, and that goes beyond my knowledge. I'd have asked if anyone can provide the missing instructions at the QEMU forum, but the links to it are all dead. I downloaded another version that sounded as if it would work straight out of the box, but again there were no instructions, and all attempts to run it resulted in a console box appearing for a fraction of a second before disappearing again. The third version I downloaded came from
http://www.davereyn.co.uk/about.htm - it's easy to use and I managed to get it to run my OS without difficulty, though the Del, Ins and cursor keys didn't work, seemingly because the 224 prefixes (E0h) aren't getting through. I've tried it with Karlosoft's bootloader and the same keys fail to work, so it looks as if there's either a fault with that version of QEMU or there's some hidden setting that I'm failing to find which will correct it.
So, my questions:-
(1) Is there a simple setting I should be adjusting that would cure the keyboard problem?
(2) Am I using version of QEMU which should be avoided?
(3) Is there a set of instructions available anywhere which explains how to turn the downloaded version of QEMU from the official site into something that runs?
Re: QEMU questions
Posted: Mon Nov 21, 2011 4:57 pm
by turdus
Code: Select all
$ tar -xzvf qemu.tgz
$ cd qemu*
$ ./configure
$ make all install
?
Re: QEMU questions
Posted: Mon Nov 21, 2011 5:46 pm
by DavidCooper
turdus wrote:Code: Select all
$ tar -xzvf qemu.tgz
$ cd qemu*
$ ./configure
$ make all install
?
It may well be that easy, but I don't even know where to type that in. I've never compiled or assembled anything in my life (edit: an exception being a little experiment with C++, but that was a simple program which was compiled at the press of a button and I didn't need to know anything to be able to do it) - all I've ever done is write a program in Qbasic to poke machine code instructions into memory and run them, gradually building up an OS from there by talking to the FDC chip and eventually creating something that could be booted from a floppy and which could modify and save itself. From that point on, I've never used any outside software for building my OS (with the exception of a tiny part which I built within Bochs while trying to make it fully Bochs-compatible).
berkus wrote:turdus wrote:Code: Select all
$ tar -xzvf qemu.tgz
$ cd qemu*
$ ./configure
$ make all install
?
Now perform all that elegantly on Windows!
So does that mean it isn't likely to happen on Windows?
David, your bestest bet would be to install Ubuntu and install Ubuntu-provided binary packages. I think that should be the easiest way out there to get a tested working qemu setup fast.
You can always install Ubuntu in a VM
That sounds as if it's going a bit far - I've got no machine I can install Linux on without messing up something important, and I don't want to fiddle around trying to install it within a faulty VM either. I've got a version of QEMU which seems to be working apart from the keyboard problem (time will tell), but I can easily modify my OS to work without expecting the missing E0 prefixes. What I most wanted to know was if I was being thick in missing some setting that would cure the keyboard problem directly (and plugging in a USB keyboard made no difference, I should add). I'm prepared to put up with that fault if it turns out that there isn't a more serious problem, so I think I'll just keep working with it and see if I can get it to work sufficiently well in ARM mode for me to experiment with an ARM version of my OS (though I'm still at the stage of studying the instruction set).
Edit: I'll try installing it on another machine to see if it's just a hardware problem.
Re: QEMU questions
Posted: Mon Nov 21, 2011 9:20 pm
by Brynet-Inc
DavidCooper wrote:I haven't asked about this before because no one else appears to have any difficulty with QEMU, so I just gave up on it and stuck to using Bochs and real machines. To start with, I managed to download QEMU from the official site and found a program capable of extracting it first from .gz and then .tar, but that was as far as I could get - it looks as if you need to compile it, and that goes beyond my knowledge.
Yes, it is normal for a project to release only a source tarball.
Most operating systems usually have their own package management facilities, they deal with packaging and distributing binaries for end users..
Binaries for Windows are usually compiled by some random individual and quickly become outdated.
DavidCooper wrote:I downloaded another version that sounded as if it would work straight out of the box, but again there were no instructions, and all attempts to run it resulted in a console box appearing for a fraction of a second before disappearing again.
QEMU use SDL for the VGA display and keyboard input, however, you must run it from a command line. There is documentation on their website, there is some help text in the executable itself, and there is a manual page included.
Looks like a GUI wrapper around the command line program, do you really need to use such a thing?
Re: QEMU questions
Posted: Tue Nov 22, 2011 3:52 am
by Solar
DavidCooper wrote:(3) Is there a set of instructions available anywhere which explains how to turn the downloaded version of QEMU from the official site into something that runs?
The first place to look would be a file named "README.txt" or "README" in the top level directory. Further choices would be "INSTALL.txt" or "INSTALL", or anything contained in a directory named "doc" or "docs".
The QEMU tarball comes with a file README:
Read the documentation in qemu-doc.html.
Fabrice Bellard.
The tarball I got doesn't have the HTML docs, only the .texi source, so I googled for "qemu-doc.html" and, after navigating around the apparently unavailable wiki.qemu.org domain, came up with
this link. The docs link to an "experimental binary installer" (which I was unable to retrieve), but also lists detailed instructions for
how to compile under Windows.
Not surprisingly, it requires either a MSYS or a Cygwin environment. David, I am afraid you get only so far in development work without familiarizing yourself with a Unix command line and its tools.
Re: QEMU questions
Posted: Tue Nov 22, 2011 6:42 am
by turdus
DavidCooper wrote:
It may well be that easy, but I don't even know where to type that in.
At cygwin shell prompt, maybe?
http://www.cygwin.com/
Download and install it, and you'll have a native win application that provides similar prompt to linux (including bash, gnu make, gcc, etc.). The compiled file will be a native windows executable.
Re: QEMU questions
Posted: Tue Nov 22, 2011 6:57 am
by Solar
Unfortunately it's not quite as easy as that, since the QEMU ./configure insists on using the -mno-cygwin option. You can get around this - by installing a MinGW toolchain in Cygwin and setting that as compiler for ./configure - but that's not something I'd recommend for a bash newbie to try.
Re: QEMU questions
Posted: Tue Nov 22, 2011 2:09 pm
by Kevin
There are unofficial binary builds for Windows on
http://qemu.weilnetz.de/
Re: QEMU questions
Posted: Tue Nov 22, 2011 2:37 pm
by DavidCooper
Thanks for all the suggestions and links. I've tried it on another machine and the keyboard input problem is identical, but I'm going to keep working with the "faulty" version for now (which may not be faulty at all - I may just be doing something wrong) - I've adapted my OS to work without expecting cursor key prefixes and everything else seems fine, but if I run into any impossible problems with it, at least I now know what to try next, starting with Solar's suggestions (don't worry - I'll get a programming friend to help me with it the next time one of them's in the area).
Brynet-Inc wrote:Looks like a GUI wrapper around the command line program, do you really need to use such a thing?
At the moment, it seems to be the only way I can get into Qemu at all, but it is certainly well designed and convenient.
Edit: I've just downloaded an older version of Qemu Manager (
http://www.davereyn.co.uk/download.htm) which uses an older version of Qemu, and there is no keyboard input problem with it whatsoever. Better still, it actually fits properly on the screen of a Netbook. For anyone else having difficulty getting started with Qemu, this really does make it easy: Qemu Manager v6.0 (April 2009) with Qemu 0.10.2 and KQEMU Support (I went for the one that can be run from a USB drive).