|
johnsonlam
银牌会员
     阿林
积分 1410
发帖 497
注册 2004-6-28 来自 九龍,香港
状态 离线
|
『第 16 楼』:
使用 LLM 解释/回答一下
Originally posted by 不点 at 2007-1-23 07:50 AM:
我自己有一个不成熟的见解,叙述如下。我对 DOS 并不熟悉,然而同时我又觉得 DOS 的体积不是特别吓人,所以,它有可能被我们肢解。
看 Wengier 說 才 知 道 你 是 GRUB for DOS 的 作 者 , 這 就 真 是 謙 虛 了 , 你 知 的 比 許 多 人 還 要 多 。
首先,我发现 DOS 的启动过程就很神秘。我觉得我们应该成立一个分支小组,研究 MS- DOS 的启动。就是说,逐条分析它的启动代码。然后剥离出真正属于内核的部分。
那 就 要 反 向 匯 編 囉 ...
其 實 也 可 參 考 FreeDOS 的 源 碼 , 瞭 解 "怎 樣 去 啟 動" 比 純 粹 複 製 更 有 意 義
LZ-DOS 我还是首次听说,谢谢,我觉得这很好。如果它能够支持 win.com 的运行,我们可以从它入手来研究。我们不抄袭它,但是,我认为,我们研究微软隐藏了的秘密,这不构成侵权。
wengier 已经把 200 多 KB 的 IO 减小了一半。我觉得这一半之中应该还有很多是累赘,比如说,纯粹是加密用的,故意不让人理解的。我们把它 “脱壳” 以后,就可以现出 真正的 DOS 内核的原型了。
其 實 要 完 全 不 侵 權 , 只 有 從 FreeDOS 入 手 , 因 為 反 向 匯 編 也 是 不 妥 當 的 , 但 是 單 從 學 習 而 不 去 複 製 , 卻 又 是 GNU 精 神
LZ-DOS 是 改 良 了 核 心 的 MS-DOS 7.10 ( Win98SE 啟 動 部 份 ) , 俄 國 人 只 拿 掉 了 他 們 認 為 沒 有 用 的 東 西 ( 可 能 是 Win98SE GUI 部 份 )
当然了,ralf brown 的 interrupt list 很好。我们可以检验 FreeDOS 是否完整实现了这个 list 中的功能,如果有什么缺失的,我们可以打补丁,完善它,这样也有可能让 FreeDOS 能够运行 win.com。
加 入 FreeDOS 是 不 可 行 的 , 因 為 那 兒 的 開 發 人 員 不 齊 心 , 借 用 文 件 內 的 知 識 就 可 以
总之,这个工程很庞大,需要大家一起做。每个人都可以从不同的角度入手,以不同的切入点开始做。然后,大家交流经验,互相取长补短,互相借鉴。
好了,我也就是这么一个想法而已,也算是我对这个提议的一个贡献。
很 好 , 但 還 是 要 有 個 領 導 , 要 組 織 開 發 和 測 試 班 子
Originally posted by Buddha doesn't light at 2007-1-23 07:50 AM:
I have a immature opinion by myself, and describe as follows. I'm not familiar with DOS, however, I also feel that the volume of DOS is not particularly frightening, so, it is possible that we dissect it.
Only after seeing what Wengier said did I know that you are the author of GRUB for DOS, which is really modest. You know more than many people.
First of all, I find that the booting process of DOS is very mysterious. I think we should form a branch team to study the booting of MS-DOS. That is to say, analyze its booting code item by item. Then strip out the parts that truly belong to the kernel.
Then it is to reverse assemble...
In fact, we can also refer to the source code of FreeDOS. Understanding "how to boot" is more meaningful than purely copying.
I have just heard of LZ-DOS for the first time. Thank you. I think this is very good. If it can support the running of win.com, we can start our research from it. We don't copy it, but, I think, we study the secrets hidden by Microsoft, which does not constitute infringement.
Wengier has reduced the IO of more than 200 KB by half. I think there should still be a lot of superfluous things in this half, for example, purely for encryption, deliberately making it incomprehensible. After we "unpack" it, we can reveal the prototype of the real DOS kernel.
In fact, to be completely non-infringing, we can only start from FreeDOS, because reverse assembly is also inappropriate, but learning from it without copying is the spirit of GNU.
LZ-DOS is an improvement of the core MS-DOS 7.10 (the booting part of Win98SE). Russians only removed what they thought was useless (probably the Win98SE GUI part).
Of course, ralf brown's interrupt list is very good. We can check whether FreeDOS fully implements the functions in this list. If there are any omissions, we can make patches to improve it. In this way, it is also possible to make FreeDOS run win.com.
It is not feasible to join FreeDOS, because the developers there are not of one mind. We can just borrow the knowledge in the files.
In short, this project is very huge and needs everyone to do it together. Everyone can start from different angles and different entry points. Then, everyone exchanges experiences, learns from each other's strengths, and learns from each other.
Well, that's just my idea, and it can be regarded as my contribution to this proposal.
Very good, but there still needs a leader to organize the development and testing team.
|

我 的 網 站 - http://optimizr.dyndns.org
|
|
2007-1-27 14:03 |
|
|
johnsonlam
银牌会员
     阿林
积分 1410
发帖 497
注册 2004-6-28 来自 九龍,香港
状态 离线
|
『第 17 楼』:
使用 LLM 解释/回答一下
Originally posted by 不点 at 2007-1-24 07:46 AM:
我希望有人出面来维护这个项目,但是,如果实在没人能够出面的话,其实,不用领头羊,一群羊也能前进。
恕 冒 犯 ...
"一 群 羊 各 就 各" 這 就 是 FreeDOS 的 過 程 , 整 整 10 年 兼 容 度 還 比 不 起 一 個 LZ-DOS ... 分 工 合 作 是 很 重 要 的 , 否 則 就 變 成 FreeDOS 膠 著 的 現 狀
Originally posted by Budian at 2007-1-24 07:46 AM:
I hope someone comes forward to maintain this project. However, if really no one can come forward, actually, without a leader, a flock of sheep can also move forward.
Excuse me...
"The flock of sheep each take their own place" is the process of FreeDOS. For a full 10 years, its compatibility is still not as good as a LZ-DOS... Division of labor and cooperation is very important, otherwise it will become the sticky situation of FreeDOS
|

我 的 網 站 - http://optimizr.dyndns.org
|
|
2007-1-27 14:08 |
|
|
johnsonlam
银牌会员
     阿林
积分 1410
发帖 497
注册 2004-6-28 来自 九龍,香港
状态 离线
|
『第 18 楼』:
使用 LLM 解释/回答一下
Originally posted by 不点 at 2007-1-27 08:34 AM:
我下载了 LZ-DOS,它的 IO.SYS 很小,只有 74 KB。难道没有人用用吗?真是可惜了!
Lucho 的 單 軟 盤 版 就 有 LZ-DOS + E.DR-DOS 雙 內 核 ...
還 有 QCACHE, QHIMEM, QCDROM, AEFDISK, FM 等 工 具
http://johnson.tmfc.net/dos/lucho.html
Originally posted by Buddha</i> at 2007-1-27 08:34 AM:
I downloaded LZ-DOS, and its IO.SYS is very small, only 74 KB. Is there really no one using it? What a pity!
Lucho's single-floppy version has the dual kernel of LZ-DOS + E.DR-DOS...
Also has tools such as QCACHE, QHIMEM, QCDROM, AEFDISK, FM, etc.
http://johnson.tmfc.net/dos/lucho.html
|

我 的 網 站 - http://optimizr.dyndns.org
|
|
2007-1-27 14:13 |
|
|
Wengier
系统支持
             “新DOS时代”站长
