a little problem ?
Posted: Sun Aug 12, 2001 11:00 pm
This programm should switch to protected mode an lode
the kernel which was copyed with int 13h to 0x1000:0 in realmode
but the bootstrap only shows the messages and reboot
code:
______________________________________-
[BITS 16]
[org 0x0]
jmp start
nop
;******************************RESET UND LOAD**************************
reset:
push ds
mov ax, 0
mov dl, [bootdrv]
int 13h
pop ds
jc reset
load:
mov ax, 0x1000
mov es, ax
mov bx, 0
mov ah, 0
mov al, 10 ;sektoren
mov cx, 2
mov dx, 0
int 13h
jc load
retn
;*********************************MESSAGE******************************
message:
lodsb
or al,al
jz done
mov ah,0eh
mov bx,0007
int 0x10
jmp message
done:
ret
;*********************************DATEN**********************************
bootdrv db 0
loadmsg db 'Loading kernel',13,10,0
jumpmsg db 'Jumping to kernel',13,10,0
pmodemsg db 'Entering PMode',13,10,0
gdt:
length dw gdtlength
base dd gdt_table
;***************************************************************************
start:
mov ax, 0x7c0
mov ds, ax
cli
mov ax, 0x9000
mov ss, ax
mov sp, 0xffff
sti
mov [bootdrv], dl
.386
mov si, loadmsg
call message
call load
lgdt [gdt]
mov si, pmodemsg
call message
mov si, jumpmsg
call message
cli
mov eax, cr0
or eax, 1
mov cr0, eax
db 0eah
dw 1000h
dw 14h
;jmp zu desc:offset 0x20:0x1000
;**********************************************************************;
gdt_table:
null_desc:
dw 0
dw 0
db 0
db 00000000b
db 00000000b
db 0
huge_desc_data:
dw 0xFFFF
dw 0000h
db 07h
db 10010010b
db 11001111b
db 00h
huge_desc_code:
dw 0xFFFF
dw 0000h
db 00h
db 10011010b
db 11000000b
db 00h
;**********************************************************************;
gdtlength equ $ -gdt_table -1
times 512-($-$$)-2 db 0
dw 0AA55h
the kernel which was copyed with int 13h to 0x1000:0 in realmode
but the bootstrap only shows the messages and reboot
code:
______________________________________-
[BITS 16]
[org 0x0]
jmp start
nop
;******************************RESET UND LOAD**************************
reset:
push ds
mov ax, 0
mov dl, [bootdrv]
int 13h
pop ds
jc reset
load:
mov ax, 0x1000
mov es, ax
mov bx, 0
mov ah, 0
mov al, 10 ;sektoren
mov cx, 2
mov dx, 0
int 13h
jc load
retn
;*********************************MESSAGE******************************
message:
lodsb
or al,al
jz done
mov ah,0eh
mov bx,0007
int 0x10
jmp message
done:
ret
;*********************************DATEN**********************************
bootdrv db 0
loadmsg db 'Loading kernel',13,10,0
jumpmsg db 'Jumping to kernel',13,10,0
pmodemsg db 'Entering PMode',13,10,0
gdt:
length dw gdtlength
base dd gdt_table
;***************************************************************************
start:
mov ax, 0x7c0
mov ds, ax
cli
mov ax, 0x9000
mov ss, ax
mov sp, 0xffff
sti
mov [bootdrv], dl
.386
mov si, loadmsg
call message
call load
lgdt [gdt]
mov si, pmodemsg
call message
mov si, jumpmsg
call message
cli
mov eax, cr0
or eax, 1
mov cr0, eax
db 0eah
dw 1000h
dw 14h
;jmp zu desc:offset 0x20:0x1000
;**********************************************************************;
gdt_table:
null_desc:
dw 0
dw 0
db 0
db 00000000b
db 00000000b
db 0
huge_desc_data:
dw 0xFFFF
dw 0000h
db 07h
db 10010010b
db 11001111b
db 00h
huge_desc_code:
dw 0xFFFF
dw 0000h
db 00h
db 10011010b
db 11000000b
db 00h
;**********************************************************************;
gdtlength equ $ -gdt_table -1
times 512-($-$$)-2 db 0
dw 0AA55h