|
zyl910
中级用户
  
积分 282
发帖 126
注册 2006-5-17
状态 离线
|
『第 31 楼』:
使用 LLM 解释/回答一下
其实,我的主要意思是这段话:
Originally posted by zyl910 at 2006-7-11 15:20:
而且现在是调用中断
时间主要耗在中断服务程序上
即此时的瓶颈是硬盘读写速度
Originally posted by asbai at 2006-7-11 20:46:
具体来说,使用了垃圾回收和自动存储管理;无类型变量;反射等机制的语言本身就是低效的。这样的语言即使直接编译成机器码也快不起来,有意思的是,这样做甚至会更慢,IBM知识库里有一篇文章专门测量了各种情况下,Java运行的效率:Weighing in on Java native compilation(http://www-128.ibm.com/developerworks/library/j-native.html)。
既然那些因素会影响程序效率,那为什么不绕开它呢。优化的技巧是多种多样的,必须结合平台和编程语言特性,扬长避短。
垃圾回收机制的确会影响性能,但它也有好处的。
先不用STL等数据结构库情况下用那些纯编译型的编程语言写个链表程序
再用Java、.Net写同样的程序(当然不是使用它们的类库,而是自己一个个地new出链表节点)
现在填充大量节点数据看看
你会郁闷的发现,那些纯编译的代码居然没有虚拟机速度快
这是因为,一般编程工具的内存分配函数调用的是操作系统的内存分配功能,而操作系统的堆分配函数本来就不是为分配大量小型对象服务的。所以许多数据结构经典教材会推荐我们自己写个内存分配器,专门处理链表节点这样的小型对象内存分配,这就是为什么现在推崇STL。
而那圾回收机制,最初就是为了解决这样的问题而设计的,能够应付i这样的大量小型对象分配问题。
其实我也不喜欢像Java、.Net,因为它们是专门为Web服务设计的,所以许多测试结果具有欺骗性。但就是因为这样,我曾经认真分析过它们性能。结果发现,对于现在那些编程初学者所接触的那些领域,Java、.Net已经优化到了极致,看起来似乎确实速度很快。而对于传统领域,那当然不能比的。
Last edited by zyl910 on 2006-7-11 at 22:25 ]
Actually, my main point is this passage:
Originally posted by zyl910 at 2006-7-11 15:20:
And now it's calling an interrupt.
The time is mainly consumed in the interrupt service routine.
That is, the bottleneck at this time is the hard disk read/write speed.
Originally posted by asbai at 2006-7-11 20:46:
Specifically, languages that use mechanisms such as garbage collection and automatic memory management; untyped variables; reflection, etc., are inherently inefficient. Such languages won't run fast even if directly compiled into machine code. Interestingly, they may even run slower. There is an article in the IBM Knowledge Base specifically measuring the efficiency of Java in various situations: Weighing in on Java native compilation (http://www-128.ibm.com/developerworks/library/j-native.html).
Since those factors affect program efficiency, why not bypass them? There are various optimization techniques, which must be combined with platform and programming language characteristics to make the best use of advantages and avoid disadvantages.
The garbage collection mechanism does affect performance, but it also has benefits.
First, write a linked list program using those purely compiled programming languages without using STL and other data structure libraries.
Then write the same program using Java, .Net (of course, not using their class libraries, but new-ing linked list nodes one by one).
Now fill in a large number of node data and see.
You will be depressed to find that those purely compiled codes are actually not faster than the virtual machine.
This is because the memory allocation functions of general programming tools call the operating system's memory allocation functions, and the operating system's heap allocation functions are not originally designed for allocating a large number of small objects. So many classic data structure textbooks recommend us to write our own memory allocator, specifically for memory allocation of small objects like linked list nodes. That's why STL is now advocated.
And the garbage collection mechanism was originally designed to solve such problems and can handle the allocation of a large number of small objects like this.
Actually, I don't like Java, .Net either because they are specifically designed for web services, so many test results are deceptive. But precisely because of this, I once carefully analyzed their performance. The result is that for those fields that current programming beginners are exposed to, Java, .Net have been optimized to the extreme, and they seem to be really fast. But for traditional fields, they naturally can't compare.
Last edited by zyl910 on 2006-7-11 at 22:25 ]
|

