How a bootloader can read a DVD(cd)?

邮差的信 提交于 2020-01-11 10:34:12

问题


I have a first stage bootloader written in assembly. I need that it loads the second stage bootloader from dvd(or cd). I only found examples where it reads from floopy or hdd. The interrupt used there is 13h. In the interrupt description it says that it can read floppies and hdd's. i've tried to use 13h to read a CD as if it was a floppy but it did not work.

Question: is there a difference between floppies and dvd's (in the sense of accessing them), can i use CHS(cilinder, head, sector), what its the sector size, can i use the 13h instruction to correctly read a dvd. maybe some examples. I've looked at LILO's source code and found only 13h there so it must work. Thanks.


回答1:


A bootloader loads from DVD - it loads from floppy or hard disc. The DVD / CD runs in emulation mode and exposes a floppy / disc during the boot process




回答2:


You can make a bootable CD out of a bootable floppy image file with the mkisofs tool. Here's how I do it under Windows:

  1. Create a subdirectory, CdFiles, containing a bootable floppy image file, floppy.img (1474560 bytes long), and any other files that I want on the CD.
  2. mkisofs.exe -b floppy.img -v -r -l -o cd.iso CdFiles

It will create a CD ISO image file, cd.iso, which you can either burn on a CD and boot from the disk or use in any PC emulator and boot directly from the image.

The BIOS will emulate a floppy drive on the CD with the contents of floppy.img and it will be able to access itself normally via int 13h using drive number 0. In order to access the entire CD via int 13h you will need to create a hard drive image (bootable) and specify a different emulation method (not sure how to do it with mkisofs, never tried hdd images). The same will happen, but now a hard drive will be emulated on top of the CD and it will be drive number 80h for int 13h.




回答3:


LILO doesn't work for booting from CDs, so I wouldn't expect it to contain any code for reading those. Try taking a look at the ISOLINUX bootloader, which is what's most often used on Linux boot CDs.



来源:https://stackoverflow.com/questions/7776450/how-a-bootloader-can-read-a-dvdcd

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!