hello,
We've written code to switch to protected mode. We enabled the A20 line, set the cr0 bit... But when a jump is given to the protected mode code and for clearing the prefetch queue, the system goes without response. We dunno whether our jump reached the correct place. We tried the following
- setting the base in gdt to zero and set the offset to the actual physical address where we the instruction will be loaded.
- setting the base to some value and given the offset correctly.
But of no use...Help out
Here is part of the code
mov eax, cr0
or al, 1 ; set protected mode bit
mov cr0, eax
mov ax, 0x10
mov ds, ax ; load global data selector into ds
jmp 0x08:0x200 ; transfer control to test kernel
The above jump gives us the problem
Setting up gdtr
gdtptr dw 0x20 ; limit (4 slots)
dd 0x0800 ; base (physical address)
prom: ; this is where the jmp goes. 512 bytes from the base
[BITS 32]
mov ax, 0x10
mov ds,ax ; not segments anymore: SELECTORS
mov ss,ax
mov esi, 0x1fff
nop
mov fs,ax
mov es, ax
Ekanth
We've written code to switch to protected mode. We enabled the A20 line, set the cr0 bit... But when a jump is given to the protected mode code and for clearing the prefetch queue, the system goes without response. We dunno whether our jump reached the correct place. We tried the following
- setting the base in gdt to zero and set the offset to the actual physical address where we the instruction will be loaded.
- setting the base to some value and given the offset correctly.
But of no use...Help out
Here is part of the code
mov eax, cr0
or al, 1 ; set protected mode bit
mov cr0, eax
mov ax, 0x10
mov ds, ax ; load global data selector into ds
jmp 0x08:0x200 ; transfer control to test kernel
The above jump gives us the problem
Setting up gdtr
gdtptr dw 0x20 ; limit (4 slots)
dd 0x0800 ; base (physical address)
prom: ; this is where the jmp goes. 512 bytes from the base
[BITS 32]
mov ax, 0x10
mov ds,ax ; not segments anymore: SELECTORS
mov ss,ax
mov esi, 0x1fff
nop
mov fs,ax
mov es, ax
Ekanth