积分 27736
发帖 10521
注册 2002-10-9
状态 离线
|
『第 19 楼』:
使用 LLM 解释/回答一下
Originally posted by johnsonlam at 2007-1-27 01:03 AM:
LZ-DOS 是 改 良 了 核 心 的 MS-DOS 7.10 ( Win98SE 啟 動 部 份 ) , 俄 國 人 只 拿 掉 了 他 們 認 為 沒 有 用 的 東 西 ( 可 能 是 Win98SE GUI 部 份 )
关于这个LZ-DOS,其实我去年就曾研究过。当时经过研究确定,它的英文版/俄文版的IO.SYS文件分别是在英文版/俄文版的MS-DOS 7.1内核上经过简单修改并压缩而成的,而COMMAND.COM则是在DOS 6.x的基础上改成的。关于它的兼容性和压缩问题论坛中就曾有一些讨论,比如这儿:
http://www.cn-dos.net/forum/viewthread.php?tid=21627
当时经研究发现,那个俄国人并没有拿掉Win9x GUI支持部分,也没有删减任何重要功能。之所以体积比较小,主要是因为经过了压缩。它可以正常启动Win9x GUI(这个我当时就验证过了),但有两点要注意,那就是路径设置和默认语言代码页。因为它的英文版是在英文版的MS-DOS 7.1内核基础上修改和压缩而来的,所以它的默认语言代码页是437。而Win98启动有个要求,那就是MSDOS.SYS中的路径设置必须正确,而且DOS启动代码页必须与Win98代码页相同,否则会出现注册表错误的提示。对于前者,我曾在论坛中发过专帖进行详细介绍;对于后者,如果代码页不相同的话,可以在CONFIG.SYS中用COUNTRY命令修改。当时通过这些设置,我在LZ-DOS上成功启动过Win3.x到98SE之间的各种中英文版本的WIN。
Originally posted by johnsonlam at 2007-1-27 01:03 AM:
LZ-DOS is an improvement of the core MS-DOS 7.10 (the boot part of Win98SE). Russians only removed what they thought was useless things (probably the Win98SE GUI part).
Regarding this LZ-DOS, in fact, I had studied it last year. At that time, after research, it was determined that its English/Russian version of the IO.SYS file was simply modified and compressed on the basis of the English/Russian version of the MS-DOS 7.1 kernel, and the COMMAND.COM was modified on the basis of DOS 6.x. There were some discussions in the forum about its compatibility and compression issues, such as here:
http://www.cn-dos.net/forum/viewthread.php?tid=21627
At that time, it was found through research that the Russian did not remove the Win9x GUI support part, nor did he delete any important functions. The reason why the volume is relatively small is mainly because it has been compressed. It can start the Win9x GUI normally (which I verified at that time), but there are two points to note, namely path setting and default language code page. Because its English version is modified and compressed on the basis of the English version of the MS-DOS 7.1 kernel, its default language code page is 437. And there is a requirement for Win98 startup, that is, the path setting in MSDOS.SYS must be correct, and the DOS startup code page must be the same as the Win98 code page, otherwise a registry error prompt will appear. For the former, I have posted a special post in the forum for detailed introduction; for the latter, if the code pages are not the same, you can use the COUNTRY command in CONFIG.SYS to modify. At that time, through these settings, I successfully started various Chinese and English versions of WIN from Win3.x to 98SE on LZ-DOS.
|

Wengier - 新DOS时代
欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/
E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)
 |
|
2007-1-27 16:27 |
|
|
johnsonlam
银牌会员
     阿林
积分 1410
发帖 497
注册 2004-6-28 来自 九龍,香港
状态 离线
|
『第 20 楼』:
使用 LLM 解释/回答一下
Originally posted by Wengier at 2007-1-27 04:27 PM:
当时经研究发现,那个俄国人并没有拿掉Win9x GUI支持部分,也没有删减任何重要功能。之所以体积比较小,主要是因为经过了压缩。
謝 謝 , 我 是 看 漏 了 眼 。
俄 國 人 透 露 了 , 這 是 "內 部 、 特 別 、 軍 事 和 太 空" 用 途 !!
問 題 是 -- 我 們 欠 缺 軟 體 ...
Originally posted by Wengier at 2007-1-27 04:27 PM:
At that time, it was found through research that the Russian didn't remove the Win9x GUI support part, nor did he delete any important functions. The main reason why the size is relatively small is mainly because it has been compressed.
Thank you, I missed it.
The Russian revealed that this is for "internal, special, military and space" use!!
The problem is -- we lack software...
|

我 的 網 站 - http://optimizr.dyndns.org
|
|
2007-1-28 02:56 |
|
|
不点
银牌会员
     不甘寂寞的人
积分 2491
发帖 1115
注册 2003-9-24
状态 离线
|
『第 21 楼』:
使用 LLM 解释/回答一下
johnsonlam:你的 Q 系列在很多工具软件中都有列入。相比之下,grub4dos 的了解度还很低。其实我也是前几天才知道你是 Q 的作者。而且正是因为这个,我才把帖子重发在开发室的。我以前从不来开发室的。
虽然我知道你适合于做这个项目的开发、管理人,但是,我也不好意思明说,毕竟你自己已经有项目在身了,考虑到额外给你增加一些压力并不好。
我又有一个提议,来这里的人最好都要说明自己能否担当维护人。如果不能担当,请说明不能担当的理由。考虑到有些人其实可以担当,但是又不太积极主动,所以我觉得有必要增加这个提议,来促成这件事情。
另外,我觉得不要太过于拘泥于 “侵权” 问题。如果严格按照 EULA,我们什么都不能做了。我认为那就是紧箍咒而已。我们可以反问软件公司,难道你隐藏技术秘密就是完全合理的吗?如果我们不反汇编,怎么能够知道你的产品里面有没有炸药?我们每个人对于“合理性” 的理解,可能是有偏差的。人是高级的动物,所以,想法就决定着他的行动。我们不要忘了,微软的所作所为,也不一定就是合理合法的(微软也曾被人控告并且败诉)。我认为,我们只要做到,让那些可能的控告者抓不到把柄就好了。还是那句话,不要过分自己束缚自己的手脚。
当然我绝不是说要去 "偷" 人家的代码。如果我们把它的技术秘密掌握了,我们也就根本不需要去 "偷" 了。而掌握技术秘密,你没有 debug 怎么行呢?以前看过《未公开的DOS核心技术》,像这样的作者,都是 debug 的熟练玩家。我认为 debug 是合法的,否则 DOS 为何要附带这个工具呢?我们的目的,是要找出微软的那些不该隐藏的秘密,这不构成对它的知识产权的侵犯。严格说来,它的那些秘密无非就是用来扼杀竞争对手的,属于不正当竞争的范畴。因此严格说来,我们有权要求微软公开那些秘密,至少在道义上,微软该这么做。所以说,不用担心,我们的做法完全是合理合法又合情的。
---------------
又,最新报告:把 scanreg.ini 中的 Backup 和 Optimize 清零,改成这样:
;Registry backup is skipped altogether if this is set to 0
Backup=0
;Registry automatic optimization is skipped if this is set to 0
Optimize=0
另外还要在 msconfig 中把 scanregw 禁用。这么一来,Windows 98SE 就可以启动了。
-----------------------
不过,既然这只是一个压缩的产物,那么也就没什么意义了。我准备研究一下 IO.SYS 的启动过程,把研究心得贴在这里。Wengier 和大家有什么建议和忠告,赶快说,以免我走弯路。
johnsonlam: Your Q series is included in many utility software. In contrast, the understanding of grub4dos is still very low. Actually, I only found out a few days ago that you are the author of Q. And precisely because of this, I reposted the post in the development room. I never came to the development room before.
Although I know you are suitable for being the development and management person of this project, I am also embarrassed to say it directly. After all, you already have your own project, and considering that adding extra pressure on you is not good.
I have another proposal. Those who come here should preferably state whether they can be a maintainer. If not, they should state the reason for not being able to. Considering that some people can actually be maintainers but are not very proactive, I think it is necessary to add this proposal to promote this matter.
In addition, I think we should not be too rigid about the "infringement" issue. If we strictly follow the EULA, we can do nothing. I think that is just a tight rein. We can ask software companies, is it completely reasonable for you to hide technical secrets? How can we know if there are bombs in your product without disassembling? Our understanding of "reasonableness" may be different. Humans are advanced animals, so thoughts determine actions. Let's not forget that Microsoft's actions may not be reasonable and legal (Microsoft has also been sued and lost). I think as long as we make it so that possible accusers can't find any handle. Again, don't overbind your own hands and feet.
Of course, I don't mean to "steal" other people's code at all. If we master its technical secrets, we don't need to "steal" at all. And to master technical secrets, how can you do without debug? I have read "Unpublished DOS Core Technology" before. Authors like this are all proficient players of debug. I think debug is legal; otherwise, why does DOS come with this tool? Our purpose is to find out those secrets that Microsoft shouldn't hide, which does not constitute an infringement of its intellectual property rights. Strictly speaking, its secrets are nothing but used to strangle competitors, which belongs to the category of unfair competition. Therefore, strictly speaking, we have the right to require Microsoft to disclose those secrets, at least morally, Microsoft should do so. So don't worry, our approach is completely reasonable, legal, and reasonable.
---------------
Also, the latest report: Set Backup and Optimize in scanreg.ini to zero, change it to this:
;Registry backup is skipped altogether if this is set to 0
Backup=0
;Registry automatic optimization is skipped if this is set to 0
Optimize=0
In addition, disable scanregw in msconfig. In this way, Windows 98SE can start.
-----------------------
However, since this is just a compressed product, then it is of no significance. I am going to study the startup process of IO.SYS and post my research experience here. Wengier and everyone, if you have any suggestions and warnings, hurry up and say, so that I don't go the wrong way.
|

