|
gemfield
初级用户
 
积分 33
发帖 13
注册 2009-3-11
状态 离线
|
『楼 主』:
int 10h的问题
使用 LLM 解释/回答一下
(纯dos下)程序调用int 10h后,屏幕输出英文字符,那么这个字符库的位置在哪里?在bios里吗?
假如现在加载了ucdos中文程序,屏幕输出汉字的时候,调用int10h和前面的纯dos英文输出调用int 10h有什么不一样吗?
谢谢!
(In pure DOS) After a program calls int 10h and outputs English characters on the screen, where is the location of this character library? Is it in the BIOS?
If now the UCDOS Chinese program is loaded, when outputting Chinese characters on the screen, what is the difference between calling int 10h and the previous pure DOS English output calling int 10h?
Thank you!
|
|
2009-4-10 11:59 |
|
|
zyl910
中级用户
  
积分 282
发帖 126
注册 2006-5-17
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
int 10h的‘1101h功能可以读取显卡的字库地址
--------V-101101-----------------------------
INT 10 - VIDEO - TEXT-MODE CHARGEN - LOAD ROM MONOCHROME PATTERNS (PS,EGA,VGA)
AX = 1101h
BL = block to load
Return: nothing
Notes: (see also AX=1100h)
This function will cause a mode set, completely resetting
the video environment, but without clearing the video buffer
the "monochrome" patters are 8x14 pixels in size
SeeAlso: AX=1100h,AX=1102h,AX=1103h,AX=1104h,AX=1111h,AH=1Bh,AX=CD10h
SeeAlso: MEM 0040h:0084h
Index: text mode;font|text mode;screen rows
--------V-101103-----------------------------
INT 10 - VIDEO - TEXT-MODE CHARGEN - SET BLOCK SPECIFIER (PS,EGA,VGA)
AX = 1103h
BL = block specifier (see #00020)
Return: nothing
Notes: (see also AX=1110h)
This function allows dual character sets to appear on screen
simultaneously
SeeAlso: AX=1100h,AX=1101h,AX=1102h,AX=1104h,AH=1Bh,AX=CD10h
SeeAlso: MEM 0040h:0084h
Index: text mode;font|text mode;screen rows
Bitfields for block specifier:
Bit(s) Description (Table 00020)
---EGA/MCGA---
0,1 block selected by characters with attribute bit 3 clear
2,3 block selected by characters with attribute bit 3 set
---VGA---
0,1,4 block selected by characters with attribute bit 3 clear
2,3,5 block selected by characters with attribute bit 3 set
--------V-101120-----------------------------
INT 10 - VIDEO - GRAPH-MODE CHARGEN - SET USER 8x8 GRAPHICS CHARS (PS,EGA,VGA)
AX = 1120h
ES:BP -> user table for INT 1F
Return: nothing
Note: this function is meant to be called immediately after a mode set;
results are unpredictable at other times
SeeAlso: AX=1121h,AX=1122h,AX=1123h,AX=1124h,AX=1129h,INT 1F"SYSTEM DATA"
SeeAlso: INT 43"VIDEO DATA"
--------V-101130-----------------------------
INT 10 - VIDEO - GET FONT INFORMATION (EGA, MCGA, VGA)
AX = 1130h
BH = pointer specifier
00h INT 1Fh pointer
01h INT 43h pointer
02h ROM 8x14 character font pointer
03h ROM 8x8 double dot font pointer
04h ROM 8x8 double dot font (high 128 characters)
05h ROM alpha alternate (9 by 14) pointer (EGA,VGA)
06h ROM 8x16 font (MCGA, VGA)
07h ROM alternate 9x16 font (VGA only) (see #00021)
11h (UltraVision v2+) 8x20 font (VGA) or 8x19 font (autosync EGA)
12h (UltraVision v2+) 8x10 font (VGA) or 8x11 font (autosync EGA)
Return: ES:BP = specified pointer
CX = bytes/character of on-screen font (not the requested font!)
DL = highest character row on screen
Note: for UltraVision v2+, the 9xN alternate fonts follow the corresponding
8xN font at ES:BP+256N
BUG: the IBM EGA and some other EGA cards return in DL the number of rows on
screen rather than the highest row number (which is one less).
SeeAlso: AX=1100h,AX=1103h,AX=1120h,INT 1F"SYSTEM DATA",INT 43"VIDEO DATA"
Format of alternate font table :
Offset Size Description (Table 00021)
00h BYTE character to be replaced (00h = end of table)
01h N BYTEs graphics data for character, one byte per scan line
INT 10h的‘1101h功能可以读取显卡的字库地址
--------V-101101-----------------------------
INT 10 - 视频 - 文本模式字符生成 - 加载ROM单色图案(PS、EGA、VGA)
AX = 1101h
BL = 要加载的块
返回:无
注意:(另见AX=1100h)
此功能将导致模式设置,完全重置视频环境,但不清除视频缓冲区
“单色”图案的大小为8x14像素
另见:AX=1100h,AX=1102h,AX=1103h,AX=1104h,AX=1111h,AH=1Bh,AX=CD10h
另见:内存0040h:0084h
索引:文本模式;字体|文本模式;屏幕行数
--------V-101103-----------------------------
INT 10 - 视频 - 文本模式字符生成 - 设置块说明符(PS、EGA、VGA)
AX = 1103h
BL = 块说明符(见#00020)
返回:无
注意:(另见AX=1110h)
此功能允许双字符集同时出现在屏幕上
另见:AX=1100h,AX=1101h,AX=1102h,AX=1104h,AH=1Bh,AX=CD10h
另见:内存0040h:0084h
索引:文本模式;字体|文本模式;屏幕行数
块说明符的位域:
位(s) 描述 (表00020)
---EGA/MCGA---
0,1 由属性位3为0的字符选择的块
2,3 由属性位3为1的字符选择的块
---VGA---
0,1,4 由属性位3为0的字符选择的块
2,3,5 由属性位3为1的字符选择的块
--------V-101120-----------------------------
INT 10 - 视频 - 图形模式字符生成 - 设置用户8x8图形字符(PS、EGA、VGA)
AX = 1120h
ES:BP -> 用于INT 1F的用户表
返回:无
注意:此功能应在模式设置后立即调用;在其他时间调用结果不可预测
另见:AX=1121h,AX=1122h,AX=1123h,AX=1124h,AX=1129h,INT 1F“系统数据”
另见:INT 43“视频数据”
--------V-101130-----------------------------
INT 10 - 视频 - 获取字体信息(EGA、MCGA、VGA)
AX = 1130h
BH = 指针说明符
00h INT 1Fh指针
01h INT 43h指针
02h ROM 8x14字符字体指针
03h ROM 8x8双点字体指针
04h ROM 8x8双点字体(高128个字符)
05h ROM alpha备用(9x14)指针(EGA、VGA)
06h ROM 8x16字体(MCGA、VGA)
07h ROM备用9x16字体(仅VGA)(见#00021)
11h(UltraVision v2+)8x20字体(VGA)或8x19字体(自动同步EGA)
12h(UltraVision v2+)8x10字体(VGA)或8x11字体(自动同步EGA)
返回:ES:BP = 指定指针
CX = 屏幕上字体的每个字符的字节数(不是请求的字体!)
DL = 屏幕上最高的字符行
注意:对于UltraVision v2+,备用9xN字体在ES:BP+256N处跟随相应的8xN字体
错误:IBM EGA和一些其他EGA卡返回DL为屏幕上的行数,而不是最高行号(最高行号少1)
另见:AX=1100h,AX=1103h,AX=1120h,INT 1F“系统数据”,INT 43“视频数据”
备用字体表的格式:
偏移量 大小 描述 (表00021)
00h BYTE 要替换的字符(00h = 表结束)
01h N BYTEs 字符的图形数据,每行一个字节
|

人类存在的目的就是试图理解人类为何存在 |
|
2009-4-10 23:07 |
|
|
zyl910
中级用户
  
积分 282
发帖 126
注册 2006-5-17
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
ucdos会替换掉int 10h的中断例程
当程序调用int 10h输出文字时,实际上调用的是ucdos的例程,ucdos分析文本中的中文字符,并在屏幕上画出
UCDOS will replace the interrupt routine of int 10h. When the program calls int 10h to output text, it actually calls the routine of UCDOS. UCDOS analyzes the Chinese characters in the text and draws them on the screen.
|

人类存在的目的就是试图理解人类为何存在 |
|
2009-4-10 23:10 |
|
|
gemfield
初级用户
 
积分 33
发帖 13
注册 2009-3-11
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
谢谢zyl910,看来int10h调用的字库位于显卡,那么dos在屏幕上输出字符一定是要调用int10h吗?比如pcdos 2000
Thanks zyl910. It seems that the font library for the int10h call is located on the graphics card. Then, does DOS necessarily need to call int10h to output characters on the screen? For example, PC-DOS 2000.
|
|
2009-4-12 09:35 |
|
|
zyl910
中级用户
  
积分 282
发帖 126
注册 2006-5-17
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
有两种方法可以在屏幕上输出文本——
1.int 10h
2.直接写文本区的显存
ucdos等中文平台不仅会替换int 10h,还会检测文本区的显存的变化,根据变化输出汉字
There are two methods to output text on the screen -
1. int 10h
2. Directly write to the video memory of the text area
Chinese platforms such as UCDOS not only replace int 10h but also detect changes in the video memory of the text area and output Chinese characters according to the changes
|

人类存在的目的就是试图理解人类为何存在 |
|
2009-4-12 10:33 |
|
|
netwinxp
高级用户
   
积分 741
发帖 366
注册 2007-7-25
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
简单地说UCDOS对调用INT 10H写屏和直接往显存(BXXX段)均有效,因为它会用定时中断监控文本模式显存,正因为酱紫所以UCDOS不适宜用在需要用定时中断的自控系统和时间要求严格的实时系统(UCDOS已经占用了比较长的定时中断时间,容易出现定时中断重入的问题)。
Simply put, UCDOS is effective for both calling INT 10H to write to the screen and directly accessing the video memory (segment BXXX), because it monitors the text mode video memory using a timer interrupt. Precisely because of this, UCDOS is not suitable for use in control systems that require a timer interrupt and real-time systems with strict timing requirements (UCDOS has already occupied a relatively long timer interrupt time, which is prone to the problem of timer interrupt reentrancy).
|
|
2009-4-12 14:09 |
|
|
gemfield
初级用户
 
积分 33
发帖 13
注册 2009-3-11
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
再次谢谢zyl910,你说的第二点“直接写文本区的显存”,意思是字库在文本区显存里吗?能不能将详细点,我不懂。pcdos 2000加载ucdos后,输出英文字符和汉字分别是使用哪一个功能?
netwinxp说的实时系统不适宜用ucdos,那么一般用什么?我的pcdos 2000上装了一个实时系统软件,我加载ucdos后在autoexec.bat里面echo汉字,汉字可以显示在屏幕上,但是实时软件里的文本字符(我把每两个英文字母的ascii码改成一个汉字的ascii码,比如4546改为b2be),但是屏幕上对应的都是乱码。(每个汉字位置都是一个L,那么四个汉字就是LLLL),这是为什么呢?
谢谢
Thanks again to zyl910. What you said about the second point "directly writing to the video memory of the text area" means that is the font library in the video memory of the text area? Can you explain it in more detail? I don't understand. Which functions does pcdos 2000 use to output English characters and Chinese characters after loading ucdos?
Netwinxp said that real-time systems are not suitable for using ucdos. Then what is generally used? I have installed a real-time system software on my pcdos 2000. After I load ucdos, I echo Chinese characters in autoexec.bat, and Chinese characters can be displayed on the screen. But the text characters in the real-time software (I changed the ASCII code of every two English letters to the ASCII code of one Chinese character, such as 4546 to b2be), but all corresponding on the screen are garbled. (Each Chinese character position is an L, so four Chinese characters are LLLL). Why is this?
Thanks
|
|
2009-4-13 01:47 |
|
|
zyl910
中级用户
  
积分 282
发帖 126
注册 2006-5-17
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
为了使CPU操作方便,显存(RAM) 及 显卡的BIOS(ROM) 会映射到系统内存空间,一般为——
(系统内存空间的)A0000h~AFFFFh:图像显存(RAM)
(系统内存空间的)B0000h~BFFFFh:文本显存(RAM)
(系统内存空间的)C0000h~C7FFFFh:显卡的BIOS(ROM)
显卡的字库一般放在显卡BIOS中,但是具体的地址只有显卡BIOS知道,所以应该使用int 10h的1101h功能得到显卡的字库地址
加载ucdos后,所有文本输出都由ucdos捕获,而不论英文、汉字
In order to make CPU operation convenient, the video memory (RAM) and the video card's BIOS (ROM) will be mapped to the system memory space. Generally:
The A0000h ~ AFFFFh of the system memory space: graphic video memory (RAM)
The B0000h ~ BFFFFh of the system memory space: text video memory (RAM)
The C0000h ~ C7FFFFh of the system memory space: video card's BIOS (ROM)
The character font of the video card is generally placed in the video card BIOS, but the specific address is only known by the video card BIOS, so the address of the video card's character font should be obtained using the 1101h function of int 10h
After loading ucdos, all text output is captured by ucdos, regardless of English or Chinese characters
|

人类存在的目的就是试图理解人类为何存在 |
|
2009-4-13 08:53 |
|
|
netwinxp
高级用户
   
积分 741
发帖 366
注册 2007-7-25
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
显卡的字库放在显卡的BIOS里面,不过这部分空间并不会映射到主内存的BIOS段(很多插卡的BIOS会一部分映射到内存ROM段),详细技术你可以参考长城0520H硬汉字库的技术。
***其实主板BIOS不仅会映射一部分到1M的ROM段,而且还会映射一部分到接近1G的内存段(主要是ACPI相关表),PCI板卡也是如此***
图形显存被映射到A0000H段仅对应于VGA模式(和少量早期SVGA,主要是TVGA),高分辨率模式一般被映射到D0000000~EFFFFFFF里面的1个到多个小分段并且每段具有多个页面深度(具体地址可以看显卡占用的资源),具体占多少看BIOS的AGPURE SIZE的值(这个设得越小,4G的可用RAM空间就会越多,不过显存页面深度就越深,会稍微影响显示性能)。
简单地说就是UCDOS的汉字捕获仅对于VGA的文本(和少量早期SVGA文本模式)有效,对于SVGA的文本模式无效;另外UCDOS里面的文本模式其实是UCDOS控制的伪文本模式,其实真正的模式已经是图形模式,所以退出UCDOS后很容易出现一堆乱闪的字符,需CLS一下才清静。
Last edited by netwinxp on 2009-4-13 at 09:52 ]
The font library of the graphics card is placed in the BIOS of the graphics card, but this part of the space is not mapped to the BIOS segment of the main memory (many BIOSes of expansion cards will have part of them mapped to the memory ROM segment). For detailed technology, you can refer to the technology of the Great Wall 0520H hard font library.
***In fact, the motherboard BIOS will not only map part of it to the 1M ROM segment, but also map part of it to the memory segment close to 1G (mainly ACPI-related tables), and the same is true for PCI cards***
The graphics video memory is mapped to the A0000H segment only corresponding to VGA mode (and a small number of early SVGA, mainly TVGA). High-resolution modes are generally mapped to one or more small segments in D0000000~EFFFFFFF and each segment has multiple page depths (specific addresses can be seen according to the resources occupied by the graphics card). The specific amount depends on the value of AGPURE SIZE in the BIOS (the smaller this is set, the more available RAM space of 4G will be, but the page depth of the video memory will be deeper, which will slightly affect the display performance).
Simply put, the Chinese character capture of UCDOS is only valid for VGA text (and a small number of early SVGA text modes), and invalid for SVGA text modes; in addition, the text mode in UCDOS is actually a pseudo-text mode controlled by UCDOS. In fact, the real mode is already a graphics mode, so it is easy to have a bunch of flashing characters after exiting UCDOS. You need to do CLS to be clear.
Last edited by netwinxp on 2009-4-13 at 09:52 ]
|
|
2009-4-13 09:47 |
|
|