|
LiveOnLove
中级用户
  
积分 493
发帖 161
注册 2002-10-29 来自 ZHCN
状态 离线
|
『第 46 楼』:
使用 LLM 解释/回答一下
是个难得的好东东!呵呵。非常感谢~
It's a rare good thing! Hehe. Thanks a lot~
|
|
2006-7-27 22:31 |
|
|
GOTOmsdos
铂金会员
       C++启程者
积分 5154
发帖 1827
注册 2003-7-18
状态 离线
|
『第 47 楼』:
使用 LLM 解释/回答一下
已做好了分卷,现在正想办法加入 压缩功能。。。
谁有好的又好移植的压缩/解压源码,介绍给我啊!。。。
The volume has been made, and now I'm trying to figure out how to add compression functions... Who has good and easily portable compression/decompression source code, introduce it to me...
|
|
2006-7-28 01:12 |
|
|
wang6610
银牌会员
    
积分 1246
发帖 488
注册 2003-11-11
状态 离线
|
|
2006-7-28 10:29 |
|
|
GOTOmsdos
铂金会员
       C++启程者
积分 5154
发帖 1827
注册 2003-7-18
状态 离线
|
『第 49 楼』:
使用 LLM 解释/回答一下
做GHOST2不可能,但主要功能还是能做的,主要是DIY啊
如果作好了压缩,我就用自己的程序备份硬盘和分区啦!
这种满足是无与伦比的!
It's impossible to do GHOST2, but the main functions can still be achieved, mainly DIY.
If the compression is done well, I will back up the hard disk and partitions with my own program!
This kind of satisfaction is unparalleled!
|
|
2006-7-28 10:52 |
|
|
GOTOmsdos
铂金会员
       C++启程者
积分 5154
发帖 1827
注册 2003-7-18
状态 离线
|
『第 50 楼』:
使用 LLM 解释/回答一下
刚成功地解决了 压缩引擎问题,下一步就是嵌入到我的程序中实现压缩功能了!
这几天,在国外的网上遨游,下了不下几十套源码!在几百个文件中穿梭!
终于找到了我要的!解决了我的问题
就是 zlib !
简要的过程如下:
1
试了,简单古老的
LZ, LZW,HUFFMAN,LZHUF,LZSS,LZHARC, LZ77,LZARI,LZRW1等等,都不理想,太老,效率太低,只能用来教学。。
2
看了 ARJ/UNARJ,有很多我不要的功能。。
3
曾定在 GZIP(BZIP2,基本差不多),很不错,也觉得有点适合我,压缩比和速度都很好,还有1-9的压缩比选项。。钻研了几天,发现没有内存压缩,只有文件压缩,。。。
4
看到一个提示: zlib 支持内存压缩!
确定它了!
(ZLIB和GZIP,PNG都采用相同的引擎:基于LZ77和HUFFMAN的结合,当然和前面提到的古老原始的版本是不可同日而语的)
在此过程中,与DDCOPY作者李治联系了。取得了DDCOPY源么,对我有启发。。
不过,试了DDCOPY的压缩,不太理想,豪时长,压缩比低。因为他采用的压缩/解压的类较简单,就两个文件(用简单的LZSS,胡颖卓编写的类,后来我也在网上看到了)
将要采用的压缩引擎是先进的最新版的 zlib-1.2.3 库(与GZIP,PNG图象用的同一个引擎),
压缩比和压缩速度很快,解压速度更快的离谱!
在WIN32 控制台程序中,压缩50MB,大约要20秒,压为了25MB。
解压只要大约3秒! 我靠!
还有 压缩比的1-9选项(类似GHOST)。。。
Last edited by GOTOmsdos on 2006-7-29 at 23:47 ]
Just successfully solved the compression engine problem, and the next step is to embed it into my program to implement the compression function!
In the past few days, I've been surfing the Internet abroad and downloaded no less than dozens of sets of source codes! I've been shuttling through hundreds of files!
Finally found what I was looking for! Solved my problem
It's zlib!
The brief process is as follows:
1
Tried, the simple and old ones like
LZ, LZW, HUFFMAN, LZHUF, LZSS, LZHARC, LZ77, LZARI, LZRW1, etc., are not ideal. They are too old and inefficient, only suitable for teaching.
2
Looked at ARJ/UNARJ, there are many functions I don't want.
3
Once set on GZIP (BZIP2 is basically similar), it's very good, and I also think it's a bit suitable for me. The compression ratio and speed are both good, and there are compression ratio options from 1 to 9. I studied it for a few days and found that there is no in-memory compression, only file compression...
4
Saw a hint: zlib supports in-memory compression!
Decided on it!
(ZLIB and GZIP, PNG all use the same engine: a combination based on LZ77 and HUFFMAN. Of course, it's incomparable with the ancient and original versions mentioned earlier)
In this process, I contacted Li Zhi, the author of DDCOPY. Got the DDCOPY source code, which inspired me.
However, the compression of DDCOPY was not ideal. It took a long time and the compression ratio was low. Because the compression/decompression classes he used were relatively simple, just two files (using simple LZSS, the class written by Hu Yingzhuo, and later I also saw it on the Internet)
The compression engine to be adopted is the advanced latest version zlib-1.2.3 library (the same engine as GZIP, PNG images)
The compression ratio and compression speed are very fast, and the decompression speed is ridiculously fast!
In a WIN32 console program, compressing 50MB takes about 20 seconds, and compresses it to 25MB.
Decompression only takes about 3 seconds! Oh my god!
There are also compression ratio options from 1 to 9 (similar to GHOST)...
Last edited by GOTOmsdos on 2006-7-29 at 23:47 ]
|
|
2006-7-29 23:33 |
|
|
wang6610
银牌会员
    