因为我们亲手创建,这个世界更加美丽。 |
|
2007-1-28 04:40 |
|
|
johnsonlam
银牌会员
     阿林
积分 1410
发帖 497
注册 2004-6-28 来自 九龍,香港
状态 离线
|
『第 22 楼』:
使用 LLM 解释/回答一下
Originally posted by 不点 at 2007-1-28 04:40 AM:
johnsonlam:你的 Q 系列在很多工具软件中都有列入。相比之下,grub4dos 的了解度还很低。其实我也是前几天才知道你是 Q 的作者。而且正是因为这个,我才把帖子重发在开发室的。我以前从不来开发室的。
你 誤 會 了 , 我 是 管 網 頁 和 聯 系 的 , 作 者 是 Jack Ellis.
虽然我知道你适合于做这个项目的开发、管理人,但是,我也不好意思明说,毕竟你自己已经有项目在身了,考虑到额外给你增加一些压力并不好。
抱 歉 , Jack 暫 時 對 其 它 計 劃 不 想 參 與 , 只 想 做 好 手 頭 的 Q-系 驅 動
我又有一个提议,来这里的人最好都要说明自己能否担当维护人。如果不能担当,请说明不能担当的理由。考虑到有些人其实可以担当,但是又不太积极主动,所以我觉得有必要增加这个提议,来促成这件事情。
我 覺 得 要 承 擔 的 話 , 很 多 人 就 會 有 壓 力
我 不 懂 編 程 , 又 不 懂 看 匯 編 , 否 則 已 經 在 幫 忙 了
另外,我觉得不要太过于拘泥于 “侵权” 问题。如果严格按照 EULA,我们什么都不能做了。我认为那就是紧箍咒而已。我们可以反问软件公司,难道你隐藏技术秘密就是完全合理的吗?如果我们不反汇编,怎么能够知道你的产品里面有没有炸药?我们每个人对于“合理性” 的理解,可能是有偏差的。人是高级的动物,所以,想法就决定着他的行动。我们不要忘了,微软的所作所为,也不一定就是合理合法的(微软也曾被人控告并且败诉)。我认为,我们只要做到,让那些可能的控告者抓不到把柄就好了。还是那句话,不要过分自己束缚自己的手脚。
我 們 不 需 要 美 國 或 國 際 法 律 完 全 認 同 , 但 你 說 的 對 , 軟 件 公 司 的 私 心 , 使 人 類 落 後 太 多 , 我 們 不 必 完 全 遵 守 。
但 我 覺 得 要 有 道 德 底 線 , 不 能 抄 了 別 人 卻 認 是 自 己 的 , 禮 貌 道 德 上 要 立 於 不 敗 之 地 , 可 以 反 汇 编 但 不 能 抄 MS 的 源 碼 。我 同 意 不 要 过 分 自 己 束 缚 自 己 的 手 脚 。
当然我绝不是说要去 "偷" 人家的代码。如果我们把它的技术秘密掌握了,我们也就根本不需要去 "偷" 了。而掌握技术秘密,你没有 debug 怎么行呢?以前看过《未公开的DOS核心技术》,像这样的作者,都是 debug 的熟练玩家。我认为 debug 是合法的,否则 DOS 为何要附带这个工具呢?我们的目的,是要找出微软的那些不该隐藏的秘密,这不构成对它的知识产权的侵犯。严格说来,它的那些秘密无非就是用来扼杀竞争对手的,属于不正当竞争的范畴。因此严格说来,我们有权要求微软公开那些秘密,至少在道义上,微软该这么做。所以说,不用担心,我们的做法完全是合理合法又合情的。
完 全 同 意
不过,既然这只是一个压缩的产物,那么也就没什么意义了。我准备研究一下 IO.SYS 的启动过程,把研究心得贴在这里。Wengier 和大家有什么建议和忠告,赶快说,以免我走弯路。
聽 Jack 兄 談 多 了 驅 動 知 識 , 我 覺 得 可 能 還 有 改 良 的 餘 地 呢 。
Originally posted by Budian at 2007-1-28 04:40 AM:
johnsonlam: Your Q series is included in many utility software. In comparison, the awareness of grub4dos is still very low. Actually, I only found out a few days ago that you are the author of Q. And precisely because of this, I reposted the post in the development room. I never came to the development room before.
You misunderstood. I am in charge of the website and contact, and the author is Jack Ellis.
Although I know you are suitable for being the development and management person of this project, I am also embarrassed to say it directly. After all, you already have a project on hand, and considering that adding additional pressure to you is not good.
Sorry, Jack is currently not interested in participating in other plans and only wants to do a good job on the current Q-series drivers.
I have another proposal. Those who come here should preferably state whether they can be a maintainer. If they cannot be, please state the reason for not being able to. Considering that some people can actually be maintainers but are not very proactive, I think it is necessary to add this proposal to promote this matter.
I think that if one has to be a maintainer, many people will have pressure. I don't know programming and don't understand assembly language, otherwise I would have helped.
In addition, I think we shouldn't be too stuck on the "infringement" issue. If we strictly follow the EULA, we can't do anything. I think that's just a tight rein. We can ask software companies, is it completely reasonable for you to hide technical secrets? If we don't disassemble, how can we know if there is dynamite in your product? Our understanding of "reasonableness" may be biased. Humans are advanced animals, so thoughts determine actions. Let's not forget that Microsoft's actions are not necessarily reasonable and legal (Microsoft has also been sued and lost). I think as long as we make it so that those possible accusers can't find any handle. Again, don't overbind your own hands and feet.
We don't need full recognition from US or international law, but what you said is right. The selfishness of software companies has made human progress too slow. We don't have to comply completely.
But I think there should be a moral bottom line. We can't copy others and claim it as our own. We should be on the right side in terms of courtesy and morality. We can disassemble but can't copy MS's source code. I agree with not overbinding our own hands and feet.
Of course I don't mean to "steal" someone's code. If we master their technical secrets, we don't need to "steal" at all. And to master technical secrets, how can you do without debug? I have read "Unpublished DOS Core Technology" before. Authors like that are all proficient players of debug. I think debug is legal, otherwise why would DOS come with this tool? Our purpose is to find out those secrets of Microsoft that shouldn't be hidden, which doesn't constitute an infringement of its intellectual property rights. Strictly speaking, those secrets of it are nothing but to strangle competitors, which belongs to the category of unfair competition. Therefore, strictly speaking, we have the right to require Microsoft to disclose those secrets, at least morally, Microsoft should do so. So don't worry, our approach is completely reasonable, legal and reasonable.
Completely agree.
However, since this is just a compressed product, then it has no meaning. I am going to study the boot process of IO.SYS and post my research insights here. Wengier and everyone, if you have any suggestions and advice, hurry up and say, so that I don't go the wrong way.
After listening to Brother Jack talk a lot about driver knowledge, I think there may still be room for improvement.
|