人类存在的目的就是试图理解人类为何存在 |
|
2006-7-11 22:23 |
|
|
DOSforever
金牌会员
     
积分 4639
发帖 2239
注册 2005-1-30
状态 离线
|
『第 32 楼』:
使用 LLM 解释/回答一下
我的印象中 BASIC 有解释型的也有编译型的,GWBASIC、QBASIC 就是解释型的,QuickBASIC 是编译型的,但 GWBASIC 在保存源程序的时候可以以P参数把源程序以加密的形式保存起来,即看到的不再是文本文件。不知 "zyl910" 所说的P代码是不是指的就是这个。QBASIC 好象没这个功能。QuickBASIC 我想应该是编译成独立的可执行文件,运行的时候不需要 QuickBASIC 的环境支持,由于我没用过,所以只是我想编译型的应该就是这样的。到底怎样,还是请咱们的 "qb45" 来说一下吧。呵呵
Re: gogo
不知你找到的 UDMA 驱动是哪里下的,确实是有一个 UDMA for DOS 的驱动只能用在 VIA 芯片组的主板上,因为它就是 VIA 开发的,不过已经很老了,在我694X的主板上都不能用。我目前用的 UDMA 驱动确实如 "johnsonlam" 所说的是 Jack Ellis 开发的。而且在它的说明中说
This is a set of four DOS UltraDMA hard-disk drivers. All the drivers run UltraDMA disk(s) on PC mainboards using a "South Bridge" controller chip from Intel, VIA, SiS, ALi and other vendors.
我用的是 UDMA.SYS 而不是 UDMA2.SYS 。现在,又试用了一下你最新改进过的程序(在你30楼的回帖之前),发现完全可以在我的内存配置环境下得到所要扇区的正确内容!而且没有感觉上的任何延迟。之前的延迟我认为还是和你的程序错误有关。不过我只测试了读,没测试写。呵呵。
顺便说一下,就种类型的小程序而言,我认为执行的速度与什么CPU速度,所使用的编程语言,甚至算法的关系不大。即使有也不是人可以感觉得到的。
另外我大致模模糊糊的看了一下你对不支持 Int13h ext 而用 CHS 方式处理的换算,如果我没理解错的话,你的换算是以假定每道扇区数为63,磁头数为255为基础的,严格的说这是不严密的,你怎么能肯定所有硬盘的每道扇区数都为63,磁头数都为255呢。至少在老硬盘(<8.4G)和新硬盘(>137G)上出现这样参数的可能性几乎没有。即使在这个范围以内的硬盘也只能说大多数的 BIOS 中的 HS 参数如此,因为很有可能由于种种原因,BIOS 识别该硬盘或该硬盘的分区表中的 CHS 参数不是以 LBA 方式识别出的参数出现的。这时候如果你还是以 H=255,S=63 的死参数去换算的话很可能读写的扇区不是所要的扇区。
In my impression, BASIC has both interpreted and compiled types. GWBASIC and QBASIC are interpreted, and QuickBASIC is compiled. But GWBASIC can save the source program in an encrypted form with the /P parameter when saving, that is, what is seen is no longer a text file. I wonder if the "P code" mentioned by "zyl910" refers to this. QBASIC doesn't seem to have this function. I think QuickBASIC should be compiled into an independent executable file, and it doesn't need the support of the QuickBASIC environment when running. Since I haven't used it, that's just my thought. The compiled type should be like this. Anyway, let's ask our "qb45" to talk about it. Hehe.
Re: gogo
I don't know where the UDMA driver you found is downloaded from. There is indeed a UDMA for DOS driver that can only be used on VIA chipset motherboards because it was developed by VIA, but it's already very old and can't be used on my 694X motherboard. The UDMA driver I'm currently using is indeed developed by Jack Ellis as said by "johnsonlam". And in its instructions it says
This is a set of four DOS UltraDMA hard-disk drivers. All the drivers run UltraDMA disk(s) on PC mainboards using a "South Bridge" controller chip from Intel, VIA, SiS, ALi and other vendors.
I'm using UDMA.SYS instead of UDMA2.SYS. Now, I tried the latest improved program you made again (before your post on floor 30), and found that it can completely get the correct content of the desired sector in my memory configuration environment! And there's no any perceived delay. The previous delay I thought was still related to the error in your program. But I only tested reading, not writing. Hehe.
By the way, for this type of small program, I think the execution speed has little to do with the CPU speed, the programming language used, and even the algorithm. Even if there is, it's not something people can feel.
In addition, I roughly and vaguely looked at your conversion for handling with CHS mode when Int13h ext is not supported. If I understand it correctly, your conversion is based on assuming that the number of sectors per track is 63 and the number of heads is 255. Strictly speaking, this is not rigorous. How can you be sure that the number of sectors per track of all hard disks is 63 and the number of heads is 255? At least the possibility of such parameters on old hard disks (<8.4G) and new hard disks (>137G) is almost zero. Even for hard disks within this range, it can only be said that most BIOSes have such HS parameters, because it's very possible that due to various reasons, the CHS parameters of the hard disk or its partition table recognized by the BIOS do not appear as the parameters recognized in LBA mode. At this time, if you still use the dead parameters of H=255 and S=63 for conversion, it's very possible that the sector read or written is not the desired sector.
|

