int 13h 在 Windows 保护模式下?
我们可以在Windows操作系统中使用Int 13h(直接磁盘读/写)吗?或者Windows保护模式不允许我们使用,如果可以,是否有解决方法? 提前致谢。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我们可以在Windows操作系统中使用Int 13h(直接磁盘读/写)吗?或者Windows保护模式不允许我们使用,如果可以,是否有解决方法? 提前致谢。
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
不,Windows 子系统在启动期间初始化时,会重新配置内核的 BIOS 中断处理,因为 BIOS 调用是 16 位,而不是保护模式,因此 int 13h 将无效。这就是为什么有一些驱动程序是为 32 位保护模式编写的,完全绕过 BIOS。
这就引出了一个问题——你为什么要这么做?
Windows 会在任何与 BIOS 通信的尝试中终止您的代码,就好像在说“嘿,你编码,你以 Windows 老板的身份跟我说话,你无法绕过我,mwuah 哈哈 < em>请勿侵犯我的领域'。
int 13h 唯一被使用的时间是在 Windows 加载之前的启动阶段,或者如果您使用 MSDOS 作为系统,即没有 Windows,只需启动到 MSDOS,那么 int 13h 将有效使用。在这两种情况下,它们都是 16 位模式,因此可以访问 BIOS。
据我所知,我相信有一个常见的中断0x2E,那就是内核的系统调用。
简而言之,我不建议尝试绕过Windows系统,这就是为什么有一个驱动程序可以为你做这件事,你最好与驱动程序作为磁盘I/O子系统的一部分进行交互并让它为您处理。
No, The Windows sub-system, upon initialization during boot, would have reconfigured the BIOS interrupt handling for the kernel as the BIOS calls are 16bit, not protected mode and hence int 13h would be invalid. That is the reason why there are drivers which are written for 32bit protected mode which bypasses the BIOS completely.
Which begs the question - why are you trying to do that?
Windows will kill your code on any attempt to communicate with the BIOS as if saying 'Hey, you code, you talk to me as the Windows Boss, you cannot bypass me, mwuah ha ha DO NOT TREAD ON OUTSIDE MY DOMAIN'.
The only time int 13h would be used would be during boot stage BEFORE windows loads or if you are using MSDOS as the system i.e. no windows, just boot into MSDOS, then the int 13h would be valid to use. In both cases, they would be 16bit mode and hence the BIOS would be accessible.
There is a common interrupt 0x2E I believe, that is the kernel's system call, as far as I know.
In short, I would not recommend trying to bypass the Windows system, that is why there is a such thing as a driver to do that for you, you would be better off to interact with the driver as part of the disk i/o subsystem and let that handle it for you.
有了正确的权限(管理员拥有),您可以使用Win32 CreateFile和相关函数直接访问物理驱动器和逻辑分区。请参阅 MSDN 文档。
With the right permissions (administrator has them), you can use Win32 CreateFile and related functions to access physical drives and logical partitions directly. See the MSDN documentation.
正如其他人提到的,除非您使用 16 位 - MSDOS,否则它不会工作,但如果您使用的是 32 位系统并且有 debug.exe 你可以自己尝试一下。 (你的操作系统可能会崩溃!)只需输入命令 mov ax 等.. int 13h 等.. 然后执行它。
As others have mentioned it won't work unless you are using 16 bit - MSDOS, but if you are on a 32 bit system and have debug.exe you could try it for yourself. (You may crash your OS!) Simply enter the commands mov ax, etc.. int 13h etc.. then execute it.
Int 13h 在 Windows 中不起作用尝试
Int 13h doesn't work in Windows try