积分 1246
发帖 488
注册 2003-11-11
状态 离线
|
『第 51 楼』:
使用 LLM 解释/回答一下
Originally posted by GOTOmsdos at 2006-7-29 11:33 PM:
刚成功地解决了 压缩引擎问题,下一步就是嵌入到我的程序中实现压缩功能了!
这几天,在国外的网上遨游,下了不下几十套源码!在几百个文件中 ...
你真牛。。。
Originally posted by GOTOmsdos at 2006-7-29 11:33 PM:
Just successfully solved the compression engine problem, and the next step is to embed it into my program to implement the compression function!
In the past few days, I've been surfing the Internet abroad and downloaded no less than dozens of sets of source codes! Among hundreds of files...
You're really awesome...
|
|
2006-7-30 08:28 |
|
|
johnsonlam
银牌会员
     阿林
积分 1410
发帖 497
注册 2004-6-28 来自 九龍,香港
状态 离线
|
『第 52 楼』:
使用 LLM 解释/回答一下
Originally posted by GOTOmsdos at 2006-7-29 11:33 PM:
刚成功地解决了 压缩引擎问题,下一步就是嵌入到我的程序中实现压缩功能了!
这几天,在国外的网上遨游,下了不下几十套源码!在几百个文件中 ...
外 国 的 好 东 西 多 着 呢 !
这 令 我 觉 得 好 幸 福 , 可 分 享 他 人 的 成 果
也 觉 得 某 些 国 人 不 肯 分 享 , 真 悲 哀 ...
Originally posted by GOTOmsdos at 2006-7-29 11:33 PM:
Just successfully solved the compression engine problem, and the next step is to embed it into my program to implement the compression function!
In the past few days, I've been surfing the foreign Internet and downloaded no less than dozens of sets of source codes! Among hundreds of files...
There are many good things abroad!
This makes me feel so happy, and I can share the fruits of others
I also feel that some Chinese people are not willing to share, really sad...
|

我 的 網 站 - http://optimizr.dyndns.org
|
|
2006-7-31 00:32 |
|
|
GOTOmsdos
铂金会员
       C++启程者