DOS倒下了,但永远不死
DOS NEVER DIES !
投票调查:
http://www.cn-dos.net/forum/viewthread.php?tid=46187
本人尚未解决的疑难问题:
http://www.cn-dos.net/forum/viewthread.php?tid=15135
http://www.cn-dos.net/forum/viewthread.php?tid=47663
http://www.cn-dos.net/forum/viewthread.php?tid=48747 |
|
2006-7-11 22:50 |
|
|
GOTOmsdos
铂金会员
       C++启程者
积分 5154
发帖 1827
注册 2003-7-18
状态 离线
|
『第 33 楼』:
使用 LLM 解释/回答一下
TO DOSforever:
关于 UDMA:
为了获得跟你一样的问题,我特地下了一些DMA DOS 驱动,试了WENGIER的
UDMA。DYS。 加载后,一切正常,没有你说的错读扇区
下了个UDMA2,说是只用于VIA
不知道你用的是什么UDMA?
关于 扇区换算:
没错,我只是以 H=255,S=63 的参数 去处理的。 当然可能会遇到不兼容的情况,我也考虑过。。
其实,较完善的方式当然是先获取硬盘的参数,再根据此参数去读写
不过,这种 H=255,S=63的实用性还是很广的,大部分的老硬盘都支持,还有新硬盘也支持(因为,新硬盘的控制器,能翻译各种读写方式)
不过,如果老硬盘设成了不兼容H=255,S=63模式,那就有问题了。。
有时间再改进吧。。
关于 我改进过的程序解决了问题:
确实改善更新了好几次(解决了几个BUG),不过,目前还不知道,是哪里代码的改变,解决了你的这个问题。。
刚才 解决了 基本INT13出错提示不显示的BUG。。。很高兴,装上了坏硬盘,都能显示出错原因了!。。。
真想用你的UDMA试一下。。
不是WENGIER的UDMA。SYS 吗?
Last edited by GOTOmsdos on 2006-7-12 at 01:52 ]
TO DOSforever:
Regarding UDMA:
To get the same problem as you, I specially downloaded some DMA DOS drivers and tried WENGIER's UDMA. DYS. After loading, everything is normal, and there are no sector read errors as you mentioned.
Downloaded a UDMA2, which is said to be only for VIA.
I don't know which UDMA you are using?
Regarding sector conversion:
That's right, I just handled it with the parameters H=255, S=63. Of course, there may be incompatible situations, and I have also considered that..
In fact, the more complete way is, of course, to first obtain the hard disk parameters and then read and write according to this parameter.
However, the practicality of this H=255, S=63 is still very wide. Most old hard disks support it, and new hard disks also support it (because the controller of new hard disks can translate various reading and writing methods).
However, if the old hard disk is set to an incompatible H=255, S=63 mode, then there will be problems..
I'll improve it when I have time..
Regarding the problem solved by my improved program:
It has indeed been improved and updated several times (solved several bugs), but currently, I don't know which code change has solved your this problem..
Just now, I solved the bug that the basic INT13 error prompt was not displayed.. Very happy, I can display the error reason when installing a bad hard disk!..
Really want to try with your UDMA..
Isn't it WENGIER's UDMA. SYS?
Last edited by GOTOmsdos on 2006-7-12 at 01:52 ]
|
|
2006-7-12 01:45 |
|
|
asbai
高级用户
   
