Problem with PIT
Posted: Mon Sep 19, 2011 4:22 am
I am following Bran's Kernel Development Tutorial. I am using Ubuntu (as a guest os on virtualbox) and using qemu as my emulator to test the code. All's well up until I try to use the Programmable Interval Timer on this part of the tutorial - http://www.osdever.net/bkerndev/Docs/pit.htm
The problem is where I call "timer_phase" - namely the last line of that function (according to gdb):
Once that code is run, I get a total crash on qemu with the following output on the console
Any suggestions?
The problem is where I call "timer_phase" - namely the last line of that function (according to gdb):
Code: Select all
outportb(0x40, divisor >> 8); /* Set high byte of divisor */
I dont know if not having kvm is the problem. I cant seem to get it going and am wondering if it's because the OS I am using (Ubuntu) is itself a guest os running on Virtualbox (I am using a windows pc in work and use virtualbox to give me linux environment to code in). Again, not sure if this is the real problem or not.Could not initialize KVM, will disable KVM support
QEMU 0.12.5 monitor - type 'help' for more information
(qemu) qemu: fatal: Trying to execute code outside RAM or ROM at 0x000a0000
EAX=00003100 EBX=00000000 ECX=fff6d54f EDX=000131a0
ESI=001142ed EDI=00101162 EBP=00104eb0 ESP=00104e8c
EIP=0009ff23 EFL=00000002 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
CS =0008 00000000 ffffffff 00cf9a00 DPL=0 CS32 [-R-]
SS =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
DS =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
FS =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
GS =0010 00000000 ffffffff 00cf9300 DPL=0 DS [-WA]
LDT=0000 00000000 0000ffff 00008200 DPL=0 LDT
TR =0000 00000000 0000ffff 00008b00 DPL=0 TSS32-busy
GDT= 00105850 00000017
IDT= 00105040 000007ff
CR0=00000011 CR2=00000000 CR3=00000000 CR4=00000000
DR0=00000000 DR1=00000000 DR2=00000000 DR3=00000000
DR6=ffff0ff0 DR7=00000400
CCS=00000000 CCD=00104e8c CCO=LOGICL
FCW=037f FSW=0000 [ST=0] FTW=00 MXCSR=00001f80
FPR0=0000000000000000 0000 FPR1=0000000000000000 0000
FPR2=0000000000000000 0000 FPR3=0000000000000000 0000
FPR4=0000000000000000 0000 FPR5=0000000000000000 0000
FPR6=0000000000000000 0000 FPR7=0000000000000000 0000
XMM00=00000000000000000000000000000000 XMM01=00000000000000000000000000000000
XMM02=00000000000000000000000000000000 XMM03=00000000000000000000000000000000
XMM04=00000000000000000000000000000000 XMM05=00000000000000000000000000000000
XMM06=00000000000000000000000000000000 XMM07=00000000000000000000000000000000
./start_qemu: line 1: 2564 Aborted qemu -kernel kernel/kernel.bin -monitor stdio
Any suggestions?