flat assembler
Message board for the users of flat assembler.

Index > OS Construction > .. when i run it, my message in protected mode don't appear

Author
Thread Post new topic Reply to topic
Fulgurance



Joined: 27 Nov 2017
Posts: 276
Fulgurance 16 May 2019, 22:25
Hello, i have made code with little kernel and to test some fonctions.

But when i run it, my message in protected mode don't appear.

Code:
use16
org 0x7C00

xor ah,ah
xor dl,dl
int 0x13

mov ax,0x100
mov es,ax
xor bx,bx
mov ah,0x2
mov al,0x1
xor ch,ch
mov cl,0x2
xor dh,dh
xor dl,dl
int 0x13

jmp 0x1000

db 510-($-$$) dup 0x90
dw 0xAA55

org 0x1000

cli
lgdt [GDTProtectedMode.Descriptor]
mov eax,cr0
or al,0x1
mov cr0,eax
jmp 0x8:InitializeMain32

use32

InitializeMain32:
mov byte [0xB8000],'*'
mov byte [0xB8001],0x2
mov byte [0xB8002],' '
mov byte [0xB8003],0x0
mov byte [0xB8004],'I'
mov byte [0xB8005],0x7
mov byte [0xB8006],'n'
mov byte [0xB8007],0x7
mov byte [0xB8008],'i'
mov byte [0xB8009],0x7
mov byte [0xB800A],'t'
mov byte [0xB800B],0x7
mov byte [0xB800C],'i'
mov byte [0xB800D],0x7
mov byte [0xB800E],'a'
mov byte [0xB800F],0x7
mov byte [0xB8010],'l'
mov byte [0xB8011],0x7
mov byte [0xB8012],'i'
mov byte [0xB8013],0x7
mov byte [0xB8014],'z'
mov byte [0xB8015],0x7
mov byte [0xB8016],'e'
mov byte [0xB8017],0x7
mov byte [0xB8018],'M'
mov byte [0xB8019],0x7
mov byte [0xB801A],'a'
mov byte [0xB801B],0x7
mov byte [0xB801C],'i'
mov byte [0xB801D],0x7
mov byte [0xB801E],'n'
mov byte [0xB801F],0x7
mov byte [0xB8020],'3'
mov byte [0xB8021],0x7
mov byte [0xB8022],'2'
mov byte [0xB8023],0x7

Main32:
jmp short Main32

GDTProtectedMode:
.NullDescriptor:
dq 0x0
.CodeDescriptor:
dw 0xFFFF,0x0
db 0x0,11011001b,11110010b
db 0x0
.DataDescriptor:
dw 0xFFFF,0x0
db 0x0,11001001b,11110010b
db 0x0
.Descriptor:
dw 0x18
dd GDTProtectedMode

db 512-($-$$) dup 0x90
    
Post 16 May 2019, 22:25
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20356
Location: In your JS exploiting you and your system
revolution 17 May 2019, 15:46
One thing I notice. You need to be sure about your CS value:
Code:
jmp 0:0x1000 ; the value of CS will vary between BIOSes so set it explicitly    
Post 17 May 2019, 15:46
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.