OSDev.org

The Place to Start for Operating System Developers
It is currently Sat May 18, 2024 10:28 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Hello again...
PostPosted: Sat Oct 27, 2007 12:54 pm 
Offline
Member
Member
User avatar

Joined: Mon Feb 26, 2007 3:39 pm
Posts: 101
After a month, I am again interested in osdev and i continued my real mode os.

One month ago i asked in the forum about a pointer to video memory. I didn't get the answers i wanted so i investigated for myself and i found this:

Code:
char _es *video;


This pointer is based in the _es value: lets suppose that es is 0xb800 and the pointer is 3, so it will point 0xb803.

This works in Turbo C++ 3.0...

Bye

_________________
Matías Beretta


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 27, 2007 2:00 pm 
Offline
Member
Member
User avatar

Joined: Sat Nov 25, 2006 3:55 am
Posts: 416
Location: Wisconsin
When the CPU wants to translate a Real Mode address to its physical address, it will shift the segment value to the left 4 bits and then add the offset to it. So the 3rd byte (0..2 = 3) in the Video RAM is:

(0xB800 << 0x04) + 0x0002 = 0x000B8000 + 0x0002 = 0x000B8002.

_________________
On the field with sword and shield amidst the din of dying of men's wails. War is waged and the battle will rage until only the righteous prevails.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 5 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group