My question is quite a bit theoretical, but I want to implement disk r/w to my Operating system, while I know how to do it in protected mode, it would take too long to implement ATAPI+ATA+FDC drivers (to make my OS boot on any device). I took two ideas to consider: Make my OS bootable only from pendrive (so I can handle only pendrive for disk r/w and it wouldn't take as much time), and jump to real mode, read sector, and jump back to protected mode. But AFAIK i have to be in conventional memory (IP can be max 65k) so CPU would crash as my kernel resides near 1MB mark. I use GRUB as bootloader and test my code in VMWare VirtualBox. My question is, should I implement USB mass memory driver or do it like DOS extenders do? If so, could you show me some code in C that for example goes back to real mode and waits for keypress, then goes back to protected mode? I can't pack data to kernel. My OS supports at the moment keyboard, advanced terminal functions and some utilities from C standard library.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):