Page 1 of 1

Doubt - USB PENDRIVE

Posted: Mon Apr 21, 2014 6:05 pm
by digo_rp
Hi, all!

It´s a pleasure to be in here again, could anyone help me about that doubt? I don´t know how USB Works,

like, how to put my os on it ? its works like floppy disk emulator? I´m trying to find out some docs but I have a poor english, and I can´t find out!.

could anyone helps me ? could be anyting,

thanks a lot,

Re: Doubt - USB PENDRIVE

Posted: Mon Apr 21, 2014 7:27 pm
by Octocontrabass
digo_rp wrote:its works like floppy disk emulator?
If sector 0 does not have a valid partition table, it will work like a floppy disk.

Re: Doubt - USB PENDRIVE

Posted: Tue Apr 22, 2014 12:21 pm
by DavidCooper
If you want to boot from a USB pendrive (flashdrive), don't waste time trying to pretend it's a floppy disk. Treat it as a hard drive and put MBR code into sector 0, but keep the original partition table that the manufacturer put at the top of that sector. You will need to rewrite some of your code so that it can load using LBA sector numbers instead of CHS, but it's worth the effort. A modified version of your original bootsector will then become a VBR which will sit at the start of a partition, and the MBR code will load this sector in and hand over control to it so that the VBR can boot your OS. Start your research here: http://wiki.osdev.org/MBR.