OSDev.org
https://forum.osdev.org/

Video Pointer C++ RealMode
https://forum.osdev.org/viewtopic.php?f=13&t=15268
Page 1 of 1

Author:  mati.newteam [ Fri Oct 26, 2007 5:26 pm ]
Post subject:  Video Pointer C++ RealMode

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).

Author:  iammisc [ Fri Oct 26, 2007 5:53 pm ]
Post subject: 

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.)

Author:  Alboin [ Fri Oct 26, 2007 6:29 pm ]
Post subject: 

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.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/