andymc wrote:Alright, I did get Qemu up and running. There are some seemingly-harmless error messages from the RTC driver, but the APIC code seems alright now.
The problem was related to prioritizing multiple interrupts-in-service, for anyone who's interested in that level of detail
Hi Andy:
I've had to do some traveling, and don't currently have access to my dev machine. But, I'll try the new APIC code as soon as I can. I concur with NextVolume that it would be great to have a .76 release with some of the most recent improvements.
Glad you got your QEMU running. I wonder if you've been using GDB on your QEMU instance? I guess you're not that much in favor of interactive debugging, so you likely follow Linus's admonition that interactive debuggers make for sloppier code. I don't think I have that much patience - LOL - so I'd probably decide to go fishing before I'd write an entire application without one!
I haven't tried your debugging technique yet. I'm not against interactive debuggers at all, but the "printing stuff out" method works well for me in most cases - at least when I know the code well enough, and know roughly where to look. When it's unfamiliar code, or it's some tricky multi-threading scenario, then stepping is often the right way to identify problem areas.
IMO Visopsys runs pretty well without the APIC enabled. With APIC enabled, I don't get the same result every time. It seems to be a little varied as to what will happen. I'm not familiar enough with visopsys at this time to make any intelligent guesses as to cause. Working on it though!
BTW: I looked at the kernel in the 2014-12-13-debug ISO, and it doesn't have debug info. Well - at least gdb doesn't think so. . I think your debug target may not be inserting the "-g". Anyway, I've been loading debug info from an older kernel that I compiled, which may explain some of the misalignments seen in the debugging sessions.
I wonder if you've ever considered a Trac bug page? It might be a better place to put overly long diagnostic text runs.
Last edited by ronaldlees on Fri Dec 19, 2014 1:34 pm, edited 8 times in total.
Visopsys 0.75
Copyright (C) 1998-2014 J. Andrew McLaughlin
Starting, one moment please ...
Detecting hardware: real time clock Error::kernelRtcDriver.c:waitOperationComplete(395):
Disk 01 no interrupt received - timeout
I had set a breakpoint, and caused the time-out. Then, when I resumed, I observed the following call graph as I continued:
0xc0024f0e in kernelMultitaskerGetProcesses (buffer=0xc002084e, buffSize=2014)
at kernelMultitasker.c:2398
2398 }
(gdb) n
kernelMultitaskerGetCurrentProcessId () at kernelMultitasker.c:2402
2402 {
(gdb) n
flushLogStream () at kernelLog.c:57
57 status = kernelLockGet(&logLock);
(gdb) n
58 if (status < 0)
(gdb) n
pushBytes (theStream=0xc009017c, number=61,
buffer=0xc00d6d28 "Dec 16 20:12:17 2014 Disk 03 no interrupt received - timeout\n") at kernelStream.c:282
282 if ((theStream == NULL) || (buffer == NULL))
(gdb) n
kernelLockGet (getLock=0xc009017c) at kernelLock.c:126
126 return (status = ERR_BUSY);
(gdb) n
Last edited by ronaldlees on Fri Dec 19, 2014 1:27 pm, edited 18 times in total.
The authors indicate that often times interrupt service and driver routines for devices must be modified to switch from PIC to APIC (excuse my lack of experience with this). Did you find it necessary to change much? The document is a little old, so maybe some of the described issues have been resolved in hardware by now.
Last edited by ronaldlees on Wed Dec 17, 2014 2:17 am, edited 1 time in total.
Thanks Ron. It's pretty hard to make sense of this, I think maybe because your sources won't match up with the binary download I gave you (usually, I'm not keen on releasing sources before things are stable and ready for release).
Can you tell me what command line you've been using with Qemu to reproduce these hangs?
The Visopsys kernel doesn't switch between PIC and APIC. That's called mixed mode, and it's generally considered to be a bad idea (or at least, a pain in the backside).
This seems like a good overview of things. I'll read through it to make sure I haven't missed anything obvious, but at this stage I think I understand the APIC pretty well