积分 653
发帖 252
注册 2006-4-16
状态 离线
|
『第 34 楼』:
使用 LLM 解释/回答一下
回zyl910兄:
既然那些因素会影响程序效率,那为什么不绕开它呢。优化的技巧是多种多样的,必须结合平台和编程语言特性,扬长避短。
■ 呵呵,让兄台见笑了,其实我这是有感而发。记得兄台说过汇编如果不用MMX和SSE等扩展指令,效率和VC比没优势,还举了一个完全使用不同算法的图像处理例子。当时就想说那是因为兄台的算法比起对手当算出神入化,并不是语言之间的公平比较。<img src="images/smilies/face-wink.png" align="absmiddle" border="0">
垃圾回收机制的确会影响性能,但它也有好处的。
先不用STL等数据结构库情况下用那些纯编译型的编程语言写个链表程序
再用Java、.Net写同样的程序(当然不是使用它们的类库,而是自己一个个地new出链表节点)
现在填充大量节点数据看看
你会郁闷的发现,那些纯编译的代码居然没有虚拟机速度快
这是因为,一般编程工具的内存分配函数调用的是操作系统的内存分配功能,而操作系统的堆分配函数本来就不是为分配大量小型对象服务的。
■ 兄台用的是什么编译器?竟然拥有不带 small heap 的 malloc 和 new ?
■ .net 里似乎没有指针,用它实现链表的话。。。。。
所以许多数据结构经典教材会推荐我们自己写个内存分配器,专门处理链表节点这样的小型对象内存分配,这就是为什么现在推崇STL。
■ STL的容器统统使用标准 operator new 分配空间,对于list来说是每对象调用一次,这方面并不比自己手写的代码有什么优势。只有一个例外是 sgistl 里的池分配策略,不过该策略只是一个备选分配策略,默认不启用,并且不是C++标准兼容的。
■ STL之所以被推崇,是因为它为面向算法的程序设计思想(泛型编程)提供了一个高效的、可扩展的、规范的设计框架。
■ 当年的经典教材之所以推荐写自己的memory pool,主要目的不仅仅是O(1)+的分配效率,更重要的是内存碎片问题。该问题在所有使用分页内存管理的系统中已解决。而且所有现代编译器的标准库里也都有了small heap。<img src="images/smilies/face-laugh.png" align="absmiddle" border="0">
而那圾回收机制,最初就是为了解决这样的问题而设计的,能够应付i这样的大量小型对象分配问题。
■ 解释型语言的垃圾回收算法是伴随着大面积内存扫描的,兄台想说的是预分配和small heap?
■ 垃圾回收的效率是如此的底,而且其内存开销又是如此的高。在C里即使每次内存分配都没有small heap的帮助而直接向操作系统申请内存,其效率也应该垃圾回收。当然,这里有两个问题需要考虑:
■1. 程序运行了多久:垃圾回收是一种轮询机制,在2种情况下,垃圾回收会启动:
1. 内存耗尽-扫描整个内存段以释放不再使用的存储。
2. 轮询间隔到时-扫描所有正在使用的内存段以释放不再需要的存储。
因为伴随着大量扫描,所以垃圾回收的效率相当低。不过,对于一个运行时间不长、内存开销不大的应用来说,因为以上2点恰好都没满足,所以看不出来它的低效。
■2. 正在使用的操作系统:像DOS这样对内存管理较差的系统,在没有small heap帮助时高密度分配小量内存可能确实会比较慢。不过现在没有small heap的标准库已经很少了,而且现代操作系统的页式内存管理机制对这样的情况效率也高很多。
其实我也不喜欢像Java、.Net,因为它们是专门为Web服务设计的,所以许多测试结果具有欺骗性。但就是因为这样,我曾经认真分析过它们性能。结果发现,对于现在那些编程初学者所接触的那些领域,Java、.Net已经优化到了极致,看起来似乎确实速度很快。而对于传统领域,那当然不能比的。
■ 呵呵,窃以为,对于初学者来说,主要错误都发生在算法和程序逻辑上。<img src="images/smilies/face-laugh.png" align="absmiddle" border="0">
■ 差点忘记一条重要说明:俺其实很喜欢java和basic,并且对basic感情尤其深厚(大部分人编程基本都是从basic开始学起吧)。这里没有贬低任何语言的意思,每种语言本身就是为了解决不同的问题诞生的(不过俺对.net比较反感,嘿嘿)。这里只是想说,公平的比较的话,说basic、java的运行效率可以达到与C/C++并肩的程度,个人感觉有欠妥当。
当然,从另一个角度讲,只比效率也不公平。时空效率本身就不是这些语言的强项,使用简便、构造快速、可移植性强、丰富的功能/控件库等等才是这些语言的强项。
Last edited by asbai on 2006-7-12 at 07:56 ]
Reply to Brother zyl910:
Since those factors can affect program efficiency, why not bypass them. There are various optimization techniques, which must be combined with the characteristics of the platform and programming language to make the best use of advantages and avoid disadvantages.
■ Hehe, let you laugh, actually I just have a feeling. I remember that you said that if assembly doesn't use extended instructions like MMX and SSE, it has no advantage in efficiency compared with VC, and also gave an example of image processing using a completely different algorithm. At that time, I wanted to say that it was because your algorithm was extremely brilliant compared to the opponent, not a fair comparison between languages. ;)
Garbage collection mechanism does affect performance, but it also has its benefits.
First, write a linked list program with those purely compiled programming languages without using STL and other data structure libraries.
Then write the same program with Java, .Net (of course, not using their class libraries, but newing linked list nodes one by one).
Now fill in a large number of node data and see.
You will be depressed to find that those purely compiled codes are actually not as fast as the virtual machine.
This is because the memory allocation functions of general programming tools call the operating system's memory allocation function, and the operating system's heap allocation function is not originally designed for allocating a large number of small objects.
■ What compiler are you using? How can it have malloc and new without small heap?
■ There seem to be no pointers in .net. If you implement a linked list with it...
So many classic data structure textbooks will recommend us to write our own memory allocator, specifically to handle the memory allocation of small objects like linked list nodes. That's why STL is currently advocated.
■ All containers in STL use the standard operator new to allocate space. For list, it's calling once per object. There's no advantage over the code written by ourselves in this regard. There's only one exception, which is the pool allocation strategy in sgistl, but that strategy is just an alternative allocation strategy, not enabled by default, and is not C++ standard compliant.
■ STL is advocated because it provides an efficient, extensible, and standardized design framework for algorithm-oriented programming ideas (generic programming).
■ The main purpose of the classic textbooks recommending writing your own memory pool back then was not just the O(1)+ allocation efficiency, but more importantly the memory fragmentation problem. This problem has been solved in all systems using paged memory management. And there are small heaps in the standard libraries of all modern compilers. :)
And the garbage collection mechanism was originally designed to solve such problems and can handle the allocation of a large number of small objects like this.
■ The garbage collection algorithm of interpreted languages is accompanied by large-scale memory scanning. Are you talking about pre-allocation and small heap?
■ The efficiency of garbage collection is so low, and its memory overhead is so high. In C, even if each memory allocation directly applies for memory from the operating system without the help of small heap, its efficiency should be better than garbage collection. Of course, there are two issues to consider here:
■1. How long the program runs: Garbage collection is a polling mechanism. Garbage collection will start in 2 situations:
1. Memory is exhausted - scan the entire memory segment to release unused storage.
2. The polling interval expires - scan all used memory segments to release unused storage.
Because it is accompanied by a large number of scans, the efficiency of garbage collection is quite low. However, for an application that doesn't run for a long time and has a small memory overhead, because the above two points are not met, the inefficiency is not noticeable.
■2. The operating system in use: For systems like DOS that have poor memory management, when allocating a large number of small amounts of memory without the help of small heap, it may indeed be relatively slow. But now there are very few standard libraries without small heap, and the paged memory management mechanism of modern operating systems is much more efficient for such situations.
Actually, I don't like Java, .Net either, because they are specially designed for Web services, so many test results are deceptive. But it's because of this that I once carefully analyzed their performance. The result is that for the fields that those beginner programmers are exposed to, Java, .Net have been optimized to the extreme, and they seem to be really fast. But for traditional fields, they can't compare, of course.
■ Hehe, I think that for beginners, the main mistakes all occur in algorithms and program logic. :)
■ Almost forgot an important note: Actually, I like java and basic very much, and have a special affection for basic (most people start learning programming with basic). There's no intention to belittle any language here. Each language is born to solve different problems (but I'm quite disgusted with .net, heh heh). Here I just want to say that in a fair comparison, it's improper to say that the running efficiency of basic, java can reach the level comparable to C/C++.
Of course, from another perspective, comparing only efficiency is also unfair. Time and space efficiency are not the strong points of these languages. Ease of use, fast construction, strong portability, rich function/control libraries, etc. are their strong points.
Last edited by asbai on 2006-7-12 at 07:56 ]
|
|
2006-7-12 04:41 |
|
|
qb45
高级用户
   
