Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Paste Description for VESA GDI driver

castawayed VGA driver
should provide SVGA driver capabilities
but anyway good doc for VGA registers

VESA GDI driver
Sunday, August 5th, 2007 at 8:17:06am MDT 

  1. ; **********************************************************
  2.  
  3. ;       Name: VESA Graphic Device Interface
  4. ;       Autor: Peter Kleissner
  5. ;       Version: 1.00
  6. ;       Date: 04.08.2007 21:52
  7. ;       last Update: 04.08.2007 21:52
  8. ;       see document: ToasterOS.pdf
  9.  
  10. ; **********************************************************
  11.  
  12. [BITS 32]
  13. CPU 386
  14.  
  15.  
  16. %define Type_System
  17. %include "interface.asm"
  18.  
  19.  
  20. org VESA_GDI
  21.  
  22.  
  23.  
  24. ; VGA, SVGA, VESA Interface port registers
  25. ;
  26. ;  Attribute Controller Registers
  27. ;     Index/Data Register               3C0h   [Write]
  28. ;     Data Register                     3C1h   [Read]
  29. ;        Indexes of the Attribute Controller Register
  30. ;           Palette Registers                   00h - 0Fh
  31. ;           Attribute Mode Control Register     10h
  32. ;           Overscan Color Register             11h
  33. ;           Color Plane Enable Register         12h
  34. ;           Horizontal Pixel Panning Register   13h
  35. ;           Color Select Register               14h
  36. ;           Miscellanenous                      16h            [undocumented, na]
  37. ;
  38. ;  Miscellaneous Registers
  39. ;     Miscellaneous Output Register     3C2h   [Write]
  40. ;     Miscellaneous Output Register     3CCh   [Read]
  41. ;     Input Status 0 Register           3C2h   [Read]
  42. ;     Video Subsystem Enable            3C3h   (46E8h)
  43. ;
  44. ;  Sequencer Registers
  45. ;     TS Index Register                 3C4h   [EGA, Write]
  46. ;     TS Data Register                  3C5h   [EGA, Write]
  47. ;     
  48. ;     Sequence Index Register           3C4h   [VGA]
  49. ;     Sequence Data Register            3C5h   [VGA]
  50. ;
  51. ;  Digital-Analog Converter Registers
  52. ;     PEL Mask Register                 3C6h   [MCGA=0FFh, VGA]
  53. ;     DAC State Register                3C7h   [Read]
  54. ;     PEL Address Register              3C7h   [Write]
  55. ;     PEL Address Register              3C8h   [Write-Mode]
  56. ;     PEL Data Register                 3C9h
  57. ;
  58. ;  Graphics Device Controller Position Registers
  59. ;     Feature Control Register          3CAh   [Read]
  60. ;     Graphics 2 Position Register      3CAh   [Write]
  61. ;     Segment Select Register           3CBh
  62. ;     Graphics 1 Position Register      3CCh   [Write]
  63. ;     Select Segment Register           3CDh
  64. ;
  65. ;  Graphics Device Controller Registers
  66. ;     Index Register                    3CEh   [EGA, Write]
  67. ;     Data Register                     3CFh   [EGA, Write]
  68. ;     Address/Index Register            3CEh   [VGA]
  69. ;     Graphics Register                 3CFh   [VGA, unused, undocumented]
  70. ;
  71. ;  Clear Flip/Flop Registers (for Port 3C2h)
  72. ;     EGA/VGA mono Feature Control Register    3BAh
  73. ;     VGA graphics Feature Control Register    3DAh
  74.  
  75.  
  76.  
  77.  
  78. ; VBE Interface port registers [bochs, qemu]
  79. ;   VBE Display Interface I/O Port Index     1CEh
  80. ;   VBE Display Interface I/O Port Data      1CFh
  81. ;   
  82. ;   Indexes:
  83. ;   
  84. ;     VBE Display Index Idendification      0
  85. ;     VBE Display Index X resolution        1
  86. ;     VBE Display Index Y resolution        2
  87. ;     VBE Display Index Bits per Pixel      3
  88. ;     VBE Display Index Enable              4
  89. ;     VBE Display Index Bank                5
  90. ;     VBE Display Index Virtual Width       6
  91. ;     VBE Display Index Virtual Height      7
  92. ;     VBE Display Index X Offset            8
  93. ;     VBE Display Index Y Offset            9
  94. ;   
  95. ;   Data Values:
  96. ;   
  97. ;     VBE Display Index Disabled            0
  98. ;     VBE Display Index Enabled             1
  99. ;     VBE Display Index Get Capabilities    2
  100. ;     VBE Display Index 8 Bit Digital-Analog-Converter       20h
  101. ;     VBE Display Index Linear Frame Buffer Enabled          40h
  102. ;     VBE Display Index No Clear Memory                      80h
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116. ; *************************************************************
  117. ;   Function: Write Index/Value to Attribute Control Register
  118. ;   
  119. ;   Input:     
  120. ;            al    Index
  121. ;            ah    Data
  122. ; *************************************************************
  123.  
  124. Send_Attribute_Control_Register:
  125.  
  126. ; clear flip/flop [for both Text Mode and graphics Mode]
  127. mov bl,al
  128. mov dx,3BAh
  129. in al,dx
  130. mov dx,3DAh
  131. in al,dx
  132. mov al,bl
  133.  
  134. ; send the Index
  135. mov al,bl
  136. mov dx,3C0h
  137. out dx,al
  138.  
  139. ; send the Data
  140. mov al,ah
  141. out dx,al
  142.  
  143. ret
  144.  
  145.  
  146.  
  147.  
  148.  
  149. ; *************************************************************
  150. ;   Function: Write Value to Miscellaneous Output Register
  151. ;   
  152. ;   Input:
  153. ;            al    Value
  154. ; *************************************************************
  155.  
  156. Send_Miscellaneous_Output_Register:
  157.  
  158. ; send the Data
  159. mov dx,3C2h
  160. out dx,al
  161.  
  162. ret
  163.  
  164.  
  165.  
  166.  
  167.  
  168. ; *************************************************************
  169. ;   Function: Write Index/Value to Sequencer Register
  170. ;   
  171. ;   Input:
  172. ;            al    Index
  173. ;            ah    Data
  174. ; *************************************************************
  175.  
  176. Send_Sequencer_Register:
  177.  
  178. ; if Index = 1 assume EGA (whyever)
  179. cmp al,1
  180. jne Send_Sequencer_Register_1
  181.  
  182. ; send something
  183. mov bl,ah
  184. mov ax,0100h
  185. mov dx,3C4h
  186. out dx,ax
  187.  
  188. ; send the Index
  189. mov al,1
  190. out dx,al
  191.  
  192. ; send the Data
  193. mov al,bl
  194. inc dx
  195. out dx,al
  196. dec dx
  197.  
  198. ; send something else
  199. mov ax,0300h
  200. out dx,ax
  201.  
  202. ret
  203.  
  204. Send_Sequencer_Register_1:
  205.  
  206. ; send the Index
  207. mov dx,3C4h
  208. out dx,al
  209.  
  210. ; send the Data
  211. mov al,ah
  212. inc dx
  213. out dx,ah
  214.  
  215. ret
  216.  
  217.  
  218.  
  219.  
  220.  
  221. ; *************************************************************
  222. ;   Function: Write Value to DAC Mask Register
  223. ;   
  224. ;   Input:
  225. ;            al    Value
  226. ; *************************************************************
  227.  
  228. Send_DAC_Mask_Register:
  229.  
  230. ; send the Data
  231. mov dx,3C6h
  232. out dx,al
  233.  
  234. ret
  235.  
  236.  
  237.  
  238.  
  239.  
  240. ; *************************************************************
  241. ;   Function: Write Index/Value to Graphics Controller Register
  242. ;   
  243. ;   Input:
  244. ;            al    Index
  245. ;            ah    Data
  246. ; *************************************************************
  247.  
  248. Send_Graphics_Controller_Register:
  249.  
  250. ; send the Index
  251. mov dx,3CEh
  252. out dx,al
  253.  
  254. ; send the Data
  255. mov al,ah
  256. inc dx
  257. out dx,al
  258.  
  259. ret
  260.  
  261.  
  262.  
  263.  
  264.  
  265. ; *************************************************************
  266. ;   Function: Write Index/Value to CRTC Controller
  267. ;   
  268. ;   Input:
  269. ;            al    Index
  270. ;            ah    Data
  271. ; *************************************************************
  272.  
  273. Send_CRTC_Controller:
  274.  
  275. ; send the Index
  276. mov dx,3D4h
  277. out dx,al
  278.  
  279. ; send the Data
  280. mov al,ah
  281. inc dx
  282. out dx,al
  283.  
  284. ret
  285.  
  286.  
  287.  
  288.  
  289.  
  290. ; *************************************************************
  291. ;   Function: VBE Port I/O write
  292. ;   
  293. ;   Input:
  294. ;            al    Index
  295. ;            ah    Data
  296. ; *************************************************************
  297.  
  298. Write_VBE_Port:
  299.  
  300. ; write the Index
  301. mov dx,1CEh
  302. out dx,al
  303.  
  304. ; write the Data
  305. mov al,ah
  306. inc dx
  307. out dx,al
  308.  
  309. ret

Paste Details

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

worth-right
worth-right