使用Vesa2

Q:图形方式下,在进入保护模式后、分页前,可以正常直接写屏,线性地址为:0xE0000000
开启分页后,我没有把0xE0000000映射到物理内存上,不能把数据写到该地址
而映射好后,写到物理内存了,但屏幕上却没反映。
我该怎么做?
A: 若你映射正确,那么屏幕上总会出现一些痕迹。估计你映射错了地方。
Accessing Linear Framebuffer Memory
Once you have initialized the graphics hardware into a mode that supports a hardware linear
framebuffer, you need to create a pointer that your application can use to write to the linear
framebuffer memory. The first thing you should realize is that the linear framebuffer location
reported in
the ModeInfoBlock for the mode you are using is a physical memory address, and
cannot be used directly from protected mode applications. Before you can use the memory you
must use the services your operating system provides to map the physical memory to a linear
memory address, and then map this linear address into your applications memory space. Under
DPMI mapping the linear memory is done with DPMI function 0x800, and equivalent functions
exist under other operating systems.
The steps involved in mapping in a linear framebuffer region are as follows (32-bit protected
mode only):
1. Map the physical memory address to a linear memory address (using DPMI function
0x800 for example).
2. Find the base address of the default DS selector for your operating environment.
3. Subtract the base address from the linear address computed in step 1 to give you a
near pointer (relative to DS) that you can use from within your code.

以上所讲的Linear Framebuffer memory,是物理地址,开启分页后不能影响地址的对应关系,也就是说如果分页前Linear Framebuffer memory是0xE0000000(不要怀疑,确实是那么大的值),那分页后访问0xE0000000就应该通过页表映射到物理地址0xE0000000。

总结:
1.调试时在Bochs机上通过,而Vmware不行,为什么?
测试是在Bochs上进行的,因为调试方便。此时看到Linear Frambuffer memory是0xE0000000,于是就自作主张,在程序里向这个地址写0xFF00,果然有效。但用Vmware,嗯?怎么还是一片黑黑的?过了好几天,才明白过来:Vmware里的Linear Framebuffer memory不是0xE0000000!!!

2.终于调试完成。哎,最后Vmware上没试过,但想想应该是可以了的。
原来VESA告诉我的0xE0000000不是线性地址,是真实的物理地址,那段英文也说了,是physical memory!
所以我们要把分页后的程序地址0xE0000000映射到物理地址0xE0000000!弄好后bochs就可以了。
因为Vmware上的VESA告诉的物理地址不是0xE0000000,所以在Vmware上运行不通过。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Intellectual Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9 Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9 Patents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9 Support for this Standard. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11 Acknowledgments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11 Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13 Section 1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 1.1 Document Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15 1.2 Display Stream Compression Objectives. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16 1.3 Display Stream Compression Versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .16 1.4 Acronyms, Initialisms, and Abbreviations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17 1.5 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 1.6 Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 1.6.1 Bit Ordering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 1.6.2 Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 1.7 Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 1.8 Reference Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 Section 2 Requirements (Informative) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Section 3 Theory of Operation (Informative). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 3.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 3.2 Color Space Conversion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 3.3 Prediction and Quantization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 3.3.1 Modified Median-Adaptive Prediction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 3.3.2 Block Prediction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31 3.3.3 Midpoint Prediction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32 3.4 Indexed Color History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33 3.5 Bitstream Construction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34 3.5.1 Substream Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34 3.5.2 Substream Multiplexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .36 3.6 Rate Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38 3.7 Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39 3.7.1 Hypothetical Reference Decoder-Based Timing Model . . . . . . . . . . . . . . . . . .39 3.7.2 Constant and Variable Bit Rate Modes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41 3.7.3 Slices and Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42 3.8 Options for Slices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45 3.9 Slice Multiplexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .46VESA Display Stream Compression (DSC) Standard UNAUTHORIZED DISTRIBUTION PROHIBITED Version 1.2a Copyright © 2014 – 2017 V

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值