Problems with APIC on QEMU

General discussion about Visopsys. We'll create more specific forums if the number of posts justifies that.
User avatar
andymc
Posts: 479
Joined: Tue Nov 16, 2010 7:20 pm

Re: Problems with APIC on QEMU

Post by andymc » Thu Dec 11, 2014 11:05 pm

That is perplexing. My Ubuntu 12.04 has the latest Qemu, but it says 1.0:

# qemu-i386 -version
qemu-i386 version 1.0 (qemu-kvm-1.0), Copyright (c) 2003-2008 Fabrice Bellard

Something funny is going on around here. The Qemu website says 1.0 was released in 2011. Perhaps the Ubuntu guys aren't updating it for 12.04.

User avatar
ronaldlees
Posts: 101
Joined: Tue May 20, 2014 5:19 pm

Re: Problems with APIC on QEMU

Post by ronaldlees » Thu Dec 11, 2014 11:41 pm

Hi Andy:

Yes, I think the Debian (and by heredity Ubuntu) distros tend to lag behind the current version of some apps like QEMU. Anyway, as I posted in another thread, I tried the latest ISO (2014-12-07) and it works fine with my QEMU 1.1.2 running on Debian Wheezy 7.5

Edit:
It looks like there are some intermittent issues, found on a second run. The system sometimes hangs as it did before.

User avatar
ronaldlees
Posts: 101
Joined: Tue May 20, 2014 5:19 pm

Re: Problems with APIC on QEMU

Post by ronaldlees » Fri Dec 12, 2014 12:55 pm

Andy:

It seems the kernel on the 2014-12-07 ISO is a release version? It'd be nice to have debug info on interim releases to help out with the debugging.

Code: Select all

$ gdb ./visopsys
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/body/visopsys...(no debugging symbols found)...done.
(gdb) 

- Ron

User avatar
andymc
Posts: 479
Joined: Tue Nov 16, 2010 7:20 pm

Re: Problems with APIC on QEMU

Post by andymc » Fri Dec 12, 2014 1:13 pm

Hi Ron, thanks for the updates. I downloaded the latest Qemu source last night, but deferred building it because I need to install more build tools (g++ for example). I put Xubuntu 14.04 (blech!) on my wife's laptop, so I'll see whether I can get that to download a newer Qemu package.

Yes, good point about the debug version - I guess I should make both available. I'll do that tonight (UK time) when I get home -- after the office Xmas party. Let's see if I remember! :lol:

User avatar
ronaldlees
Posts: 101
Joined: Tue May 20, 2014 5:19 pm

Re: Problems with APIC on QEMU

Post by ronaldlees » Fri Dec 12, 2014 1:23 pm

andymc wrote:...... I'll do that tonight (UK time) when I get home -- after the office Xmas party. Let's see if I remember! :lol:
Depending on the type of eggnog they'll have there?

LOL - Have fun at your party.

- Ron

User avatar
andymc
Posts: 479
Joined: Tue Nov 16, 2010 7:20 pm

Re: Problems with APIC on QEMU

Post by andymc » Sat Dec 13, 2014 10:47 am

Thanks Ron. As it turned out, I remembered but I was too sleepy.

Here are debug and release ISOs of my current 0.76 branch:
http://visopsys.org/files/visopsys/viso ... -debug.zip
http://visopsys.org/files/visopsys/viso ... elease.zip

User avatar
ronaldlees
Posts: 101
Joined: Tue May 20, 2014 5:19 pm

Re: Problems with APIC on QEMU

Post by ronaldlees » Sun Dec 14, 2014 2:52 pm

Many thanks Andy. Hopefully, I can muddle around in your modified kernel now, but with a little better map to see where I'm going!

User avatar
ronaldlees
Posts: 101
Joined: Tue May 20, 2014 5:19 pm

Re: Problems with APIC on QEMU

Post by ronaldlees » Tue Dec 16, 2014 3:18 pm

Ok, I went back and spent some more time with the Debian Wheezy Qemu setup. ISOs that work just fine on the FreeBSD host seem to hang on the Debian host. So, maybe it's some qemu issue, rather than a visopsys problem.

The way it hangs on the Debian/Qemu host is interesting. The screen gets to the point where it stops displaying kernel messages. The last message is typically "disk error" related, but not always. The thing is - that I can continue to single step the kernel at that point, and it seems to be in its normal kernel loop.

I lazily clicked along in the emacs debug console, watching it spin round and round through what seemed to be the regular kernel loop functions. Mainly, those functions were scheduler(), markTaskBusy(), kernelMemSet(), createNewProcess(), kernelSysTimerRead(), spawnIdleThread, kernelDebugOutput, kernelDetectBiosPnp, kernelInterruptHook, requestProcess(), kernelProcessRestoreInts(), kernelProcessInterrupts(), chooseNextProcess, and a few others.

So, I guess it just missed the creation of some process, and sits there spinning wheels, with no GUI activity, no display other than the kernel messages, and no response to mouse, keyboard, etc. Or, interrupts have been turned off at that point? Once I understand the call sequence better, maybe I can determine if that is so.

Anyway, I'm getting a feel for the basic kernel loop, if nothing else. Also at the same time getting an appreciation for what Andy has put into this OS! I'm wondering if I could recompile the kernel with the -pg option and get a little better understanding of the kernel's internal machinations. This is WAY too much fun! The OS works almost perfectly on the FreeBSD/Qemu host.

Update:

- The C library needs to implement "mcount()" in order to use the -pg profiling options. It probably would be necessary to implement other functions to display the info collected.

- I installed Qemu on the Haiku operating system and was able to run Visopsys-0.74 on it. On the same Haiku Qemu setup, the APIC enabled Visopsys "seems" to hang, as described above.

User avatar
andymc
Posts: 479
Joined: Tue Nov 16, 2010 7:20 pm

Re: Problems with APIC on QEMU

Post by andymc » Mon Apr 13, 2015 1:59 am

Sigh :(

After considerable effort, I was able to build and install the latest Qemu

Code: Select all

QEMU emulator version 2.2.1, Copyright (c) 2003-2008 Fabrice Bellard
but I can't reproduce the error. I tried my current code (0.8 branch), the pending 0.77 release, and the previous 0.76 release. They all loaded and ran perfectly.

I used these commands:

Code: Select all

qemu-img create -f raw visopsys.img 1G
qemu-system-i386 -hda visopsys.img -cdrom <my .iso file> -boot d
can anyone else maybe try this latest version of Qemu with 0.76? Perhaps the Qemu guys have fixed something?

This is the last item on my list before releasing 0.77. I was really hoping I'd be able to reproduce this.

User avatar
andymc
Posts: 479
Joined: Tue Nov 16, 2010 7:20 pm

Re: Problems with APIC on QEMU

Post by andymc » Tue Apr 14, 2015 12:30 am

Ok, I got Qemu 2.0.0 and 2.1.0, and I think I see the problem now. It does boot, but the IDE driver seems to struggle receiving interrupts (Ron, I remember something you posted, stepping through waiting for ATAPI interrupts)

Post Reply