积分 5154
发帖 1827
注册 2003-7-18
状态 离线
|
『第 53 楼』:
使用 LLM 解释/回答一下
完全解决拉!
已经成功放入纯DOS程序中,被调用,运行结果正确!
并且,令人激动的是:所采用的 ZLIB库的表现相当棒!
刚才,测试结果:
压缩备份:
压缩1000000个扇区(500MB),采用6级(最高9级)就能压为312MB !
(如用9级,大约能压到 250-280之间!)
而且用时仅12分钟!大约一秒钟1MB!(跟GHOST速度差不多!)
而且是读一个很老的2GB的硬盘!
(注意:由于GHOST不处理没有文件的的数据,所以,在备份分区时,所化的总时间自然就很少了。毕竟他不是整个扇区的全真备份。我的程序是的)
解压还原:
解压就快的离谱拉!
把压缩的景象文件(原500MB)解压后还原到硬盘上,大约1分钟左右!
简直不敢相信!这个ZLIB 的解压作者是 Mark Adler,真是牛!
他好象也美国火星计划的研究人员。。
现正在整理程序。进入最后阶段。。。
大概两三天能出来。。。
(DDCOPY 作者李治帮过我,由于我的程序采用了高效的压缩/解压库,出与感谢,我会把我的程序寄给他,希望在更加优越的压缩/解压方面,供他借鉴。。我会很高兴。。)
Last edited by GOTOmsdos on 2006-8-1 at 21:01 ]
It's completely solved!
It has been successfully put into the pure DOS program, called, and the running result is correct!
And, what's exciting is: the performance of the adopted ZLIB library is quite excellent!
Just now, the test result:
Compression backup:
Compress 1000000 sectors (500MB), using level 6 (up to level 9) can compress to 312MB!
(If using level 9, it can be compressed to about 250 - 280!)
And it only takes 12 minutes! About 1MB per second! (Almost the same speed as GHOST!)
And it's reading a very old 2GB hard disk!
(Note: Since GHOST doesn't handle data without files, so when backing up the partition, the total time naturally is very little. After all, it's not a full-sector true backup. Mine is.)
Decompression restoration:
Decompression is extremely fast!
Decompress the compressed image file (original 500MB) and restore it to the hard disk, about 1 minute!
Simply can't believe it! The author of this ZLIB decompression is Mark Adler, really awesome!
He seems to be a researcher of the US Mars program..
Now I'm organizing the program. Entering the final stage...
Probably can come out in two or three days...
(The author of DDCOPY, Li Zhibang, helped me. Since my program adopted an efficient compression/decompression library, out of gratitude, I will send my program to him, hoping to provide him with reference in more superior compression/decompression. I will be very happy..)
Last edited by GOTOmsdos on 2006-8-1 at 21:01 ]
|
|
2006-8-1 20:56 |
|
|
troylees
初级用户
 
积分 54
发帖 19
注册 2006-7-31
状态 离线
|
『第 54 楼』:
使用 LLM 解释/回答一下
GOTOmsdos你好!
我看过了你写的源代码,心里就两个字"高手"。
不过,我有个问题,如果我用DJGPP编译的话,ExInt13函数中用到的FP_OFF和FP_SEG宏都是只有TC才有的定义,请问在DJGPP下怎么解决呢?
谢谢!!
GOTOmsdos Hello!
I have read the source code you wrote, and there are just two words in my heart: "expert".
However, I have a question. If I compile with DJGPP, the FP_OFF and FP_SEG macros used in the ExInt13 function are only defined in TC. How to solve this under DJGPP?
Thank you!
|
|
2006-8-5 23:41 |
|
|
GOTOmsdos
铂金会员
       C++启程者
积分 5154
发帖 1827
注册 2003-7-18
状态 离线
|
『第 55 楼』:
使用 LLM 解释/回答一下
程序加入了扇区到扇区方式的读写,也加了一些功能,完善了。。。
又更新了 !。。
TO troylees
你查一下TC3 的HELP
感谢关注,高手谈不上啊
FP_OFF
和FP_SEG
是宏
FP_OFF没什么, 替换成他的内容
FP_SEG 的内容 跟 _seg 有关 不知道 DJGPP 是否支持
如果不行,也没大关系
可直接把 那个扩展INT13的 结构体的指针 直接赋值 给那个寄存器变量也可以的,我原来就是这样的(运行结果正确,。后 考虑到规范,才改成这样的)
ZLIB中原带了 MAKEFILE FOR DJGPP2 的文件,我一起加进去吧。。。
The program has added sector - by - sector reading and writing, and some functions have been improved...
Updated again!..
TO troylees
Please check the HELP of TC3.
Thank you for your attention, I'm not a master.
FP_OFF
and FP_SEG
are macros.
FP_OFF is nothing, replace it with its content.
The content of FP_SEG is related to _seg. I don't know if DJGPP supports it.
If it doesn't work, it's not a big deal.
You can directly assign the pointer of that extended INT13 structure to that register variable. I was originally like this (the running result is correct. Later, considering standardization, I changed it like this).
There is a MAKEFILE FOR DJGPP2 file originally in ZLIB, I will add it together...
|
|
2006-8-6 18:40 |
|
|
GOTOmsdos
铂金会员
       C++启程者