积分 677
发帖 194
注册 2003-9-13
状态 离线
|
『第 35 楼』:
使用 LLM 解释/回答一下
BASIC 有解释型的也有编译型的,GWBASIC、QBASIC 就是解释型的,QuickBASIC 是编译型的,我用的是版本是QuickBASIC4。5的版本,所以我给自己起网名就叫qb45,我只是一个爱好者,当初选择语言的时候,也是很犹豫,由于自己有工作,只是业余爱好编程,并不想当职业什么的,就选择了最简单的qb。
网友zyl910说的很对。确实编译成P代码。
对于一个使用者而言,可以说没有什么障碍。
在使用者眼中,qb可以编译成一个独立运行的EXE文件,也可以编译成需要qb库运行的程序。quick系列的basic支持中断调用、内嵌机器码,对于我这样的业余爱好者来说足够了。
我发现编程语言并不是主要的限制,对计算机原理、硬件、文件系统方面的深刻了解才能做出一些底层运用的软件
我的照片与简历希望大家能看看,最好能看完,谢谢大家。
http://www.programfan.com/club/showbbs.asp?id=82092
BASIC can be either interpreted or compiled. GWBASIC and QBASIC are interpreted, while QuickBASIC is compiled. I'm using QuickBASIC 4.5, so I chose the online name qb45. I'm just an enthusiast. When I chose the language, I was also hesitant. Since I have a job and only do programming as a hobby, I didn't want to make it a career, so I chose the simplest QB.
Netizen zyl910 is very right. It does compile to P-code.
For a user, there can be said to be no obstacles. From the user's perspective, QB can compile into an independently running EXE file or a program that requires the QB library to run. The Quick series of BASIC supports interrupt calls and embedded machine code, which is sufficient for an amateur enthusiast like me.
I find that the programming language is not the main limitation. A deep understanding of computer principles, hardware, and the file system is what enables making some low-level application software.
I hope everyone can take a look at my photos and resume. Thanks everyone.
http://www.programfan.com/club/showbbs.asp?id=82092
|

