  『楼 主』:
DOS的界面开发终结者
[已使用 LLM 解释]
我个人开发出了一个“WINSail” 软件,其完全是免费的一套软件,完整的
“库文件”、“头文件”“说明书”和“源代码”可在"www.FirstSail.B2B.Cn中下载得到。
它基于DOS系统,用Borland C++3.1语言,在Large大模式下开发出来的软件开发包。虽然说完整的软件包大约只有450K左右,却能在DOS下生成的程序具有与WIN9x完全相同的界面,拥有Group、Label、Edit、ComboBox、Button、Radio、Check、ListBox、Grid、ScrollBar、Desktop、ToolsBar、StatusBar、Menu、PopuMenu、Window、Dialog、ICON、Bitmap、示波器等界面元素,支持鼠标,控件的操作99.9%与Windows兼容!可加载运行脚本对话框;支持Socket套接字编程;具有完整窗口图形界面的最小应用只有150K左右,可在只有1M的电子盘中运行;具有0.5uS微秒精确度的delay函数。可以说 DOS + WinSail >= Windows CE
“WinSail工业控制开发系统”目前支持:
(1) “WinSail”的API与“C++ For DOS”函数库“共存”,特别是与C语言的图形函数BGI共存。
(2) 支持具有优先级的多任务,同时可达到50个任务。(注:可配置脚本文件来不需要多任务支持,使程序运行于单任务中) 。
(3) 支持数据库,生成的文件与Foxpro 2.6库兼容,可在微软Office的Excel中直接打开。
(4) 使用16*16的简体、繁体中文字库、8*16的英文字库,支持TrueType字库。
(5) “对话框”能在Visual C++预先做好界面,然后通过转换软件,能使Windows的对话框界面变成“WinSail”系统的对话框的界面代码源文件或脚本文件,充分利用Visual的优越性,使DOS平台的应用程序界面开发“不再难”!!!!!
(6) 支持600*480*16、600*400*256、800*600*256、1024*768*256多种分辩率。
(7) 支持Group、Label、Edit、ComboBox、Button、Radio、Check、ListBox、Grid、ScrollBar、Desktop、ToolsBar、StatusBar、Menu、PopuMenu、Window、Dialog、ICON、Bitmap、MessageBox、示波器、多元纵坐标示波器等界面元素。
(8) 支持扩展内存--XMS、扩充内存EMS的内存访问。
(9) 支持文本注册表--INI文件的读写,在写键值时,可保证在键值后面的“注释内容”仍然还存在。
(10) 支持面向对象的I/O访问,屏蔽底层I/O口。
(11) 具有COMM口通讯接口,支持多种校验位,包括“没有校验位”、“奇校验位”、“偶校验位”、“校验位永为1”、“校验位永为0”。后两种校验方式多用在多机通讯中区别“地址”和“数据”。
(12) 支持条形码显示。包括EAN_8、UPC_A、UPC_E、EAN_13(商品码)、ISBN、ISSN、39、128、Codabar、交叉25码
(13) 窗口支持“用I/O口定义的虚拟键盘”、“窗口定时器”、“空闲时调用某函数”、“窗口刷新时调用某函数”等多种回调函数。
(14) 多种常用数学运算,包括“低通”、“高通”、“带通”、“带阻”滤波器系数的产生(可加矩形窗、三角形窗、汉宁窗、海明窗、布莱克窗、Sin(x)/x窗、余弦窗、凯塞窗),滤波、插值、拟合、微积分、相关分析、FFT、DFT等。
(15) 统计进程SPC和直方图、测量的可靠性和重复性GageR&R报表。
(16) 支持“Bitmap”、“ICON”图像文件的显示、“Wav”声音文件的播放。
(17) 支持“普通示波器”和“多纵坐标示波器”。
(18) 支持Socket 套接字编程。
I have personally developed a software called "WINSail", which is a completely free set of software. The complete "library files", "header files", "instructions", and "source code" can be downloaded from "www.FirstSail.B2B.Cn". It is a software development package developed under the Large model using Borland C++ 3.1 language based on the DOS system. Although the complete software package is about 450K, the programs generated under DOS can have the exactly same interface as WIN9x, with interface elements such as Group, Label, Edit, ComboBox, Button, Radio, Check, ListBox, Grid, ScrollBar, Desktop, ToolsBar, StatusBar, Menu, PopuMenu, Window, Dialog, ICON, Bitmap, oscilloscope, etc. It supports the mouse, and the operation of controls is 99.9% compatible with Windows! It can load and run script dialog boxes; supports Socket socket programming; the smallest application with a complete window graphic interface is about 150K and can run in an electronic disk with only 1M; has a delay function with an accuracy of 0.5 microseconds. It can be said that DOS + WinSail >= Windows CE.
The "WinSail Industrial Control Development System" currently supports:
(1) The API of "WinSail" coexists with the "C++ For DOS" function library, especially coexists with the graphic function BGI of the C language.
(2) Supports multi-tasking with priorities, and can reach up to 50 tasks. (Note: The configuration script file can be used to not require multi-tasking support, so that the program runs in a single task.)
(3) Supports databases, and the generated files are compatible with Foxpro 2.6 libraries and can be directly opened in Microsoft Office's Excel.
(4) Uses 16*16 simplified and traditional Chinese character fonts, 8*16 English character fonts, and supports TrueType character fonts.
(5) The "dialog box" can be pre-made in Visual C++, and then through the conversion software, the Windows dialog box interface can be converted into the interface code source file or script file of the "WinSail" system, making full use of the superiority of Visual, so that the interface development of application programs on the DOS platform "is no longer difficult"!!!!!
(6) Supports multiple resolutions such as 600*480*16, 600*400*256, 800*600*256, 1024*768*256.
(7) Supports interface elements such as Group, Label, Edit, ComboBox, Button, Radio, Check, ListBox, Grid, ScrollBar, Desktop, ToolsBar, StatusBar, Menu, PopuMenu, Window, Dialog, ICON, Bitmap, MessageBox, oscilloscope, multi-ordinate oscilloscope, etc.
(8) Supports memory access to extended memory - XMS and expanded memory EMS.
(9) Supports reading and writing of text registry - INI files, and when writing key values, it can ensure that the "comment content" behind the key values still exists.
(10) Supports object-oriented I/O access and shields the underlying I/O ports.
(11) Has a COMM port communication interface and supports multiple parity bits, including "no parity bit", "odd parity bit", "even parity bit", "parity bit always 1", "parity bit always 0". The latter two parity methods are mostly used in multi-machine communication to distinguish "address" and "data".
(12) Supports barcode display. Including EAN_8, UPC_A, UPC_E, EAN_13 (product code), ISBN, ISSN, 39, 128, Codabar, cross 25 code.
(13) The window supports multiple callback functions such as "virtual keyboard defined by I/O port", "window timer", "call a function when idle", "call a function when the window is refreshed", etc.
(14) Multiple common mathematical operations, including the generation of coefficients of "low-pass", "high-pass", "band-pass", "band-stop" filters (rectangular window, triangular window, Hanning window, Hamming window, Blackman window, Sin(x)/x window, cosine window, Kaiser window can be added), filtering, interpolation, fitting, calculus, correlation analysis, FFT, DFT, etc.
(15) Statistical process SPC and histogram, measurement reliability and repeatability GageR&R report.
(16) Supports display of "Bitmap", "ICON" image files and playback of "Wav" sound files.
(17) Supports "ordinary oscilloscope" and "multi-ordinate oscilloscope".
(18) Supports Socket socket programming.
此帖被 +17 点积分 点击查看详情 | 评分人:【 redtek 】 | 分数: +2 | 时间:2006-11-7 21:17 | | 评分人:【 pengfei 】 | 分数: +5 | 时间:2006-11-15 22:28 | | 评分人:【 henrya2 】 | 分数: +4 | 时间:2007-4-30 23:30 | | 评分人:【 AlexZhang 】 | 分数: +4 | 时间:2007-8-6 09:41 | | 评分人:【 fqljwdyq 】 | 分数: +1 | 时间:2007-12-12 19:00 | | 评分人:【 153146156 】 | 分数: +1 | 时间:2008-6-1 02:12 |
|
LLM 解释
技术背景与实现机制分析
郭恒所提及的 “WinSail” 是 2000 年代初期中文 DOS 开发者尝试在实模式(Real Mode)环境下模拟图形用户界面(GUI)的典型代表。这类开发包(SDK)的核心目标是在资源受限的 DOS 环境下,为工业控制和嵌入式系统提供类似 Windows 9x 的操作体验。
1. 开发环境与内存模型
该系统基于 Borland C++ 3.1 并使用 Large 内存模型。
-
内存限制:在 Large 模式下,虽然代码和数据均可跨越 64KB 段限制,但受限于 DOS 实模式,总寻址空间仍被限制在 1MB 之内(除去上位内存等仅余约 600KB 常规内存)。
-
XMS/EMS 支持:由于 1MB 内存难以支撑高性能图形界面和多任务,系统通过支持扩展内存(XMS)和扩充内存(EMS)来存储非活跃数据、字库或位图资源,从而缓解常规内存压力。
2. 图形引擎与 BGI 兼容性
WinSail 能够与 BGI (Borland Graphics Interface) 函数库共存。
-
VGA/SVGA 驱动:BGI 默认仅原生支持至 VGA (640x480x16色)。若要实现文中提到的 800x600 或 1024x768 256色显示,通常需要加载第三方 BGI 驱动(如高性能的
SVGA256.BGI)或直接通过 VESA BIOS Extensions (VBE) 操作显存。
-
256色处理:在 256 色模式下,系统需要管理调色板(Palette)以确保 GUI 元素(如按钮阴影、图标)在不同显示模式下的视觉一致性。
3. 模拟多任务机制
文中提到的“50个具有优先级的任务”在 DOS 实模式下通常通过以下方式实现:
-
协作式多任务(Cooperative Multitasking):利用定时器中断(IRQ 0, Int 08h/1Ch)进行任务调度,或者在主事件循环中轮询。
-
上下文切换:通过保存和恢复 CPU 寄存器映像及堆栈指针来实现任务切换。由于 DOS 本身是非重入的(Non-reentrant),在多任务中调用 DOS 系统服务(如文件 I/O)时,通常需要处理
InDOS 标志或使用临界区保护。
4. UI 资源转换与 Visual C++ 兼容性
WinSail 提到可以转换 VC++ 的对话框资源,这是一种提高开发效率的工程手段:
-
资源解析:解析 Windows 的
.rc 文件或 .res 二进制文件,提取控件的坐标、类型和文本。
-
代码生成:将提取的元数据转换为 WinSail 能够识别的 C++ 源代码或自定义脚本。这种方式解决了 DOS 下缺乏可视化界面设计器(WYSIWYG)的痛点。
5. 工业控制特定功能
WinSail 并非纯粹的通用 GUI 库,其功能集高度向工业自动化(Industrial Automation)倾斜:
-
高精度 Delay:0.5μs 的延迟在 DOS 下通常通过读取 8253/8254 定时器芯片的计数器初值实现,而非依赖标准的系统时钟滴答(18.2Hz),从而达到微秒级精度。
-
信号处理:集成了 FFT、数字滤波器等数学库,表明其设计初衷是作为数据采集与监控系统(SCADA)的底层框架。
-
多机通讯:支持“校验位永为 1 或 0”的串口通讯(Mark/Space Parity),这是 8051 等单片机在多机模式(Multi-Processor Communication Mode)下区分地址帧与数据帧的标准做法。
6. 网络与数据库
-
Socket 编程:在 DOS 下实现 Socket 通常依赖于 Packet Driver 接口和第三方 TCP/IP 协议栈(如 WATTCP 或 Watt-32)。
-
DBF 兼容性:支持 FoxPro 2.6 (dBase IV 格式) 是因为该格式协议公开且结构简单,适合在嵌入式系统中作为轻量级数据库使用。
历史局限性说明
尽管 WinSail 在 UI 表现上力求接近 Windows,但受限于 16 位 DOS 环境,它在抢占式调度、内存保护以及驱动通用性上与 Windows 仍有本质区别。这类“DOS 界面终结者”在 2004 年左右处于其生命周期的尾声,随后逐渐被 Windows CE、嵌入式 Linux 或 32 位保护模式下的图形库(如 Allegro, GUILib)所取代。
|