OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Apr 19, 2024 11:13 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: problem with pm
PostPosted: Fri Aug 10, 2001 11:00 pm 
I have a bootloader which switches to protected mode
and than jmps to a c-programm (my kernel)
the kernel creates some descriptors
one of them is a video_descriptor he points to the
address 0xb8000.
So how can I access this memory
char *video=(char*)0xb8000;
or
char *video=(char*)descriptornumber;

p.s. i am from german so my english is quite bad


Top
  
 
 Post subject: RE:problem with pm
PostPosted: Fri Aug 10, 2001 11:00 pm 
>On 2001-08-11 02:59:42, Thomas Sendelbach wrote:
>I have a bootloader which switches to protected mode
>and than jmps to a c-programm (my kernel)
>the kernel creates some descriptors
>one of them is a video_descriptor he points to the
>address 0xb8000.
>So how can I access this memory
>char *video=(char*)0xb8000;
>or
>char *video=(char*)descriptornumber;
>
>p.s. i am from german so my english is quite bad

the bootloader created the gdt and a code and a data descriptor
and now the kernel creates the videodescriptor
so now the post is complete


Top
  
 
 Post subject: RE:problem with pm
PostPosted: Fri Aug 10, 2001 11:00 pm 
>char *video=(char*)0xb8000;
>or
>char *video=(char*)descriptornumber;

Try 'em both... :)

Actually, what you have to do is load a segment
register with your new descriptor.

In assembly:
mov es, VIDEO_SEG

And then you can access video memory as es:offset
(es:di, for example).

You're getting into far pointers though... it'll
be faster just to define one segment for everything,
starting at 0x0, with a length of 0xfffff pages
and then you can access video memory like this:

char *video = (char *)0x000b8000;
video[offset] = data;

>p.s. i am from german so my english is quite bad

No problem... I just hope I didn't make any
"hang-over" mistakes :)


Top
  
 
 Post subject: RE:problem with pm
PostPosted: Fri Aug 10, 2001 11:00 pm 
>On 2001-08-11 15:27:11, Anonymous wrote:
>>char *video=(char*)0xb8000;
>>or
>>char *video=(char*)descriptornumber;

pokeb(video_selector, 0, 'A');
or maybe
pokeb(linear_memory_selector, 0xB8000, 'A');

>char *video = (char *)0x000b8000;
>video[offset] = data;

That only works with paging, or if the kernel
data segment has base address 0. If the base
address is not 0, you must subtract it:

char *video = (char *)(0xB8000 - kernel_ds_base);
video[0] = 'A';
video[1] = 0x1F; /* white on blue */


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 46 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