我(QB45)的照片与简历
http://www.programfan.com/club/showbbs.asp?id=197280
|
|
2006-7-12 08:38 |
|
|
wang6610
银牌会员
    
积分 1246
发帖 488
注册 2003-11-11
状态 离线
|
『第 36 楼』:
使用 LLM 解释/回答一下
谢谢GOTOmsdos制作的好东东!!!
Last edited by wang6610 on 2006-7-12 at 20:46 ]
Thanks to GOTOmsdos for the great stuff!!!
Last edited by wang6610 on 2006-7-12 at 20:46 ]
|
|
2006-7-12 11:45 |
|
|
crshen
中级用户
  
积分 447
发帖 126
注册 2004-2-10
状态 离线
|
『第 37 楼』:
使用 LLM 解释/回答一下
Originally posted by qb45 at 2006-7-12 08:38 AM:
BASIC 有解释型的也有编译型的,GWBASIC、QBASIC 就是解释型的,QuickBASIC 是编译型的,我用的是版本是QuickBASIC4。5的版本,所以我给自己起网名就叫qb45,栮..
你的那个页面还是不要宣传为好,对己对人都有以益。
完全同意楼上的看法,关于 轮子 的事情,能躲多远就躲多远,何必呢,自己倒无所谓,还连累家人。也没听说 洪战辉 是学这个的呀!
Originally posted by qb45 at 2006-7-12 08:38 AM:
BASIC has both interpreted and compiled versions. GWBASIC and QBASIC are interpreted, while QuickBASIC is compiled. The version I use is QuickBASIC 4.5, so I gave myself the online nickname qb45, er..
It's better not to promote your that page. It's beneficial to both yourself and others.
I completely agree with the view of the person above. Regarding the matter of "wheels", stay away as far as possible. Why bother? It doesn't matter to yourself, but it also affects family members. And I haven't heard that Hong Zhanhui is related to this!
|