我 的 網 站 - http://optimizr.dyndns.org
|
|
2007-1-28 07:59 |
|
|
本是
银牌会员
    
积分 2221
发帖 789
注册 2005-1-27
状态 离线
|
|
2007-1-28 11:41 |
|
|
不点
银牌会员
     不甘寂寞的人
积分 2491
发帖 1115
注册 2003-9-24
状态 离线
|
『第 24 楼』:
使用 LLM 解释/回答一下
johnsonlam: 怪我粗心大意了。谢谢你的澄清。另外我很能理解你和 Jack 的想法。那我们就等着看有没有人自告奋勇了。
本是:干得好!我很想得到你修改后的这个 IO.SYS。你能做个下载链结吗?
johnsonlam: I was careless. Thank you for the clarification. Also, I can very much understand your and Jack's thoughts. Then we'll just wait and see if anyone volunteers.
Original poster: Well done! I really want to get this modified IO.SYS from you. Can you make a download link?
|

因为我们亲手创建,这个世界更加美丽。 |
|
2007-1-28 11:58 |
|
|
Kinglion
铂金会员
       痴迷DOS者
积分 5798
发帖 1924
注册 2003-6-20 来自 金獅電腦軟體工作室
状态 离线
|
『第 25 楼』:
使用 LLM 解释/回答一下
可以借鉴Micro$oft公司公开的DOS6.0的源码.
大概有20MB左右吧.
You can refer to the source code of DOS 6.0 publicly released by Micro$oft Corporation. It is about 20MB approximately.
|

熟能生巧,巧能生精,一艺不精,终生无成,精亦求精,始有所成,臻于完美,永无止境!
金狮電腦軟體工作室愿竭诚为您服务!
QQ群:8393170(定期清理不发言者)
个人网站:http://www.520269.cn
电子邮件:doujiehui@vip.qq.com
微信公众号: doujiehui
|
|
2007-1-31 22:37 |
|
|
不点
银牌会员
     不甘寂寞的人
积分 2491
发帖 1115
注册 2003-9-24
状态 离线
|
『第 26 楼』:
使用 LLM 解释/回答一下
本是: 我下载了你的 IO.SYS,发现了又一个秘密.
1. 你的这个 IO.SYS 怎么和 LZ-DOS 的 IO.SYS 在长度上完全一样,都是 75885 字节?
如果 LZ 就是 "压缩" 的意思, 那我觉得它的意义就不大了,还不如 wengier 的 io.sys 来得实在. "压缩" 只能增加我们脱壳的困难, 所以是糟糕的做法. WinME 中的 IO.SYS 就是压缩的.
2. 直接用你的这个 IO.SYS 覆盖微软的 IO.SYS, 结果不能启动 DOS(要死机).
3. 保持微软的 IO.SYS 作为 C:\IO.SYS, 此时通过 GRUB 的 chainloader 来启动你的 IO.SYS (已经改名为 IO_1.SYS), 那么能够成功进入 DOS, 也能进入 Win98.
4. 用你的 IO.SYS 作为 C:\IO.SYS, 把微软的 IO.SYS 改名为 IO_MS.SYS. 此时即便通过 GRUB 的 chainloader 来启动 IO_MS.SYS, 都是失败的. 好像是死机了,但键盘上的 NumLock 键可以切换 NumLOCK 指示灯. 用 Ctrl+Alt+Del 也可以重启动机器.
这最后一个现象,说明 grub 的 chainloader 还没有掌握 IO.SYS 的深层秘密.
This is: I downloaded your IO.SYS and found another secret.
1. How come your IO.SYS is exactly the same length as LZ-DOS's IO.SYS, both 75885 bytes? If LZ means "compression", then I think its significance is not great. It's not as practical as wengier's io.sys. "Compression" can only increase the difficulty of our unpacking, so it's a bad practice. The IO.SYS in WinME is compressed.
2. Directly overwriting Microsoft's IO.SYS with your IO.SYS results in being unable to boot DOS (it will freeze).
3. Keep Microsoft's IO.SYS as C:\IO.SYS. At this time, by using GRUB's chainloader to boot your IO.SYS (which has been renamed to IO_1.SYS), then you can successfully enter DOS and also enter Win98.
4. Use your IO.SYS as C:\IO.SYS and rename Microsoft's IO.SYS to IO_MS.SYS. At this time, even if you use GRUB's chainloader to boot IO_MS.SYS, it's all a failure. It seems like it freezes, but the NumLock key on the keyboard can switch the NumLOCK indicator light. You can also restart the machine with Ctrl+Alt+Del.
This last phenomenon shows that GRUB's chainloader hasn't grasped the deep secret of IO.SYS.
|

因为我们亲手创建,这个世界更加美丽。 |
|
2007-2-1 23:22 |
|
|
本是
银牌会员
    
积分 2221
发帖 789
注册 2005-1-27
状态 离线
|
『第 27 楼』:
使用 LLM 解释/回答一下
Originally posted by 不点 at 2007-2-1 23:22:
本是: 我下载了你的 IO.SYS,发现了又一个秘密.
...
1.我的这个 IO.SYS 本来就是 LZ-DOS 的 IO.SYS,只是解了一段密,并未改变文件长度。
2.关于死机问题,建议
debug io.sys
e 0002 ce 01 b3 01
w
q
改回原值。这样EXE文件头就与原LZ的一样了。应该没有当机问题了。
3.即使是加密的,解了以后一样可用。因为有秘密在其中嘛!也许他们加减乘除了什么……
Originally posted by Budian at 2007-2-1 23:22:
Originally: I downloaded your IO.SYS and discovered another secret.
...
1. My this IO.SYS was originally the IO.SYS of LZ-DOS, just decrypted a segment, and the file length was not changed.
2. Regarding the crash problem, it is suggested
debug io.sys
e 0002 ce 01 b3 01
w
q
Change back to the original value. In this way, the EXE file header will be the same as the original LZ's. There should be no crash problem.
3. Even if it is encrypted, it can be used after decryption. Because there is a secret in it! Maybe they added, subtracted, multiplied and divided something...
|

my major is english----my love is dos----my teacher is the buddha----my friends--how about U |
|
2007-2-2 01:31 |
|
|
brglng
银牌会员
     永遠的DOS~~~
