Page 1 of 1

Video Pointer C++ RealMode

Posted: Fri Oct 26, 2007 5:26 pm
by mati.newteam
Hello, I'm making a 16 bit operating system with Turbo C++ 3.0 and I decided not to use BIOS interrupts (becauses I want to do all the work for myself).

I know that in real mode, memory is accessed by a segment and an offset, so i can use a poke and pokeb procedures to write to the video memory but i know, and i've heard that some people uses a pointer to video memory 0xb800 and then write to memory trough that pointer.

Question: How can i create that pointer?

Maybe you would recomend me to use protected mode, but i cant understand it, and i think the proper way of starting osdev is by the simplest (realmode).

Posted: Fri Oct 26, 2007 5:53 pm
by iammisc
if you're going to do everything yourself, you might as well use pmode with one flat address space(you don't have to do paging if you don't want to).

Anyway, the physical address to the screen console(in text mode) is 0xb8000. You missed a zero. I'm not sure of the specifics of creating a segmented pointer but in protected mode you can just set a pointer to that address(which is why protected mode would actually be the easier choice.)

Posted: Fri Oct 26, 2007 6:29 pm
by Alboin
iammisc wrote:Anyway, the physical address to the screen console(in text mode) is 0xb8000. You missed a zero.
The video segment in 16bit mode is actually 0xb800, so if he's in rmode, he's correct.

Anyway, this might be of some help.