오후 1:35 2008-12-08
IBM VGA programming
조경민 bro@shinbiro.com neri.cafe24.com
==============================================================


IBM VGA프로그래밍은 다음 기능을 사용하여 하게 된다.
- VGA low-level register (vga i/o)
- VGA/VESA BIOS (int 10h)


참고: VGA는 거의 표준 호환되지만 SVGA부터는 비디오카드 벤더마다 각자 자신만의 3D가속이나 여러 함수를 추가하였다.


기본적으로 VGA BIOS 코드는 VGA low-level register를 사용하고 있다.
SVGA를 지원하기 위해 extended BIOS로 VESA BIOS기능으로 같은 10h인터럽트에 AL레지스터에 4Fh를 주어 동작된다.


모든 low-level register는 i/o port를 통해서 접근된다.
IBM PC는 메모리 버스와 I/O버스가 구분되어 있다.
따라서 low-level register는 IBM pc가 real mode이든 protected mode이든 i/o를 통해서
접근 가능하다.



low-level register에는 다음과 같은 군이 있다.
----------------------------------------------------
Graphic Register - CPU가 video RAM을 어떻게 접근할지 방법을 설정
Sequencer Register - video data를 DAC에게 어떻게 보낼지 설정
Attribute Controller Register - EGA/CGA compatibility를 위해사용되는 16/64 칼라 팔레트를 선택
CRT Controller Register - 어떻게 video가 display로 출력될지 방법을 설정
Color Register - 256 color palette 설정
External Register - video system 설정용 여러 레지스터



VGA BIOS를 이용
-----------------------------------------------------
이를 쉽게 프로그래밍할 수 있도록 BIOS에서 인터럽트 벡터로 제공하고 있다.
이를 사용하기 위해서 cpu레지스터에 파라미터를 넣고 int 10h를 호출하게 된다.
BIOS기능 호출은 real mode에서만 가능하다.


보호모드에서는 BIOS 호출을 할 수 없다.
보호모드에서 BIOS를 사용해서 VGA를 설정하고 싶다면 다음과 같은 방법을 사용한다.
- real mode에서 video 설정을 끝내고 protected mode로 들어감.
- protected mode에서 unreal mode로 들어와서 video를 설정하고 다시 protected mode로 감.
- 보호모드에서 V86 Task를 생성해서 이 emulate된 real mode상에서 비디오 설정
- VBE (VESA Bios Extension)을 사용하여 보호모드에서 직접 VESA BIOS를 호출. (비디오카드에 따라 제공안할 수 있음)


참고사항
------------------------------------------------------
http://forum.osdev.org/viewtopic.php?f=1&t=18445
Note that you can use PMode <-> RMode switching or v86 for using BIOS calls, but the second method is generally not recommended for disk IO (cf. Windows 95!). PMode <-> RMode switching also needs to be done very carefully and can get messy. If you go to long mode, you will need drivers (there's no v86 mode).



참고
-------------------------------------------------------
FreeVGA (low-level VGA)
http://www.stanford.edu/class/cs140/projects/pintos/specs/freevga/freevga.htm


VBE3
http://www.vesa.org/vbe3.pdf


VESA/VGA BIOS emulation
http://unix.derkeiler.com/pdf/Newsgroups/comp.os.vms/2004-12/1177.pdf


Drawing In Protected Mode
http://wiki.osdev.org/Drawing_In_Protected_Mode


IBM BIOS
http://www.bioscentral.com/postcodes/ibmbios.htm


bochs VGA BIOS(VBE) source code
http://www.nongnu.org/vgabios/


 



http://forum.osdev.org/viewtopic.php?f=1&t=18005
http://forum.osdev.org/viewtopic.php?f=1&t=18122
http://pds5.egloos.com/pds/200707/22/25/maindish_os_history.pdf


http://platan.vc.cvut.cz/ftp/pub/vmware/obsolete/
vmware-1455-vbe.tar.gz


VBE3 지원 리스트
http://www.jnode.org/node/912



http://digitalangelmaster.wordpress.com/2006/06/05/direct-rendering-in-vmware-5/
VM ware, Inc. VBE support 2.0



http://www.ninj4.net/kinetic/



http://members.chello.nl/w.cools/003/README.TXT
2.4.1 VMWare
        ------------------------------------------------
        I have no idea if T/OS will run with VMWare. I don't have VMWare here
        so there's no way for me to test this. I do know however, that last
        time I checked VMWare did not support VESA2 with LFB and I don't think it'll
        support a RealTek8139 or NE2000 network interface either, so I don't
        think you'll be able to run it under VMWare. Also, VMWare's floppy
        emulation is, like Bochs', very slow.
       
        2.4.2 Bochs
        ------------------------------------------------
        Like VMWare, Bochs does not support VESA2 or a RealTek or NE2000 network
        interface (at least, my version doesn't, I'm not sure about the newest
        versions). Also note that the floppy emulation for Bochs is _VERY_ slow.
        Please keep in mind that the main goal of my OS is not to be compatible
        with emulators, but to be compatible with _real_ PC's.

'KB > Win32/x86' 카테고리의 다른 글

Win DDK extreme MVP  (0) 2008.11.05
intel mmx/sse simd  (0) 2008.04.25
[펌] Operating System Inside  (0) 2007.08.01
system call  (0) 2007.06.20
sysinernals mark 블로그~  (0) 2007.04.30

+ Recent posts