How to enter VGA 12H mode from protected mode?

How to enter VGA 12H mode from protected mode?

Post by Bin Ch » Mon, 23 Dec 2002 23:01:58



Hi,
everyone
I am writing an OS by myself.You know,in protected mode,you can't call
BIOS interrupt service.You must code yourself.

But I have no idea about how to enter VGA 12H mode without BIOS
support.Almost all books concern with how to manipulate VGA 12H
mode,but no how to enter into it.

Any help appreciated!

yours,
Bin Chen

 
 
 

How to enter VGA 12H mode from protected mode?

Post by David A. Caabeir » Tue, 24 Dec 2002 02:55:08


Quote:> I am writing an OS by myself.You know,in protected mode,you can't call
> BIOS interrupt service.You must code yourself.


Regards,
David.

--
Reply: replace 'nospam' with 'david_caabeiro'

comp.lang.c      FAQ: http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++  FAQ: http://www.parashift.com/c++-faq-lite/
Online book reviews: http://www.accu.org/bookreviews/public

 
 
 

How to enter VGA 12H mode from protected mode?

Post by Tim Robert » Tue, 24 Dec 2002 05:47:25



>Hi,
>everyone
>I am writing an OS by myself.You know,in protected mode,you can't call
>BIOS interrupt service.You must code yourself.

>But I have no idea about how to enter VGA 12H mode without BIOS
>support.Almost all books concern with how to manipulate VGA 12H
>mode,but no how to enter into it.

There are a couple of choices.

One option is to use another system to set the VGA into mode 12h, and then
dump all the VGA registers.  Then, you can duplicate those register values
in your own code.

Another option is to implement the equivalent of the Linux "vm86" syscall,
which sets up a V86 mode environment.  BIOS calls CAN be executed from V86
mode.  A number of XFree86 drivers do their modesets by calling into the
BIOS using vm86.

VGA mode 12h is a planar graphics mode.  Are you sure that's the one you
want?
--

  Providenza & Boekelheide, Inc.

 
 
 

1. Question on Entering Protected Mode

Hi Everyone,

I am new at this mailing list business, so bear with me if I am not posting
my question at the most appropriate list... (maybe one of you can suggest me
a better place to discuss things related to my question bellow).

Well, I am an experienced C programmer and I just began learning the workings
of x86 systems. At the same time I am trying to tame the beast, beginning
with Linux's bootsect.S and setup.S, naturally. So here goes my question:

After loading both the Global and Local descriptor tables, the setup code
enters PM by issuing the instructions

setup.S:        mov     ax,#1           ! protected mode (PE) bit
setup.S:        lmsw    ax              ! This is it!

Previous to 'lmsw' the CS register naturally contains the current code
segment (0x9000, I believe). But right after 'lmsw' the CPU interprets
its content differently, like a segment selector for the appropriate
descriptor table. The hex number 0x9000 corresponds to

1001000000000 0 00 b

This number, interpreted as a segment selector, tells the CPU the following:

Global descriptor Table,
Requested Privilege Level 0 (Ring 0),
Descriptor selector 4608

But the GDT loaded at setup.S only contains two descriptors (2 and 3) besides
the two inaccessible (0 and 1) ones. So, it looks to me that the next
instruction to be executed (or pre-fetched) that uses the register CS would
try to access a descriptor (4608) that is not in GDT and therefore a CPU
exception should be raised. (is the IDT ready to deal with this at
this point ?)

Obviously either there's something wrong with way I see things up here or
I know only half the story... Can someone help me understand that ? I also
would be glad to discuss other Linux/x86 arch questions...

Well, I have other questions on top of my mind but I better wait and see
if anyone is interested in discussing with me. Please, when replying to
this message, reply directly to me as well. Thanks, Ximenes.

PS: Does somebody know of an on-line document that goes into the details of the
    Linux code, at the level of the question above ? This would help me
    a lot in learning both Linux and x86 at the same time.

XIMENES ROCHA RESENDE                          
Department of Physics   Swain  Hall West  117
Indiana University      Bloomington  IN 47405                  
Phone: (812) 855-3152   Fax:   (812) 855-5533  
http://cv-2-8.campusview.indiana.edu/~ximenes

2. Getting Geforce DDR to work

3. switch from protected mode to real mode in kernel

4. Linux mgetty/pap dialin

5. linux->real mode-> boot other OS in protected mode

6. pop3/dns server problem?

7. A confusion about IA32 protected mode protecting kernel data.

8. Stats comp.os.linux.networking (last 7 days)

9. device eth0 entered promiscuous mode

10. Help!!! eth0 entered Promiscuous mode???

11. use esc key to exit GRUB graphical boot menu and enter command line mode

12. How to enter single user mode at boot time like SCO-UNIX ?

13. RH 8.0 can't enter into graphical install mode