Computing.Net > Forums > Programming > Writing to bootdisk

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Writing to bootdisk

Reply to Message Icon

Name: eaw8806
Date: February 25, 2003 at 11:22:53 Pacific
OS: win98
CPU/Ram: pentiumII/128MB
Comment:

how do you write to the bootdisk of a floppy? I want my program to run when the disk is inserted.



Sponsored Link
Ads by Google

Response Number 1
Name: w
Date: February 25, 2003 at 15:17:25 Pacific
Reply:

=====================================================================
in 16-bit asm code, compiled with TASM:

.model small
.code
org 100h

start:
call boot
ret

org 7C00h

boot:
mov ax, 0301h ;write one sector
mov bx, 7C00h ;from 0:7C00h
mov cx, 1 ;to track 0, sector 1, head 0
mov dx, 0 ; on drive A:
int 13h ; bios interrupt

mov ax, 0301h ; do it once more
int 13h ; to insure it works
ret

end start

well, the above code is COPIED from a book, ie. NOT my own code. it works under DOS.

in Win32, i don't know how, but i think it should quite similiar. int 13h will work before the operating system is loaded, as i know =)

please don't use it with the wrong purpose.


0

Response Number 2
Name: TopFarmer
Date: February 25, 2003 at 16:28:20 Pacific
Reply:

Hi you need to be more clear on what you want to do. The above would write data into the mbr of the floppy and if no correct data the floppy will not work. Or do you want a short program that will auto run a program on the floppy like happens with most cds?


0

Response Number 3
Name: wt (by think)
Date: February 25, 2003 at 18:16:14 Pacific
Reply:

Is there a way to make a floppy autorun ? I thought floppy will ONLY autorun at boot time when it is inserted into the drive AND the option in CMOS change to allow booting from floppy first.

If there is a way to make a floppy work like a autorun CD, yeah I want it (the program). Thank you!!

I suppose the above asm program will only outwrite the boot sector of a floppy (with anything?). The floppy wont boot the computer and even won't print the message "not a system disk" (or somthing like that), since it is destroyed.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Writing to bootdisk

Write to file noob question www.computing.net/answers/programming/write-to-file-noob-question/13381.html

Writing to my DAC www.computing.net/answers/programming/writing-to-my-dac/6338.html

write to file function www.computing.net/answers/programming/write-to-file-function/6533.html