积分 1200
发帖 466
注册 2005-2-1 来自 上海
状态 离线
|
『第 28 楼』:
使用 LLM 解释/回答一下
我觉得可以把对MSDOS 8.0的IO.SYS的研究也作为这个项目的一部分哦
I think the research on IO.SYS of MSDOS 8.0 can also be regarded as a part of this project.
|

32位才是DOS未来的希望
个人网志:http://sololand.moe |
|
2007-2-13 03:21 |
|
|
不点
银牌会员
     不甘寂寞的人
积分 2491
发帖 1115
注册 2003-9-24
状态 离线
|
『第 29 楼』:
FAT16 的引导扇区剖析
使用 LLM 解释/回答一下
关键字:boot sector, boot record, asm, assembly, FAT16 file system, MS-DOS, 引导扇区,引导记录,FAT16 文件系统,汇编语言,反汇编
从这个引导过程的分析可以知道,IO.SYS 在接管控制后,进入点是第二扇区的开头。
IO.SYS 被 boot sector 装入了 4 个扇区,装入的地址是 0000:0700,控制转移的 CS:IP=0070:0200,也就是 IO.SYS 的第二扇区的开头。另外,BP,SP,SI,DI,SS,DS,ES 以及堆栈内容都是有意义的,在下面的注释中都作了详细说明。
2181:7C00 EB 3C 90 4D-53 57 49 4E-34 2E 31 00-02 04 04 00 .<.MSWIN4.1.....
2181:7C10 02 00 02 00-00 F8 F8 00-20 00 40 00-20 00 00 00 ........ .@. ...
2181:7C20 E0 DF 03 00-80 00 29 FA-6F 0B 00 55-53 42 5A 49 ......).o..USBZI
2181:7C30 50 2D 42 4F-4F 54 46 41-54 31 36 00-00 00 33 C9 P-BOOTFAT16...3.
2181:7C40 8E D1 BC FC-7B 16 07 BD-78 00 C5 76-00 1E 56 16 ....{...x..v..V.
2181:7C50 55 BF 22 05-89 7E 00 89-4E 02 B1 0B-FC F3 A4 06 U."..~..N.......
2181:7C60 1F BD 00 7C-C6 45 FE 0F-38 4E 24 7D-20 8B C1 99 ...|.E..8N$} ...
2181:7C70 E8 7E 01 83-EB 3A 66 A1-1C 7C 66 3B-07 8A 57 FC .~...:f..|f;..W.
2181:7C80 75 06 80 CA-02 88 56 02-80 C3 10 73-ED 33 C9 FE u.....V....s.3..
2181:7C90 06 D8 7D 8A-46 10 98 F7-66 16 03 46-1C 13 56 1E ..}.F...f..F..V.
2181:7CA0 03 46 0E 13-D1 8B 76 11-60 89 46 FC-89 56 FE B8 .F....v.`.F..V..
2181:7CB0 20 00 F7 E6-8B 5E 0B 03-C3 48 F7 F3-01 46 FC 11 ....^...H...F..
2181:7CC0 4E FE 61 BF-00 07 E8 28-01 72 3E 38-2D 74 17 60 N.a....(.r>8-t.`
2181:7CD0 B1 0B BE D8-7D F3 A6 61-74 3D 4E 74-09 83 C7 20 ....}..at=Nt...
2181:7CE0 3B FB 72 E7-EB DD FE 0E-D8 7D 7B A7-BE 7F 7D AC ;.r......}{..}.
2181:7CF0 98 03 F0 AC-98 40 74 0C-48 74 13 B4-0E BB 07 00 .....@t.Ht......
2181:7D00 CD 10 EB EF-BE 82 7D EB-E6 BE 80 7D-EB E1 CD 16 ......}....}....
2181:7D10 5E 1F 66 8F-04 CD 19 BE-81 7D 8B 7D-1A 8D 45 FE ^.f......}.}..E.
2181:7D20 8A 4E 0D F7-E1 03 46 FC-13 56 FE B1-04 E8 C2 00 .N....F..V......
2181:7D30 72 D7 EA 00-02 70 00 52-50 06 53 6A-01 6A 10 91 r....p.RP.Sj.j..
2181:7D40 8B 46 18 A2-26 05 96 92-33 D2 F7 F6-91 F7 F6 42 .F..&...3......B
2181:7D50 87 CA F7 76-1A 8A F2 8A-E8 C0 CC 02-0A CC B8 01 ...v............
2181:7D60 02 80 7E 02-0E 75 04 B4-42 8B F4 8A-56 24 CD 13 ..~..u..B...V$..
2181:7D70 61 61 72 0A-40 75 01 42-03 5E 0B 49-75 77 C3 03 aar.@u.B.^.Iuw..
2181:7D80 18 01 27 0D-0A 49 6E 76-61 6C 69 64-20 73 79 73 ..'..Invalid sys
2181:7D90 74 65 6D 20-64 69 73 6B-FF 0D 0A 44-69 73 6B 20 tem disk...Disk
2181:7DA0 49 2F 4F 20-65 72 72 6F-72 FF 0D 0A-52 65 70 6C I/O error...Repl
2181:7DB0 61 63 65 20-74 68 65 20-64 69 73 6B-2C 20 61 6E ace the disk, an
2181:7DC0 64 20 74 68-65 6E 20 70-72 65 73 73-20 61 6E 79 d then press any
2181:7DD0 20 6B 65 79-0D 0A 00 00-49 4F 20 20-20 20 20 20 key....IO
2181:7DE0 53 59 53 4D-53 44 4F 53-20 20 20 53-59 53 7F 01 SYSMSDOS SYS.
2181:7DF0 00 41 BB 00-07 60 66 6A-00 E9 3B FF-00 00 55 AA .A...`fj..;...U.
2181:7C00 EB 3C jmp 7C3E
2181:7C02 90 4D-53 57 49 4E-34 2E 31 00-02 04 04 00 .MSWIN4.1.....
2181:7C10 02 00 02 00-00 F8 F8 00-20 00 40 00-20 00 00 00 ........ .@. ...
2181:7C20 E0 DF 03 00-80 00 29 FA-6F 0B 00 55-53 42 5A 49 ......).o..USBZI
2181:7C30 50 2D 42 4F-4F 54 46 41-54 31 36 00-00 00 P-BOOTFAT16...
2181:7C3E 33 C9 xor cx,cx ;CX=0
2181:7C40 8E D1 mov ss,cx ;SS=0
2181:7C42 BC FC 7B mov sp,7BFC ;SP=7BFC
2181:7C45 16 push ss
2181:7C46 07 pop es ;ES=0
2181:7C47 BD 78 00 mov bp,0078 ;BP=78
2181:7C4A C5 76 00 lds si, ;DS:SI->floppy param
2181:7C4D 1E push ds
2181:7C4E 56 push si ;Save floppy param
2181:7C4F 16 push ss
2181:7C50 55 push bp ;Save 0000:0078
2181:7C51 BF 22 05 mov di,0522 ;DI=0522
2181:7C54 89 7E 00 mov ,di ;Set 0000:0522 as...
2181:7C57 89 4E 02 mov ,cx ;...new floppy param
2181:7C5A B1 0B mov cl,000B ;CX=000B
2181:7C5C FC cld
2181:7C5D F3 A4 repz movsb ;copy old param to new
2181:7C5F 06 push es
2181:7C60 1F pop ds ;DS=0
2181:7C61 BD 00 7C mov bp,7C00 ;BP=7C00
2181:7C64 C6 45 FE 0F mov byte ,000F ;modify floppy param
2181:7C68 38 4E 24 cmp ,cl ;drive is floppy?
2181:7C6B 7D 20 jge 7C8D ;yes. jump.
hard drive: check partition table for EBIOS indicator
2181:7C6D 8B C1 mov ax,cx ;AX=CX=0
2181:7C6F 99 cwd ;DX=0
2181:7C70 E8 7E 01 call 7DF1 ;read the MBR sector
2181:7C73 83 EB 3A sub bx,003A ;startLBA of entry 0
2181:7C76 66 A1 1C 7C mov eax, ;EAX=hidden sectors
2181:7C7A 66 3B 07 cmp eax, ;match?
2181:7C7D 8A 57 FC mov dl, ;DL=partition type
2181:7C80 75 06 jnz 7C88 ;not match, skip
2181:7C82 80 CA 02 or dl,0002 ;if the type is 0C
;let it be 0E
2181:7C85 88 56 02 mov ,dl ;set EBIOS flag in 7C02
2181:7C88 80 C3 10 add bl,0010 ;next entry
2181:7C8B 73 ED jnb 7C7A ;carry set if done
the real deal begins here
2181:7C8D 33 C9 xor cx,cx ;CX=0
2181:7C8F FE 06 D8 7D inc byte ;Change IO to JO
2181:7C93 8A 46 10 mov al, ;AL=number of FATs
2181:7C96 98 cbw ;AX=number of FATs
2181:7C97 F7 66 16 mul word ;sectors per FAT
;DX:AX=sectors in FATs
2181:7C9A 03 46 1C add ax,
2181:7C9D 13 56 1E adc dx, ;Add hidden sectors
2181:7CA0 03 46 0E add ax, ;Add reserved sectors
2181:7CA3 13 D1 adc dx,cx ;DX:AX->root dir
2181:7CA5 8B 76 11 mov si, ;SI=root dir entries
2181:7CA8 60 pushaw
2181:7CA9 89 46 FC mov ,ax ;
2181:7CAC 89 56 FE mov ,dx ;save DX:AX on stack
2181:7CAF B8 20 00 mov ax,0020 ;AX=dir entry length
2181:7CB2 F7 E6 mul si ;DX:AX=root dir size
2181:7CB4 8B 5E 0B mov bx, ;BX=sector size
2181:7CB7 03 C3 add ax,bx
2181:7CB9 48 dec ax
2181:7CBA F7 F3 div bx ;AX=root dir sectors
2181:7CBC 01 46 FC add ,ax
2181:7CBF 11 4E FE adc ,cx ;stack->Data area
2181:7CC2 61 popaw
2181:7CC3 BF 00 07 mov di,0700 ;DI=0700
2181:7CC6 E8 28 01 call 7DF1 ;read root dir
2181:7CC9 72 3E jb 7D09
2181:7CCB 38 2D cmp ,ch
2181:7CCD 74 17 jz 7CE6 ;failure find file
2181:7CCF 60 pushaw
2181:7CD0 B1 0B mov cl,000B ;find kernel filename
2181:7CD2 BE D8 7D mov si,7DD8
2181:7CD5 F3 A6 repz cmpsb
2181:7CD7 61 popaw
2181:7CD8 74 3D jz 7D17 ;found, jump
2181:7CDA 4E dec si ;SI=rest entries
2181:7CDB 74 09 jz 7CE6 ;not found, failure
2181:7CDD 83 C7 20 add di,0020 ;next entry
2181:7CE0 3B FB cmp di,bx ;end?
2181:7CE2 72 E7 jb 7CCB ;no, check the entry
2181:7CE4 EB DD jmp 7CC3 ;yes, load 1 sector
2181:7CE6 FE 0E D8 7D dec byte ;Change JO to IO
2181:7CEA 7B A7 jnp 7C93 ;find again
2181:7CEC BE 7F 7D mov si,7D7F ;not found
print error message:
SI=7D7F "invalid system disk"
SI=7D80 "Disk I/O error"
SI=7D82 "Replace the disk, and then press any key..."
2181:7CEF AC lodsb
2181:7CF0 98 cbw
2181:7CF1 03 F0 add si,ax
display string DS:SI, if encountered FF, then
display "Replace the disk, and then press any key..."
if encountered 00, wait for a key press and reboot.
2181:7CF3 AC lodsb
2181:7CF4 98 cbw
2181:7CF5 40 inc ax
2181:7CF6 74 0C jz 7D04
2181:7CF8 48 dec ax
2181:7CF9 74 13 jz 7D0E
display char in AL
2181:7CFB B4 0E mov ah,000E
2181:7CFD BB 07 00 mov bx,0007
2181:7D00 CD 10 int 10
2181:7D02 EB EF jmp 7CF3
display "Replace the disk, and then press any key..."
2181:7D04 BE 82 7D mov si,7D82
2181:7D07 EB E6 jmp 7CEF
display "Disk I/O error"
2181:7D09 BE 80 7D mov si,7D80
2181:7D0C EB E1 jmp 7CEF
2181:7D0E CD 16 int 16
2181:7D10 5E pop si
2181:7D11 1F pop ds ;DS:SI=0000:0078
2181:7D12 66 8F 04 pop dword ;restore original...
;...floppy params
2181:7D15 CD 19 int 19
the kernel file was found
2181:7D17 BE 81 7D mov si,7D81 ;error message
2181:7D1A 8B 7D 1A mov di, ;start cluster
2181:7D1D 8D 45 FE lea ax,
2181:7D20 8A 4E 0D mov cl, ;sectors per cluster
2181:7D23 F7 E1 mul cx ;DX:AX=sectors
2181:7D25 03 46 FC add ax,
2181:7D28 13 56 FE adc dx, ;DX:AX=LBA
2181:7D2B B1 04 mov cl,0004 ;read 4 sectors
2181:7D2D E8 C2 00 call 7DF2 ;... to 0000:0700
2181:7D30 72 D7 jb 7D09
Transfer control to the second sector of IO.SYS, with
SS=DS=ES=0000
SP=7BF4
BP=7C00
SI=error message "invalid system disk"
DI=start cluster number of IO.SYS
==0078
==0000
==OFFSET of FLOPPY PARAMS
==SEGMENT of FLOPPY PARAMS
===LBA of data area
2181:7D32 EA 00 02 70 00 jmp 0070:0200 ;CS:IP=0070:0200
2181:7D37 52 push dx ;DX:AX=LBA lo 32 bits
2181:7D38 50 push ax
2181:7D39 06 push es ;ES:BX=buffer
2181:7D3A 53 push bx
2181:7D3B 6A 01 push 0001 ;read 1 sector
2181:7D3D 6A 10 push 0010 ;EBIOS packet size
begin geometry translation: LBA to CHS
2181:7D3F 91 xchg ax,cx ;save AX to CX
2181:7D40 8B 46 18 mov ax, ;AX=sectors per track
2181:7D43 A2 26 05 mov ,al ;modify floppy param
2181:7D46 96 xchg ax,si ;SI=sectors per track
2181:7D47 92 xchg ax,dx ;AX=DX
2181:7D48 33 D2 xor dx,dx
2181:7D4A F7 F6 div si ;AX=quo, DX=res
2181:7D4C 91 xchg ax,cx ;restore AX from CX
;CX=quo
;DX:AX=the rest sectors
2181:7D4D F7 F6 div si ;AX=quo, DX=res
2181:7D4F 42 inc dx ;DX=sector
2181:7D50 87 CA xchg cx,dx ;CX=sector, DX=old quo
;DX:AX=quo
2181:7D52 F7 76 1A div word ;heads
;AX=cyl, DX=head
2181:7D55 8A F2 mov dh,dl ;DH=head
2181:7D57 8A E8 mov ch,al ;CH=cyl. lo 8 bits
2181:7D59 C0 CC 02 ror ah,02 ;AH=cyl. hi 2 bits
2181:7D5C 0A CC or cl,ah ;put into CL
end geometry translation: LBA to CHS
2181:7D5E B8 01 02 mov ax,0201 ;read 1 sector
2181:7D61 80 7E 02 0E cmp byte ,000E ;USE EBIOS?
2181:7D65 75 04 jnz 7D6B ;no, skip
2181:7D67 B4 42 mov ah,0042 ;yes, set AH=42
2181:7D69 8B F4 mov si,sp ;DS:SI->packet
2181:7D6B 8A 56 24 mov dl, ;drive number
2181:7D6E CD 13 int 13 ;BIOS disk call
2181:7D70 61 popaw ;discard packet
2181:7D71 61 popaw ;restore regs
2181:7D72 72 0A jb 7D7E ;failure jump
2181:7D74 40 inc ax ;next sector
2181:7D75 75 01 jnz 7D78
2181:7D77 42 inc dx
2181:7D78 03 5E 0B add bx, ;buffer
2181:7D7B 49 dec cx
2181:7D7C 75 77 jnz 7DF5 ;continue to read
;until done
2181:7D7E C3 ret
2181:7D7F 03 .
2181:7D80 18 01 27 0D-0A 49 6E 76-61 6C 69 64-20 73 79 73 ..'..Invalid sys
2181:7D90 74 65 6D 20-64 69 73 6B-FF 0D 0A 44-69 73 6B 20 tem disk...Disk
2181:7DA0 49 2F 4F 20-65 72 72 6F-72 FF 0D 0A-52 65 70 6C I/O error...Repl
2181:7DB0 61 63 65 20-74 68 65 20-64 69 73 6B-2C 20 61 6E ace the disk, an
2181:7DC0 64 20 74 68-65 6E 20 70-72 65 73 73-20 61 6E 79 d then press any
2181:7DD0 20 6B 65 79-0D 0A 00 00-49 4F 20 20-20 20 20 20 key....IO
2181:7DE0 53 59 53 4D-53 44 4F 53-20 20 20 53-59 53 7F 01 SYSMSDOS SYS.
2181:7DF0 00 .
subroutine: read sectors
2181:7DF1 41 inc cx ;CX=1
CX=sectors to read
2181:7DF2 BB 00 07 mov bx, 0700 ;ES:BX=0000:0700
BX=buffer
2181:7DF5 60 pushaw
2181:7DF6 66 6A 00 push 00000000
2181:7DF9 E9 3B FF jmp 7D37
2181:7DFC 00 00 55 AA ..U.
From the analysis of this boot process, it can be known that after IO.SYS takes over control, the entry point is at the beginning of the second sector.
IO.SYS is loaded into 4 sectors by the boot sector, and the loaded address is 0000:0700, and the control transfer CS:IP=0070:0200, which is the beginning of the second sector of IO.SYS. In addition, BP, SP, SI, DI, SS, DS, ES and the stack contents are all meaningful, and detailed explanations are made in the following comments.
2181:7C00 EB 3C 90 4D-53 57 49 4E-34 2E 31 00-02 04 04 00 .<.MSWIN4.1.....
2181:7C10 02 00 02 00-00 F8 F8 00-20 00 40 00-20 00 00 00 ........ .@. ...
2181:7C20 E0 DF 03 00-80 00 29 FA-6F 0B 00 55-53 42 5A 49 ......).o..USBZI
2181:7C30 50 2D 42 4F-4F 54 46 41-54 31 36 00-00 00 P-BOOTFAT16...
2181:7C3E 33 C9 xor cx,cx ;CX=0
2181:7C40 8E D1 mov ss,cx ;SS=0
2181:7C42 BC FC 7B mov sp,7BFC ;SP=7BFC
2181:7C45 16 push ss
2181:7C46 07 pop es ;ES=0
2181:7C47 BD 78 00 mov bp,0078 ;BP=78
2181:7C4A C5 76 00 lds si, ;DS:SI->floppy param
2181:7C4D 1E push ds
2181:7C4E 56 push si ;Save floppy param
2181:7C4F 16 push ss
2181:7C50 55 push bp ;Save 0000:0078
2181:7C51 BF 22 05 mov di,0522 ;DI=0522
2181:7C54 89 7E 00 mov ,di ;Set 0000:0522 as...
2181:7C57 89 4E 02 mov ,cx ;...new floppy param
2181:7C5A B1 0B mov cl,000B ;CX=000B
2181:7C5C FC cld
2181:7C5D F3 A4 repz movsb ;copy old param to new
2181:7C5F 06 push es
2181:7C60 1F pop ds ;DS=0
2181:7C61 BD 00 7C mov bp,7C00 ;BP=7C00
2181:7C64 C6 45 FE 0F mov byte ,000F ;modify floppy param
2181:7C68 38 4E 24 cmp ,cl ;drive is floppy?
2181:7C6B 7D 20 jge 7C8D ;yes. jump.
hard drive: check partition table for EBIOS indicator
2181:7C6D 8B C1 mov ax,cx ;AX=CX=0
2181:7C6F 99 cwd ;DX=0
2181:7C70 E8 7E 01 call 7DF1 ;read the MBR sector
2181:7C73 83 EB 3A sub bx,003A ;startLBA of entry 0
2181:7C76 66 A1 1C 7C mov eax, ;EAX=hidden sectors
2181:7C7A 66 3B 07 cmp eax, ;match?
2181:7C7D 8A 57 FC mov dl, ;DL=partition type
2181:7C80 75 06 jnz 7C88 ;not match, skip
2181:7C82 80 CA 02 or dl,0002 ;if the type is 0C
;let it be 0E
2181:7C85 88 56 02 mov ,dl ;set EBIOS flag in 7C02
2181:7C88 80 C3 10 add bl,0010 ;next entry
2181:7C8B 73 ED jnb 7C7A ;carry set if done
the real deal begins here
2181:7C8D 33 C9 xor cx,cx ;CX=0
2181:7C8F FE 06 D8 7D inc byte ;Change IO to JO
2181:7C93 8A 46 10 mov al, ;AL=number of FATs
2181:7C96 98 cbw ;AX=number of FATs
2181:7C97 F7 66 16 mul word ;sectors per FAT
;DX:AX=sectors in FATs
2181:7C9A 03 46 1C add ax,
2181:7C9D 13 56 1E adc dx, ;Add hidden sectors
2181:7CA0 03 46 0E add ax, ;Add reserved sectors
2181:7CA3 13 D1 adc dx,cx ;DX:AX->root dir
2181:7CA5 8B 76 11 mov si, ;SI=root dir entries
2181:7CA8 60 pushaw
2181:7CA9 89 46 FC mov ,ax ;
2181:7CAC 89 56 FE mov ,dx ;save DX:AX on stack
2181:7CAF B8 20 00 mov ax,0020 ;AX=dir entry length
2181:7CB2 F7 E6 mul si ;DX:AX=root dir size
2181:7CB4 8B 5E 0B mov bx, ;BX=sector size
2181:7CB7 03 C3 add ax,bx
2181:7CB9 48 dec ax
2181:7CBA F7 F3 div bx ;AX=root dir sectors
2181:7CBC 01 46 FC add ,ax
2181:7CBF 11 4E FE adc ,cx ;stack->Data area
2181:7CC2 61 popaw
2181:7CC3 BF 00 07 mov di,0700 ;DI=0700
2181:7CC6 E8 28 01 call 7DF1 ;read root dir
2181:7CC9 72 3E jb 7D09
2181:7CCB 38 2D cmp ,ch
2181:7CCD 74 17 jz 7CE6 ;failure find file
2181:7CCF 60 pushaw
2181:7CD0 B1 0B mov cl,000B ;find kernel filename
2181:7CD2 BE D8 7D mov si,7DD8
2181:7CD5 F3 A6 repz cmpsb
2181:7CD7 61 popaw
2181:7CD8 74 3D jz 7D17 ;found, jump
2181:7CDA 4E dec si ;SI=rest entries
2181:7CDB 74 09 jz 7CE6 ;not found, failure
2181:7CDD 83 C7 20 add di,0020 ;next entry
2181:7CE0 3B FB cmp di,bx ;end?
2181:7CE2 72 E7 jb 7CCB ;no, check the entry
2181:7CE4 EB DD jmp 7CC3 ;yes, load 1 sector
2181:7CE6 FE 0E D8 7D dec byte ;Change JO to IO
2181:7CEA 7B A7 jnp 7C93 ;find again
2181:7CEC BE 7F 7D mov si,7D7F ;not found
print error message:
SI=7D7F "invalid system disk"
SI=7D80 "Disk I/O error"
SI=7D82 "Replace the disk, and then press any key..."
2181:7CEF AC lodsb
2181:7CF0 98 cbw
2181:7CF1 03 F0 add si,ax
display string DS:SI, if encountered FF, then
display "Replace the disk, and then press any key..."
if encountered 00, wait for a key press and reboot.
2181:7CF3 AC lodsb
2181:7CF4 98 cbw
2181:7CF5 40 inc ax
2181:7CF6 74 0C jz 7D04
2181:7CF8 48 dec ax
2181:7CF9 74 13 jz 7D0E
display char in AL
2181:7CFB B4 0E mov ah,000E
2181:7CFD BB 07 00 mov bx,0007
2181:7D00 CD 10 int 10
2181:7D02 EB EF jmp 7CF3
display "Replace the disk, and then press any key..."
2181:7D04 BE 82 7D mov si,7D82
2181:7D07 EB E6 jmp 7CEF
display "Disk I/O error"
2181:7D09 BE 80 7D mov si,7D80
2181:7D0C EB E1 jmp 7CEF
2181:7D0E CD 16 int 16
2181:7D10 5E pop si
2181:7D11 1F pop ds ;DS:SI=0000:0078
2181:7D12 66 8F 04 pop dword ;restore original...
;...floppy params
2181:7D15 CD 19 int 19
the kernel file was found
2181:7D17 BE 81 7D mov si,7D81 ;error message
2181:7D1A 8B 7D 1A mov di, ;start cluster
2181:7D1D 8D 45 FE lea ax,
2181:7D20 8A 4E 0D mov cl, ;sectors per cluster
2181:7D23 F7 E1 mul cx ;DX:AX=sectors
2181:7D25 03 46 FC add ax,
2181:7D28 13 56 FE adc dx, ;DX:AX=LBA
2181:7D2B B1 04 mov cl,0004 ;read 4 sectors
2181:7D2D E8 C2 00 call 7DF2 ;... to 0000:0700
2181:7D30 72 D7 jb 7D09
Transfer control to the second sector of IO.SYS, with
SS=DS=ES=0000
SP=7BF4
BP=7C00
SI=error message "invalid system disk"
DI=start cluster number of IO.SYS
==0078
==0000
==OFFSET of FLOPPY PARAMS
==SEGMENT of FLOPPY PARAMS
===LBA of data area
2181:7D32 EA 00 02 70 00 jmp 0070:0200 ;CS:IP=0070:0200
2181:7D37 52 push dx ;DX:AX=LBA lo 32 bits
2181:7D38 50 push ax
2181:7D39 06 push es ;ES:BX=buffer
2181:7D3A 53 push bx
2181:7D3B 6A 01 push 0001 ;read 1 sector
2181:7D3D 6A 10 push 0010 ;EBIOS packet size
begin geometry translation: LBA to CHS
2181:7D3F 91 xchg ax,cx ;save AX to CX
2181:7D40 8B 46 18 mov ax, ;AX=sectors per track
2181:7D43 A2 26 05 mov ,al ;modify floppy param
2181:7D46 96 xchg ax,si ;SI=sectors per track
2181:7D47 92 xchg ax,dx ;AX=DX
2181:7D48 33 D2 xor dx,dx
2181:7D4A F7 F6 div si ;AX=quo, DX=res
2181:7D4C 91 xchg ax,cx ;restore AX from CX
;CX=quo
;DX:AX=the rest sectors
2181:7D4D F7 F6 div si ;AX=quo, DX=res
2181:7D4F 42 inc dx ;DX=sector
2181:7D50 87 CA xchg cx,dx ;CX=sector, DX=old quo
;DX:AX=quo
2181:7D52 F7 76 1A div word ;heads
;AX=cyl, DX=head
2181:7D55 8A F2 mov dh,dl ;DH=head
2181:7D57 8A E8 mov ch,al ;CH=cyl. lo 8 bits
2181:7D59 C0 CC 02 ror ah,02 ;AH=cyl. hi 2 bits
2181:7D5C 0A CC or cl,ah ;put into CL
end geometry translation: LBA to CHS
2181:7D5E B8 01 02 mov ax,0201 ;read 1 sector
2181:7D61 80 7E 02 0E cmp byte ,000E ;USE EBIOS?
2181:7D65 75 04 jnz 7D6B ;no, skip
2181:7D67 B4 42 mov ah,0042 ;yes, set AH=42
2181:7D69 8B F4 mov si,sp ;DS:SI->packet
2181:7D6B 8A 56 24 mov dl, ;drive number
2181:7D6E CD 13 int 13 ;BIOS disk call
2181:7D70 61 popaw ;discard packet
2181:7D71 61 popaw ;restore regs
2181:7D72 72 0A jb 7D7E ;failure jump
2181:7D74 40 inc ax ;next sector
2181:7D75 75 01 jnz 7D78
2181:7D77 42 inc dx
2181:7D78 03 5E 0B add bx, ;buffer
2181:7D7B 49 dec cx
2181:7D7C 75 77 jnz 7DF5 ;continue to read
;until done
2181:7D7E C3 ret
2181:7D7F 03 .
2181:7D80 18 01 27 0D-0A 49 6E 76-61 6C 69 64-20 73 79 73 ..'..Invalid sys
2181:7D90 74 65 6D 20-64 69 73 6B-FF 0D 0A 44-69 73 6B 20 tem disk...Disk
2181:7DA0 49 2F 4F 20-65 72 72 6F-72 FF 0D 0A-52 65 70 6C I/O error...Repl
2181:7DB0 61 63 65 20-74 68 65 20-64 69 73 6B-2C 20 61 6E ace the disk, an
2181:7DC0 64 20 74 68-65 6E 20 70-72 65 73 73-20 61 6E 79 d then press any
2181:7DD0 20 6B 65 79-0D 0A 00 00-49 4F 20 20-20 20 20 20 key....IO
2181:7DE0 53 59 53 4D-53 44 4F 53-20 20 20 53-59 53 7F 01 SYSMSDOS SYS.
2181:7DF0 00 .
subroutine: read sectors
2181:7DF1 41 inc cx ;CX=1
CX=sectors to read
2181:7DF2 BB 00 07 mov bx, 0700 ;ES:BX=0000:0700
BX=buffer
2181:7DF5 60 pushaw
2181:7DF6 66 6A 00 push 00000000
2181:7DF9 E9 3B FF jmp 7D37
2181:7DFC 00 00 55 AA ..U.
|

因为我们亲手创建,这个世界更加美丽。 |
|
2007-3-4 12:21 |
|
|
acen
新手上路

积分 4
发帖 2
注册 2007-3-7
状态 离线
|
|
2007-3-7 05:47 |
|
|