How can I read other sectors from USB disk?
How can I read other sectors from USB disk?
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?
(SIC). That's the common method...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) .
Obviously.But I don't know how to read these sectors .
Try 0x13, ah = 2 or 0x42which Bios int should I use ?
Yes, but they won't fit in a bootloader.Are there other ways ?
Yourself.Who can help me ?
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
If you're new, check this out.
Re: How can I read other sectors from USB disk?
Thank you ,m12! I will have a try. Hopefully it will work.
Re: How can I read other sectors from USB disk?
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 .
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 .
- Griwes
- Member
- Posts: 374
- Joined: Sat Jul 30, 2011 10:07 am
- Libera.chat IRC: Griwes
- Location: Wrocław/Racibórz, Poland
- Contact:
Re: How can I read other sectors from USB disk?
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...
Reaver Project :: Repository :: Ohloh project page
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations
<klange> This is a horror story about what happens when you need a hammer and all you have is the skulls of the damned.
<drake1> as long as the lock is read and modified by atomic operations
Re: How can I read other sectors from USB disk?
Can you tell me more about it ? I am a newbie.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...
Re: How can I read other sectors from USB disk?
Try learning assembly...Levent wrote:Can you tell me more about it ? I am a newbie.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...
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
If you're new, check this out.