Page 2 of 2

Posted: Sun Sep 09, 2007 9:24 am
by mmiikkee12
Candy wrote:
mmiikkee12 wrote:I was planning on waiting until I have all my current code working before importing it into a SVN repo. Should I do that now so you can see my code?
It's advisable to check into a svn / cvs / something repo ASAP after you get one more feature working. You wouldn't be the first to have the just-not-working product remove half its source.
'

My current code == GDT+IDT :-)

Posted: Sat Sep 15, 2007 9:02 am
by mmiikkee12
OK, I got past the GDT problems. Now QEMU is telling me this:
qemu: fatal: Trying to execute code outside RAM or ROM at 0x000b8f00

EAX=000b8f00 EBX=00103000 ECX=0000011b EDX=00000000
ESI=000250b0 EDI=00030f48 EBP=001020fc ESP=00102094
EIP=000b8f00 EFL=00000002 [-------] CPL=0 II=0 A20=1 SMM=0 HLT=0
ES =0010 00000000 ffffffff 00cf9300
CS =0008 00000000 ffffffff 00cf9a00
SS =0010 00000000 ffffffff 00cf9300
DS =0010 00000000 ffffffff 00cf9300
FS =0010 00000000 ffffffff 00cf9300
GS =0010 00000000 ffffffff 00cf9300
LDT=0000 00000000 0000ffff 00008000
TR =0000 00000000 0000ffff 00008000
GDT= 0010b020 00000017
IDT= 0010b040 000007ff
CR0=60000011 CR2=00000000 CR3=00000000 CR4=00000000
CCS=00000004 CCD=fffffffc CCO=SUBL
FCW=037f FSW=0000 [ST=0] FTW=00 MXCSR=00001f80
[FPR0-7 and XMM0-7 are all 0.]
And Bochs tells me this:
00016806479i[CPU0 ] LOCK prefix unallowed (op1=0x87, attr=0x300, mod=0xc0, nnn=5)
00016859235i[CPU0 ] LOCK prefix unallowed (op1=0x53, attr=0x0, mod=0x0, nnn=0)
The second line repeats until I kill Bochs, and prints isr_handler each time it happens.

I finally got around to putting my code in SVN, the kernel code is here: http://dinounix.ath.cx/delta/?module=sv ... /&rev=HEAD

Posted: Sat Sep 15, 2007 9:16 am
by Combuster
your asm stubs are incorrect: you push two values (or one if the error code is already there), but you neglegt to pop them once the interrupt routine returns

Code: Select all

push 0
 |
 | push %1
 |  |
 |  | jmp isr_common_stub
 |  | pusha
 |  |  | call isr_handler
 |  | popa
 |  |
 |  ? 
 ?
ret 

Posted: Sat Sep 15, 2007 9:26 am
by mmiikkee12
Thank you! add esp, 8 did it. (How did I forget that?)

Oh well, everyone makes mistakes. I just happen to make many more mistakes than most other people.

Posted: Sat Sep 15, 2007 11:26 pm
by speal
you'd be surprised

Posted: Sat Sep 22, 2007 5:11 am
by Fetrovsky
mmiikkee12 wrote:Still the gate type 7 message.

I'm going to take a short (couple of hours) break from OSDev for a few hours to do some web coding (for my OS's website of course :-), but please feel free to try to tell me wtf is going on :-)
Gate Type? Are you sure you're not making your code segment a "System" segment?