How to read boot sector of USB keys

Programming, for all ages and all languages.
User avatar
DavidCooper
Member
Member
Posts: 1150
Joined: Wed Oct 27, 2010 4:53 pm
Location: Scotland

Re: How to read boot sector of USB keys

Post by DavidCooper »

Hercules wrote: Do NOT lie to me. I've tested for drive numbers 0x81,0x82,0x83,0x84,0x85 and none of them are the drive number of removable media. Why nobody help me at this forum? Gggghhhhrrr! :x
I did tell you it won't work on all machines, though it does work with QEMU's BIOS on all my machines, so I suspect it may work on any machine if you work through QEMU. If you can't get it to work there, there's most likely a bug in your code, though alternatively it may be that the whole thing's being messed up by DOS in some way, given that that's what you seem to be booting up the machine with in the first place, but that's outside my knowledge as I never use DOS as a bootloader (and I doubt that anyone else here does either).
Help the people of Laos by liking - https://www.facebook.com/TheSBInitiative/?ref=py_c

MSB-OS: http://www.magicschoolbook.com/computing/os-project - direct machine code programming
User avatar
Geri
Member
Member
Posts: 442
Joined: Sun Jul 14, 2013 6:01 pm

Re: How to read boot sector of USB keys

Post by Geri »

most bios have hard disk emulation for usb pendrives for dos compatibility and boot ability, so if you actually boot from it, it will be just act like a generic hard disk accessed through 0x80.
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: How to read boot sector of USB keys

Post by Combuster »

Hercules wrote:Do NOT lie to me.
I didn't see anything wrong in David's post. However:
Hercules wrote:Why nobody help me at this forum?
It is you who must not tell lies. :wink:

*Ahem*


Dear Hercules,

It's become painfully obvious you're not good enough for this. Not even close. Do yourself a favour and find a new hobby.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
nerdguy
Member
Member
Posts: 70
Joined: Wed Oct 30, 2013 8:11 am

Re: How to read boot sector of USB keys

Post by nerdguy »

Hercules,
Can you tell what drive number you get from the BIOS? What is the value of DL when your boot sector
is loaded? Where are you testing this?
When you say, "I wrote a program that crashed Windows," people just stare at you blankly and say, "Hey, I got those with the system, for free." - Linus Torvalds
64 bit Kernel in early development
http://github.com/nerdguy12/core64
Post Reply