Page 1 of 1
How can I read other sectors from USB disk?
Posted: Thu May 23, 2013 7:24 am
by Levent
I mean I can wirte my boot to the first sector of USB and In my boot code I will read other sectors which contains the 2nd stage(loader) . But I don't know how to read these sectors . which Bios int should I use ? Are there other ways ?Who can help me ?
Re: How can I read other sectors from USB disk?
Posted: Thu May 23, 2013 7:50 am
by Mikemk
Levent wrote:I mean I can wirte my boot to the first sector of USB and In my boot code I will read other sectors which contains the 2nd stage(loader) .
(SIC). That's the common method...
But I don't know how to read these sectors .
Obviously.
which Bios int should I use ?
Try 0x13, ah = 2 or 0x42
Are there other ways ?
Yes, but they won't fit in a bootloader.
Who can help me ?
Yourself.
Re: How can I read other sectors from USB disk?
Posted: Thu May 23, 2013 7:55 am
by Levent
Thank you ,m12! I will have a try. Hopefully it will work.
Re: How can I read other sectors from USB disk?
Posted: Thu May 23, 2013 8:33 pm
by Levent
I did it ! I use int 0x13, ah=0x42 (LBA mode), drive number is 0x82 (0x80 is the hard disk in my computer,0x81 may be the slave hard disk from which I failed to read a sector. So I tried 0x82,and it worked!)
Different motherboards support different ways of usb boot, the bios on my motherboard read the first sector of usb disk.But other bioses may not read the first sector of usb disk. You'd better figure out which sector bios reads .
Re: How can I read other sectors from USB disk?
Posted: Fri May 24, 2013 1:58 am
by Griwes
Don't "try" disk numbers, use what was passed in dl upon passing control to the bootloader. It's 101 of every sane bootloader tutorial...
Re: How can I read other sectors from USB disk?
Posted: Fri May 24, 2013 7:54 am
by Levent
Griwes wrote:Don't "try" disk numbers, use what was passed in dl upon passing control to the bootloader. It's 101 of every sane bootloader tutorial...
Can you tell me more about it ? I am a newbie.
Re: How can I read other sectors from USB disk?
Posted: Fri May 24, 2013 8:42 am
by Mikemk
Levent wrote:Griwes wrote:Don't "try" disk numbers, use what was passed in dl upon passing control to the bootloader. It's 101 of every sane bootloader tutorial...
Can you tell me more about it ? I am a newbie.
Try learning assembly...