moving kernel at 0x100000
Posted: Sun Apr 24, 2005 9:47 am
Hi everyone,
i have a problem moving my kernel at phys 0x100000. Loading it at 0x10000 and jumping to it is no problem, but when i try to move it at 0x100000 and jump there, the system reboots.
The idea is to load the kernel over the 1st MB from the 16 byte loader, enter pmode and jump to it. Enabling a20 is ok, switching to pmode looks fine. I have tried:
xor ecx, ecx
mov ax, 0x10 ; my data seg ( phys 0x0 )
mov ds, ax
mov es, ax
mov cx, [kernel_size]
mov esi, 0x00010000
mov edi, 0x00100000
rep
a32 movsb
jmp dword 0x8:0x100000 ; 0x8 - code seg
and :
mov cx, [kernel_size] ; in bytes
shr cx, 1
inc cx
mov ax, 0x18 ; tmp desc
mov es, ax
mov si, gdt_copy_start
mov ax, 0x10
mov ds, ax
mov ax, 0x8700
copy_krnl:
int 0x15
jc copy_krnl
jmp dword 0x8:0x100000 ; 0x8 - code seg
using:
gdt_copy_start:
.null_seg
dd 0x00000000
dd 0x00000000
.code_seg
dw 0xffff
db 0x00, 0x00, 0x01
db 0x93
dw 0x0
.data_seg
dw 0xffff
db 0x00, 0x00, 0x10
db 0x93
dw 0x0
gdt_copy_end:
dd 0x0
dd 0x0
But jumping to 0x100000 reboots the system.
Can you give me some advice?
Thanks
i have a problem moving my kernel at phys 0x100000. Loading it at 0x10000 and jumping to it is no problem, but when i try to move it at 0x100000 and jump there, the system reboots.
The idea is to load the kernel over the 1st MB from the 16 byte loader, enter pmode and jump to it. Enabling a20 is ok, switching to pmode looks fine. I have tried:
xor ecx, ecx
mov ax, 0x10 ; my data seg ( phys 0x0 )
mov ds, ax
mov es, ax
mov cx, [kernel_size]
mov esi, 0x00010000
mov edi, 0x00100000
rep
a32 movsb
jmp dword 0x8:0x100000 ; 0x8 - code seg
and :
mov cx, [kernel_size] ; in bytes
shr cx, 1
inc cx
mov ax, 0x18 ; tmp desc
mov es, ax
mov si, gdt_copy_start
mov ax, 0x10
mov ds, ax
mov ax, 0x8700
copy_krnl:
int 0x15
jc copy_krnl
jmp dword 0x8:0x100000 ; 0x8 - code seg
using:
gdt_copy_start:
.null_seg
dd 0x00000000
dd 0x00000000
.code_seg
dw 0xffff
db 0x00, 0x00, 0x01
db 0x93
dw 0x0
.data_seg
dw 0xffff
db 0x00, 0x00, 0x10
db 0x93
dw 0x0
gdt_copy_end:
dd 0x0
dd 0x0
But jumping to 0x100000 reboots the system.
Can you give me some advice?
Thanks