Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

writing over mbr

Status
Not open for further replies.

neos

Programmer
Oct 28, 2000
36
0
0
CA
hey,
i have a school project to do. i have to write a bootsector that restarts the computer. i got that done, using nasm, but now i need some way to write the bootsector to the mbr. so instead of the computer booting into windows, my bootsec gets loaded. Can someone show me how this might be done? the computer for the project is an old 486, and has no security/anti-virus programs on it. its running win95. can i write a nasm program that will do this? i assume i am using asm to do this.
 
I advise you to only change bootsectors on floppies, especially if you don't know how to restore the original bootsector (in another way than formatting the entire disk, that is).
Using debug you can specify an address when writing to a disk drive, or you can make an extra program that reads/writes the bootsector using INT 13h.
Regards,
Bert Vingerhoets
vingerhoetsbert@hotmail.com
Don't worry what people think about you. They're too busy wondering what you think about them.
 
ive been fooling around with floppies for awhile. i know ur not supposed to mess with the mbr, but this is for school, and the computer were using is going to be reformatted regardless.
so i could use debug and write the bootsec to 07c0:0000?
 
Yes you can probably use debug for that. "Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
appearently windows dosent let debug directly access the hard drive, so ive heard. so i would like to try writing mi own assembly program using int 13h to write to the mbr. can comeone give me an example, or point me to a good tutorial. ive been tryin to find one, cant!
 
Try pressing F8 when Win95's booting (at the "Windows is now starting..." message). Then select MS-DOS mode and go ask debug to do it.

Tough luck if you're using WinXP though hahaha "Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
i am now involved in developing my own os. can any one of u tell me what to write in a bootsector program and how to load it in the bootsector.

thank u
aruna
 
concerning absolute disk access (mbr, boot rec etc) - my favorite tool is diskedit from old good norton utilites 7 (for dos). just read the binary image file on de clipboard and paste over target. dont forget to apply changes!
under win9x one WILL NEED use LOCK command to get direct disk access. but personally i prefer to boot to dos in any way i can do it.

alex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top