从来不用别人的东西,要用,也先改成自己的再说! |
|
2006-7-12 20:52 |
|
|
GOTOmsdos
铂金会员
       C++启程者
积分 5154
发帖 1827
注册 2003-7-18
状态 离线
|
『第 38 楼』:
使用 LLM 解释/回答一下
程序作了较大更新了。。
更新的内容请参看主贴的补充。。
Last edited by GOTOmsdos on 2006-7-13 at 00:05 ]
The program has been updated significantly.
Please refer to the supplement in the main post for the updated content.
Last edited by GOTOmsdos on 2006-7-13 at 00:05 ]
|
|
2006-7-12 23:55 |
|
|
GOTOmsdos
铂金会员
       C++启程者
积分 5154
发帖 1827
注册 2003-7-18
状态 离线
|
『第 39 楼』:
使用 LLM 解释/回答一下
程序做了更新,估计能兼容老硬盘了!
也加入了读写 "非1.44mb"软盘的功能, 说明见主帖。。。
Last edited by GOTOmsdos on 2006-7-13 at 18:48 ]
The program has been updated, and it is estimated that it can be compatible with old hard drives! It has also added the function of reading and writing "non-1.44mb" floppy disks. The instructions are in the main post...
Last edited by GOTOmsdos on 2006-7-13 at 18:48 ]
|
|
2006-7-13 18:45 |
|
|
GOTOmsdos
铂金会员
       C++启程者
积分 5154
发帖 1827
注册 2003-7-18
状态 离线
|
『第 40 楼』:
使用 LLM 解释/回答一下
虽说更新为可读写老硬盘,老软盘(非1.44MB格式),单自己没有这些古董,试不了
如果谁有机会碰到的话,可以试一试,看看运行的情况怎样?
如果一切正常那当然好,如果有问题,就把出错贴出来,以便解决。。
Although it has been updated to be able to read and write old hard drives and old floppy disks (non-1.44MB format), but I don't have these antiques myself, so I can't test. If anyone has the opportunity to come across them, you can give it a try and see how it runs. If everything is normal, that's of course good. If there are problems, post the errors so that they can be solved.
|
|
2006-7-14 01:20 |
|
|
GOTOmsdos
铂金会员
       C++启程者
