But now I have another weird problem.
I use this code to add an intterupt to my IDT:
Code: Select all
void install_int(unsigned char int_no, unsigned int address, unsigned short gdt_selector, unsigned char flags)
{
idt[int_no]->address_low = (address & 0xFFFF);
idt[int_no]->gdt_selector = gdt_selector;
idt[int_no]->unused = 0;
idt[int_no]->flags = flags;
idt[int_no]->address_high = ((address >> 16) & 0xFFFF);
return;
};
Code: Select all
00000402 83EC0C sub esp,byte +0xc
00000405 891C24 mov [esp],ebx
00000408 89742404 mov [esp+0x4],esi
0000040C 897C2408 mov [esp+0x8],edi
00000410 8B5C2414 mov ebx,[esp+0x14]
00000414 8B7C241C mov edi,[esp+0x1c]
00000418 0FB7742418 movzx esi,word [esp+0x18]
0000041D 0FB64C2410 movzx ecx,byte [esp+0x10]
00000422 BA002C1000 mov edx,0x102c00
00000427 8B048A mov eax,[edx+ecx*4]
0000042A 668918 mov [eax],bx
0000042D 8B048A mov eax,[edx+ecx*4]
00000430 66897002 mov [eax+0x2],si
00000434 8B048A mov eax,[edx+ecx*4]
00000437 C6400400 mov byte [eax+0x4],0x0
0000043B 8B348A mov esi,[edx+ecx*4]
0000043E 89F8 mov eax,edi
00000440 884605 mov [esi+0x5],al
00000443 8B048A mov eax,[edx+ecx*4]
00000446 C1EB10 shr ebx,0x10
00000449 66895806 mov [eax+0x6],bx
0000044D 8B1C24 mov ebx,[esp]
00000450 8B742404 mov esi,[esp+0x4]
00000454 8B7C2408 mov edi,[esp+0x8]
00000458 83C40C add esp,byte +0xc
0000045B C3 ret
There is a similar thing or my IDT, it is written to 0x1033F0.
But in both cases when I use them in bochs then use the 'x' command to read certain parts of memory, both of these places clearly show up as blank...
This weird, because though there is a clear write, the memory still turns up as blank...
I used bochs to step through my kernel, and these instructions are clearly executed...
But this is the weirdest thing:
I steeped through it in bochs and just after the instruction 'mov eax,[edx+ecx*4]' this is the state of the regs:
Code: Select all
rax: 0x00000000:00000000 rcx: 0x00000000:0000001c
rdx: 0x00000000:00102c00 rbx: 0x00000000:00100148
rsp: 0x00000000:001023b4 rbp: 0x00000000:00000000
rsi: 0x00000000:00000008 rdi: 0x00000000:0000008e
r8 : 0x00000000:00000000 r9 : 0x00000000:00000000
r10: 0x00000000:00000000 r11: 0x00000000:00000000
r12: 0x00000000:00000000 r13: 0x00000000:00000000
r14: 0x00000000:00000000 r15: 0x00000000:00000000
rip: 0x00000000:00100427
eflags 0x00000216
This is a really weird error, because of this my IDT is being written to 0x00000000 (which weirdly doesn't cause it to crash, but I'll look into that later....)
I'm not aware of any reason why a mov instruction should fail....
Anybody got any explanation for this?
Thanks in advance,
Jules