Programming without BIOS

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
matias_beretta
Member
Member
Posts: 101
Joined: Mon Feb 26, 2007 3:39 pm

Programming without BIOS

Post by matias_beretta »

Hello... I am from Argentina, so I am sorry for my bad english.

I wrote this topic because I would like to write a procedure to write to screen and to get keys from the keyboard, and I want to do it in 16 bits mode . RealMode...

I know that the video address is 0xb800 for Protected Mode, but for Real Mode, I need a segment and an offset.. How can I convert 0xb800 to RealMode?

I read "http://www.osdev.org/wiki/Babystep4" but I can't understand thing such as movzx, shl....

Thanks....
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post by Dex »

This is useally the other way round, as in people ask how to do some thing in pmode, as they are use to realmode.
First "video address" is 0xb8000 for Protected Mode, as for realmode text in realmode without bios, Some thing like this

Code: Select all

mov ax,0xB800
mov es,ax
lea si,[msg]                   
mov cx,22
cld
rep movsb
jmp $

msg0:   db "H e l l o   W o r l d "
Keypress

Code: Select all

NoKey:
hlt
xor eax,eax
in AL,60h
cmp al,0x50 ;< scan code
jne NoKey
;do something here
Note the spaces need to be in the above text
Post Reply