i want write bootloader use nasm,i enter pmode,then write a char 'a',but when kernel offset is 500h,it 's ok,then i modifty 500h to 1000h,it's wrong and restart machine,the snipe code is bellow:
;boot.asm
...
;read driver a
mov ax, 1000h ;
mov es, ax ;
mov bx, 0 ;
mov dl, 0 ;
mov dh, 0 ;
mov ch, 0 ;
mov cl, 2 ;
mov al, 2 ;
mov ah, 2 ;
int 13h
mov ax, 1000h ;
mov es, ax
mov ds, ax
push word 1000h
push word 00h
retf
...
;kernel.asm
org 10000h
...
lgdt ; Load GDT
mov eax,cr0 ; The lsb of cr0 is the protected mode bit
or al,0x01 ; Set protected mode bit
mov cr0,eax ; Mov modified word to the control register
jmp codesel:go_pm
...
then i replace 1000h to 500h,then it 's ok,can you help me?
;boot.asm
...
;read driver a
mov ax, 1000h ;
mov es, ax ;
mov bx, 0 ;
mov dl, 0 ;
mov dh, 0 ;
mov ch, 0 ;
mov cl, 2 ;
mov al, 2 ;
mov ah, 2 ;
int 13h
mov ax, 1000h ;
mov es, ax
mov ds, ax
push word 1000h
push word 00h
retf
...
;kernel.asm
org 10000h
...
lgdt ; Load GDT
mov eax,cr0 ; The lsb of cr0 is the protected mode bit
or al,0x01 ; Set protected mode bit
mov cr0,eax ; Mov modified word to the control register
jmp codesel:go_pm
...
then i replace 1000h to 500h,then it 's ok,can you help me?
I hate to do this, but your recent posts are starting to reak of the "spoon-feed me" syndrome.
CLICK ON THIS LINK and start reading up on how things are done.
CLICK ON THIS LINK and start reading up on how things are done.
sorry,i learn myself first.