积分 5154
发帖 1827
注册 2003-7-18
状态 离线
|
『第 56 楼』:
使用 LLM 解释/回答一下
将要添加如下功能:
1
支持古董级硬盘(不支持扩展INT13)的压缩分卷
2
四个主分区的读写(此功能,只有C有实用意义,因为,一般用户都把很多盘弄成了扩展分区的逻辑驱动器了)
Last edited by GOTOmsdos on 2006-8-6 at 21:52 ]
The following functions will be added:
1
Support for compressed multi - volume for antique hard drives (does not support extended INT13)
2
Reading and writing of four primary partitions (this function is only meaningful for C because generally users have made many disks into logical drives of extended partitions)
Last edited by GOTOmsdos on 2006-8-6 at 21:52 ]
|
|
2006-8-6 20:58 |
|
|
GOTOmsdos
铂金会员
       C++启程者
积分 5154
发帖 1827
注册 2003-7-18
状态 离线
|
『第 57 楼』:
使用 LLM 解释/回答一下
刚才更新的代码中,有个小错误 CASE :
现在已改过来重传了
There was a small error in the code updated just now in the CASE: It has now been corrected and reuploaded.
|
|
2006-8-6 22:20 |
|
|
troylees
初级用户
 
积分 54
发帖 19
注册 2006-7-31
状态 离线
|
『第 58 楼』:
使用 LLM 解释/回答一下
To:GOTOmsdos
Tc定义如下:
#define FP_OFF(fp) ((unsigned)(fp))
#define FP_SEG(fp) ((unsigned)((unsigned long)(fp) >> 16))
可以看出,TC编译的程序是用16位地址的,而djgpp编译的是用32位地址的。
所以,如果in.x.si =(unsigned long) (&DAP_package)这样还可以,但是sregs.ds = (unsigned long) (&DAP_package)这样就不行了,一个是16位,一个是32位。
所以,我觉得直接赋值应该是不可以的!!
To:GOTOmsdos
The Tc is defined as follows:
#define FP_OFF(fp) ((unsigned)(fp))
#define FP_SEG(fp) ((unsigned)((unsigned long)(fp) >> 16))
It can be seen that the program compiled by TC uses 16-bit addresses, while the program compiled by djgpp uses 32-bit addresses.
So, if in.x.si = (unsigned long) (&DAP_package) is okay, but sregs.ds = (unsigned long) (&DAP_package) is not okay, one is 16-bit and the other is 32-bit.
So, I think direct assignment should not be possible!
|
|
2006-8-6 23:14 |
|
|
GOTOmsdos
铂金会员
       C++启程者
积分 5154
发帖 1827
注册 2003-7-18
状态 离线
|
『第 59 楼』:
使用 LLM 解释/回答一下
不是 sregs.ds = (unsigned long) (&DAP_package)
是 reg.x.si =&DAP_package
这样一般就可以的,我试过的。。
It's not sregs.ds = (unsigned long) (&DAP_package)
It's reg.x.si = &DAP_package. Usually this will be okay, I've tried it.
|
|
2006-8-7 02:22 |
|
|
troylees
初级用户
 
积分 54
发帖 19
注册 2006-7-31
状态 离线
|
『第 60 楼』:
使用 LLM 解释/回答一下
To: dear all
问题终于解决了,是因为传统的中断调用只能访问低地址1M的内存,而DPMI下保护模式的DOS程序的缓冲区地址可能会超过1M,所以解决办法是,使用DJGPP预定义的低地址缓冲区,他的地址定义在“__tb”,然后用dosmemput和dosmemget函数实现低地址和高地址缓存区的数据交换操作。 详细看看这里 http://www.delorie.com/djgpp/v2faq/faq18_2.html
To: dear all
The problem is finally solved. It is because the traditional interrupt calls can only access the low-address 1M memory, and the buffer address of the DOS program in protected mode under DPMI may exceed 1M. So the solution is to use the low-address buffer predefined by DJGPP. Its address is defined as "__tb", and then use the dosmemput and dosmemget functions to realize the data exchange operation between the low-address and high-address buffers. For details, please take a look here http://www.delorie.com/djgpp/v2faq/faq18_2.html
|
|
2006-8-8 12:28 |
|