Zirveos
Re:Zirveos
Many text modes have their buffer starting at physical address 0B8000h, real mode segment 0B800h, and you should be able to do it with your language of choice. You really should know this kind of thing when OS deving. This site's OSFAQ is pretty good, and the BabySteps mention this, but don't overlook info on other sites like OSRC and osdever.net.
Re:Zirveos
putting 'a' character on screen:(don't putting)
mov ax,0xb8000
mov es,ax
mov di,0x0000
mov bl,'a'
mov [es:di],bl
add di,2
mov [es:di],byte 7
whats error?
mov ax,0xb8000
mov es,ax
mov di,0x0000
mov bl,'a'
mov [es:di],bl
add di,2
mov [es:di],byte 7
whats error?
Re:Zirveos
Basic real and pmode put char.
Code: Select all
; realmode
mov ax,0xb800
mov es,ax
mov di,0x0000
mov bl,'a'
mov [es:di],bl
add di,1
mov byte[es:di], 9
;pmode
mov ax,8h ;linear Data segment
mov es,ax
mov byte [es:0xB8000], "A"
Re:Zirveos
dont put char:
start:
mov ax,0xb800
mov es,ax
mov di,0x0000
mov bl,'a'
mov [es:di],bl
add di,1
mov byte[es:di], 9
ret
(and)
start:
mov ax,8h ;linear Data segment
mov es,ax
mov byte [es:0xB8000], "A"
ret
start:
mov ax,0xb800
mov es,ax
mov di,0x0000
mov bl,'a'
mov [es:di],bl
add di,1
mov byte[es:di], 9
ret
(and)
start:
mov ax,8h ;linear Data segment
mov es,ax
mov byte [es:0xB8000], "A"
ret
Re:Zirveos
In protected mode, to write somethink to screen, try this code;
(Korumali modda ekrana birseyler yazmak icin su kodu dene;)
mov esi, 0xB8000
mov byte[esi], 'T'
mov byte[esi+1], 7
mov byte[esi+2], 'o'
mov byte[esi+3], 7
mov byte[esi+4], 'l'
mov byte[esi+5], 7
mov byte[esi+6], 'g'
mov byte[esi+7], 7
mov byte[esi+8], 'a'
mov byte[esi+9], 7
But ds register must be data selector. Don't forget.
(Ama ds registerinin data selektor olarak secili olmasi gerekiyor. Unutma.
(Korumali modda ekrana birseyler yazmak icin su kodu dene;)
mov esi, 0xB8000
mov byte[esi], 'T'
mov byte[esi+1], 7
mov byte[esi+2], 'o'
mov byte[esi+3], 7
mov byte[esi+4], 'l'
mov byte[esi+5], 7
mov byte[esi+6], 'g'
mov byte[esi+7], 7
mov byte[esi+8], 'a'
mov byte[esi+9], 7
But ds register must be data selector. Don't forget.
(Ama ds registerinin data selektor olarak secili olmasi gerekiyor. Unutma.
Re:Zirveos
They work on my pc, as com files, like this.zirveos wrote: dont put char:
start:
mov ax,0xb800
mov es,ax
mov di,0x0000
mov bl,'a'
mov [es:di],bl
add di,1
mov byte[es:di], 9
ret
(and)
start:
mov ax,8h ;linear Data segment
mov es,ax
mov byte [es:0xB8000], "A"
ret
Code: Select all
; realmode
org???100h
use16
start:
mov ax,0xb800
mov es,ax
mov di,0x0000
mov bl,'a'
mov [es:di],bl
add di,1
mov byte[es:di], 9
xor ax,ax
int 16h
int 20h
Code: Select all
;Pmode
org???100h
use16
start:
;*****************************
; Setting up, to enter pmode.
;*****************************
xor ebx,ebx
mov bx,ds
shl ebx,4
mov eax,ebx
mov [sys_code + 2],ax
mov [sys_data + 2],ax
shr eax,16
mov [sys_code + 4],al
mov [sys_data + 4],al
mov [sys_code + 7],ah
mov [sys_data + 7],ah
add ebx,gdt
mov [gdtr + 2],ebx
cli
lgdt [gdtr]
mov eax, cr0
or al,0x1
mov cr0,eax
jmp 0x18: protected
;*****************************
; Pmode. ;-)
;*****************************
use32
protected:
mov ax,0x10
mov ds,ax
mov ss,ax
mov ax,0x8
mov es,ax
;*****************************
; Turn floppy off .
;*****************************
mov dx,3F2h
mov al,0
out dx,al
mov byte [es:0xB8000], "P"
jmp $
;*************************************
; GDT.
;*************************************
gdt:??? dw??? 0x0000, 0x0000, 0x0000, 0x0000
sys_Lin: dw??? 0xFFFF, 0x0000, 0x9200, 0x00CF
sys_data: dw??? 0xFFFF, 0x0000, 0x9200, 0x00CF
sys_code: dw??? 0xFFFF, 0x0000, 0x9800, 0x00CF
gdt_end:
gdtr:??? dw gdt_end - gdt - 1
??? dd gdt
Re:Zirveos
thanks
Tolga Bey bu ds olayları nelerdir bahsetermisiniz?
Bide ds ayarları falan yapılmış ve ekrana yazı yazan kodu bnuraya yazarsanız sevinirim.
Tolga Bey bu ds olayları nelerdir bahsetermisiniz?
Bide ds ayarları falan yapılmış ve ekrana yazı yazan kodu bnuraya yazarsanız sevinirim.
Re:Zirveos
I know it can be much easier to talk in your native language, but imagine someone looking for crucial information, and wondering whether the crucial bit of info might be hidden in the part that is... whatever language that is.
Every good solution is obvious once you've found it.
Re:Zirveos
ZirveOS saying that "Can you talk me about ds register? And with adjusted ds register, can you write protected mode print screen code?".
Answer:
-------------------------------
* DS register must show data selector. If you don't know this, you can search "GDT Selector" at google. I can't tell this at here.
(Translation: Ds registeri data selektorunu gostermelidir. Eger bunu bilmiyorsan, google'da "GDT Selector" diye aratarabilirsin. Bunlari sana burada anlatamam.)
* I wrote this procedure, but i am using it only one times. You can use this:
(Translation: Ben bu proseduru yazdim, ama onu sadece bir kere kullandim. Sen bunu kullanabilirsin:)
[BITS 32]
; Enter : SI = Message Offset
PMTEXTOUT:
pusha
mov edi, 0xB8000
PMTEXTOUT_SUB1:
lodsb
or al, al
jz PMTEXTOUT_SUB2
mov byte[edi], al
mov byte[edi+1], 0x07
add edi, 2
jmp PMTEXTOUT_SUB1
PMTEXTOUT_SUB2:
popa
ret
; Usage(Kullanim):
mov si, startup_msg
call PMTEXTOUT
cli
hlt
startup_msg db "Now in protected mode!", 0
Answer:
-------------------------------
* DS register must show data selector. If you don't know this, you can search "GDT Selector" at google. I can't tell this at here.
(Translation: Ds registeri data selektorunu gostermelidir. Eger bunu bilmiyorsan, google'da "GDT Selector" diye aratarabilirsin. Bunlari sana burada anlatamam.)
* I wrote this procedure, but i am using it only one times. You can use this:
(Translation: Ben bu proseduru yazdim, ama onu sadece bir kere kullandim. Sen bunu kullanabilirsin:)
[BITS 32]
; Enter : SI = Message Offset
PMTEXTOUT:
pusha
mov edi, 0xB8000
PMTEXTOUT_SUB1:
lodsb
or al, al
jz PMTEXTOUT_SUB2
mov byte[edi], al
mov byte[edi+1], 0x07
add edi, 2
jmp PMTEXTOUT_SUB1
PMTEXTOUT_SUB2:
popa
ret
; Usage(Kullanim):
mov si, startup_msg
call PMTEXTOUT
cli
hlt
startup_msg db "Now in protected mode!", 0