积分 5154
发帖 1827
注册 2003-7-18
状态 离线
|
『第 41 楼』:
使用 LLM 解释/回答一下
刚发现我的这个程序可以作为 GHOST 和HD-COPY 的迷你版 来使用
之所以叫迷你版,是因为:
GHOST:
本程序由于没有文件压缩功能(或分卷功能),所以最大只能处理4GB内的文件(也就是说,如果你要处理的分区在4GB内,就可以试用本程序了,当然你必须知道他的开始扇区位置和总扇区个数。。另外,如果是FAT16,那只能处理2GB内了)
HD-COPY:
HD-COPY有很多其他功能,而本程序只有读写主功能。
Last edited by GOTOmsdos on 2006-7-17 at 17:05 ]
I just discovered that my this program can be used as a mini version of GHOST and HD-COPY.
The reason it's called a mini version is because:
For GHOST:
This program has no file compression function (or volume splitting function), so it can only handle files within 4GB at most (that is to say, if the partition you want to handle is within 4GB, you can try this program. Of course, you must know its start sector position and total number of sectors. Also, if it's FAT16, it can only handle within 2GB)
For HD-COPY:
HD-COPY has many other functions, while this program only has the read-write main function.
Last edited by GOTOmsdos on 2006-7-17 at 17:05 ]
|
|
2006-7-17 14:58 |
|
|
GOTOmsdos
铂金会员
       C++启程者
积分 5154
发帖 1827
注册 2003-7-18
状态 离线
|
『第 42 楼』:
使用 LLM 解释/回答一下
哈哈,以后要解压镜象或制作镜象就用自己写的这个东东就解决啦!
好爽!
Haha, in the future, using this thing I wrote will solve the problem of extracting images or making images! So cool!
|
|
2006-7-17 17:18 |
|
|
GOTOmsdos
铂金会员
       C++启程者
积分 5154
发帖 1827
注册 2003-7-18
状态 离线
|
『第 43 楼』:
使用 LLM 解释/回答一下
刚刚把注释掉的代码全清理掉了,并整理了代码,补充了注释,用VC 的对齐功能对齐了,看起来清爽了。
更新了。
Just cleared all the commented-out code just now, sorted out the code, added comments, and aligned it using VC's alignment function. It looks cleaner. Updated.
|
|
2006-7-18 00:31 |
|
|
GOTOmsdos
铂金会员
       C++启程者
积分 5154
发帖 1827
注册 2003-7-18
状态 离线
|
『第 44 楼』:
使用 LLM 解释/回答一下
发现这个程序在获取老硬盘参数时的BUG,这个BUG导致读写老硬盘失败
已更正。
原BUG如下:
cylinder=regs.h.ch+1; /* 寄存器的 CH +1 为柱面数 应该是CL的高2位为高2位,CH的8位为低8位 */
sector=regs.h.cl; /* 寄存器的 CL 为每道扇区数 应该是 CL 的低6位 */
改为:
cylinder=((((unsigned int)regs.h.cl)>>6<<8) | regs.h.ch) + 1;
sector=regs.h.cl & 0x3F;
在取值时,没有用指针甚至一般运算,用高效而好玩的位运算。。
现在读写老硬盘就可以了。。
如果有老硬盘的,可以试玩试玩,我自己还没有呢。。
Last edited by GOTOmsdos on 2006-7-20 at 20:52 ]
I found a bug in this program when getting parameters of old hard drives. This bug caused failures in reading and writing old hard drives.
It has been corrected.
Original bug as follows:
cylinder=regs.h.ch+1; /* The CH +1 in the register is the number of cylinders. It should be that the high 2 bits of CL are the high 2 bits, and the 8 bits of CH are the low 8 bits */
sector=regs.h.cl; /* The CL in the register is the number of sectors per track. It should be the low 6 bits of CL */
Changed to:
cylinder=((((unsigned int)regs.h.cl)>>6<<8) | regs.h.ch) + 1;
sector=regs.h.cl & 0x3F;
When taking values, instead of using pointers or even general operations, efficient and fun bit operations are used.
Now reading and writing old hard drives can work. If you have an old hard drive, you can try it out. I don't have one myself yet.
Last edited by GOTOmsdos on 2006-7-20 at 20:52 ]
|
|
2006-7-20 18:08 |
|
|
GOTOmsdos
铂金会员
       C++启程者
积分 5154
发帖 1827
注册 2003-7-18
状态 离线
|
『第 45 楼』:
移除
使用 LLM 解释/回答一下
移除
Last edited by GOTOmsdos on 2006-7-22 at 14:58 ]
Remove
Last edited by GOTOmsdos on 2006-7-22 at 14:58 ]
|
|
2006-7-22 14:25 |
|
|