Hello,
I have a bin file from my NASM boot loader. I want to write it to a hard drive img used by Bochs and have it boot up. Can anyone tell me how to do that?
Im on WindowsME. I dont have access to spiffy Linux hehe :).
Thanks!
Torch
I have a bin file from my NASM boot loader. I want to write it to a hard drive img used by Bochs and have it boot up. Can anyone tell me how to do that?
Im on WindowsME. I dont have access to spiffy Linux hehe :).
Thanks!
Torch
Here are two options that I can think of:
• Use debug to load the image, then do a sector write
• Look up rawrite.exe (DOS port of a Linux utillity.)
• Use debug to load the image, then do a sector write
• Look up rawrite.exe (DOS port of a Linux utillity.)
I thought RaWrite only writes imgs to floppies?
I have gotten by with writing the bin to a floppy and then imaging the floppy, but thats alot of work to test small changes. I want to write it to the hd img.. which is 10 megs (I dont need anything big.. it's a small OS right now).
How would I use your suggestions?
I have gotten by with writing the bin to a floppy and then imaging the floppy, but thats alot of work to test small changes. I want to write it to the hd img.. which is 10 megs (I dont need anything big.. it's a small OS right now).
How would I use your suggestions?
if you want only to test your bin file, why would u write (or insert) your binary file to "hd.img", why wouldn't u just try to produce a floppy image from a bin file, by appending '\0' or something else, to fit the 1,44 M.
if u want, i'll send u the prog that does it, u just type
prog test.bin
and it will produce a "a.img" file, that u can run in bochs a floppy image.
if u want, i'll send u the prog that does it, u just type
prog test.bin
and it will produce a "a.img" file, that u can run in bochs a floppy image.
Try to see if you can find a dos or win32 port of "mtools", that makes
work with images much easier (I think it support HD images as well
as floppy images).
work with images much easier (I think it support HD images as well
as floppy images).
All known links are dead for the dos port.. all thats left is the Linux stuff. I havent found a working link yet.. and Ive been looking for 2 days hehe
Partcopy might do the trick.
Just search for "john fine partcopy" or something like that.
Just search for "john fine partcopy" or something like that.
I have Partcopy.. Ive only used it to write to floppies.
It does write to img files, but when I write it to offset 0 (I assume thats where..) Bochs crashes. Am I doing something wrong? The bin is a standard 512 bytes.
Could someone show me what to do? :)
Thanks!
Torch
It does write to img files, but when I write it to offset 0 (I assume thats where..) Bochs crashes. Am I doing something wrong? The bin is a standard 512 bytes.
Could someone show me what to do? :)
Thanks!
Torch
here is it, check the source it is written in C++(-) though it easy to decipher...
Its C.. no C++ in it :)
It looks similar to my boot disk writer I wrote.. never thought about having it write to a floppy img *smacks himself on the forehead* hehe :).
My crashing problem with Bochs still hasnt been resolved. Boot floppy images work, partcopying to the hd img doesnt want to work.. Im probably doing something wrong with it though.
Any ideas?
Torch
It looks similar to my boot disk writer I wrote.. never thought about having it write to a floppy img *smacks himself on the forehead* hehe :).
My crashing problem with Bochs still hasnt been resolved. Boot floppy images work, partcopying to the hd img doesnt want to work.. Im probably doing something wrong with it though.
Any ideas?
Torch
Torch:
Now I dont use bochs, but if the hd.img file is an exact replica of a hd, i.e. if at offset 0 in the img file there is a mbr, you would destroy the partition entries by writing 512 bytes. Try writing only 446 bytes.
Now I dont use bochs, but if the hd.img file is an exact replica of a hd, i.e. if at offset 0 in the img file there is a mbr, you would destroy the partition entries by writing 512 bytes. Try writing only 446 bytes.
http://bochs.sourceforge.net
You can get it there.
Here is my boot.bin.. It doesnt do anything put show a message heh.. dont laugh :).. Im only starting :).
I also added the bochsrc that Bochs uses to find out what to do.
See what you can come up with when you have time :).
You can get it there.
Here is my boot.bin.. It doesnt do anything put show a message heh.. dont laugh :).. Im only starting :).
I also added the bochsrc that Bochs uses to find out what to do.
See what you can come up with when you have time :).
in your "bochsrc.txt" i saw this two lines ...
# choose the boot disk.
boot: a
then bochs, will look for "floopya.img" as the config file states
floppya: 1_44=floppya.img, status=inserted
u get to run my proggy, to produce u file called "a.img"
- change this line
floppya: 1_44=floppya.img, status=inserted
- to
floppya: 1_44=a.img, status=inserted
and if your boot sector "boot.bin" is right, u'll get it works
try with my boot file, to see what wrong with yours, it's written in TASM
# choose the boot disk.
boot: a
then bochs, will look for "floopya.img" as the config file states
floppya: 1_44=floppya.img, status=inserted
u get to run my proggy, to produce u file called "a.img"
- change this line
floppya: 1_44=floppya.img, status=inserted
- to
floppya: 1_44=a.img, status=inserted
and if your boot sector "boot.bin" is right, u'll get it works
try with my boot file, to see what wrong with yours, it's written in TASM
I figured out the problem..
I hadnt formatted the img file with fdisk. But what's weird is that when I part copy.. the file is the exact same thing whether I formatted and part copied, or I didnt format and part copied :/.. The formatted and part copied boots, but the other one doesnt even though its the same file heh.. weird :/
I hadnt formatted the img file with fdisk. But what's weird is that when I part copy.. the file is the exact same thing whether I formatted and part copied, or I didnt format and part copied :/.. The formatted and part copied boots, but the other one doesnt even though its the same file heh.. weird :/