PartCopy in x64 Bit Windows

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
JackTDawson
Posts: 5
Joined: Thu Feb 24, 2011 11:54 am

PartCopy in x64 Bit Windows

Post by JackTDawson »

Ok, I searched all over this forum, and I came across some good answers to questions. But none answered the question I am looking for.

Partcopy is the only program that I know that has been 100% successful in taking TWO bin files ( one that is bootable ) and splicing them together into one floppy disk.

NOTE : For those who did NOT know this.. There are TWO versions of PartCopy :

This is the one that works under DOS and any 32-Bit windows. IT WILL NOT WORK under ANY x64 Bit windows and is NO LONGER supported. The author has already stated how he is NOT going to support it for x64 Bit Operating Systems.
http://www.brokenthorn.com/forums/viewt ... =15&t=1587 They tell one guy to make his own.. :/

http://www.brokenthorn.com/Resources/Programs/


This is the new one but its limited and only 1 file at any time. It also doesn't work with real of virtual floppy disks BUT does make IMG files. However, it doesn't allow the option of a 2nd file into the IMG file. So its useless for OS creation with more then one file.
http://www.virtualobjectives.com.au/uti ... rtcopy.htm

I used to use the old Partcopy version for my OS with these command line parameters :
partcopy BootUp.bin 0 200 -f0 0
partcopy mycode.bin 0 FFFF -f0 201

The first line would take the 512 Byte bootcode file and put it in the beginning of the floppy ( Offset 0h )

The 2nd Line would then append from position in HEX 201 forward the second file to that same floppy disk. ( Offset 201h )

NOW THE PROBLEM.....

With the New ( x64 Bit compatible ) PartCopy, I can put the BIN file at a specific spot with the OFFSET. But only one file at a time. If I add another one, it just replaces the file. It doesn't append like the original PartCopy does.

I switched to a 64 Bit windows to be able to use more ram ( above 4 gigs ) and its also a better computer.

I now have a virtual floppy disk set back up using ImDisk Virtual Floppy controller. It seems to work. ( The original VFD refuses to work in any Windows x64 Bit machines. )

But.. the NEW partcopy DOES NOT WORK for me because it does not talk to virtual or REAL floppy disks. It only creates IMG files and it only inputs one file at a time. Meaning, I cannot seem to get both of the Bin files I created INTO one IMG file. From that IMG file I could mount it into CD. That's not the problem. The problem is getting the OFFSET correctly installed for the 2nd file since I cannot just drag and drop. And the original partcopy you could specify it and it would work with the VFD, but the new version does not.

So now I'm stuck. The WinImage that some say works, does NOT work for multiple files when it comes to offsets. The 2nd file MUST be in a specific spot on the Floppy / CD. Offset = 200h or 201h respectively.

Anyone get around this Windows 7 x64 Operating System Customization floppy issue working ? Without using a virtual box to have to install a 32 Bit operating system just for this one problem ?
User avatar
neon
Member
Member
Posts: 1568
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: PartCopy in x64 Bit Windows

Post by neon »

Hello,

1. Please use the official link over our copy of the software. The author might appreciate it;
2. Writing your own software to perform the task is an acceptable answer and isnt hard to do;

If both of these binary files need to be written to sectors 0 and 1 on disk (as it appears to be the case), and you can only write 1 file to the image, why not append both binary files together into a single image using the command line copy command? You can then write the resulting image to the disk or floppy image.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
JackTDawson
Posts: 5
Joined: Thu Feb 24, 2011 11:54 am

Re: PartCopy in x64 Bit Windows

Post by JackTDawson »

neon wrote:Hello,

1. Please use the official link over our copy of the software. The author might appreciate it;
2. Writing your own software to perform the task is an acceptable answer and isnt hard to do;

If both of these binary files need to be written to sectors 0 and 1 on disk (as it appears to be the case), and you can only write 1 file to the image, why not append both binary files together into a single image using the command line copy command? You can then write the resulting image to the disk or floppy image.
I would be happy to put the official link to the OLD partcopy if I knew where it was. The link I posted for the older software is the only one I could find.

The new version has a Link to the official software already.

And the copy command does combine them. Thank you, but it still doesn't allow me to setup the OFFSETs. And I have tried to use other file splitters and such but they do not offer OFFSET options. And before I attempt to spend weeks on creating an offset program I was hoping someone had already made one. Its why I, and other people, have posted questions like this all over.

I mean they do exist, just not for 64Bit Systems like Windows 7. The original PartCopy is perfect accept it will NOT run in x64 Systems.
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: PartCopy in x64 Bit Windows

Post by Combuster »

What is there about using dd (it's part of cygwin if you haven't got it yet) that does not solve the problem? it can write both actual hardware and images, and can copy any input to any location on some media.
"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 ]
JackTDawson
Posts: 5
Joined: Thu Feb 24, 2011 11:54 am

Re: PartCopy in x64 Bit Windows

Post by JackTDawson »

Combuster wrote:What is there about using dd (it's part of cygwin if you haven't got it yet) that does not solve the problem? it can write both actual hardware and images, and can copy any input to any location on some media.

I removed my last message, sorry about that, I didn't realize what you said until after I wrote my message to you the first time. I'll check out DD. Thanks for the help.

UPDATE : Ok, I have no clue what DD is. I checked out CygWin and its complicated. There is a ton of files to download from the looks of it and there is no "DD" program. Have any tuts on this ?
Tosi
Member
Member
Posts: 255
Joined: Tue Jun 15, 2010 9:27 am
Location: Flyover State, United States
Contact:

Re: PartCopy in x64 Bit Windows

Post by Tosi »

It's a port of a semi-POSIX environment to Windows. If you want to learn the command shell any basic UNIX shell tutorial should do. As for the documentation for dd, make sure you install man and coreutils and type "man dd" in the shell.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: PartCopy in x64 Bit Windows

Post by Brynet-Inc »

The version of dd available for cygwin/mingw are probably closer to what's on other Unix systems, but a "native" clone exists.. and was the first result on Google.

http://www.chrysocome.net/dd
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
JackTDawson
Posts: 5
Joined: Thu Feb 24, 2011 11:54 am

Re: PartCopy in x64 Bit Windows

Post by JackTDawson »

Brynet-Inc wrote:The version of dd available for cygwin/mingw are probably closer to what's on other Unix systems, but a "native" clone exists.. and was the first result on Google.

http://www.chrysocome.net/dd
Ok downloaded. Thanks for the tip. i'll check it out. :)
thumble
Member
Member
Posts: 29
Joined: Thu May 25, 2017 10:41 pm

Re: PartCopy in x64 Bit Windows

Post by thumble »

In a nutshell, DD lets you write to a bunch of different places. For example, to write to the built-in virtual floppy (/dev/fd0), we can do this:

Code: Select all

dd if=your_binary_or_file_to_write.bin of=/dev/fd0
You could also write to a floppy image.

Code: Select all

dd if=still_your_file_to_write.bin of=image.img
You can even write to different sectors!

Code: Select all

dd if=other_binary.bin of=/dev/fd0 bs=512 seek=1
(this writes to sector 1)

DD is somewhat risky, though, especially if you're writing to a real disk (i.e. /dev/sda, /dev/sdb, ..) It has been nicknamed Data Destroyer, because it can wipe out whole disks without warning if you're root. Use caution.

Now, I don't personally use Cygwin, but I do use WSL POSIX environment in Windows. I used apt-get to install, but in Cygwin's package manager you should be able to find DD somewhere.
SK317
Posts: 4
Joined: Thu Oct 26, 2017 7:25 pm

Re: PartCopy in x64 Bit Windows

Post by SK317 »

Hi, I think we have the same request. Here is what I did. I am using fedora to do this.
I have three .bin files boot.bin loader.bin and kernel.bin

First I write these three files into .img file with desired offset and length and then write the whole .img file to usb thumb drive.

# make img file
sudo dd if=boot.bin of=c.img bs=512 count=1 conv=notrunc # from sector 0 and 1 sector length
sudo dd if=loader.bin of=c.img count=10 seek=1 conv=notrunc # from sector 1 and 10 sector length
sudo dd if=kernel.bin of=c.img count=20 seek=11 conv=notrunc # sector 11 and 20 sector length

# write into usb thumb drive.
sudo dd if=c.img of=/dev/sdd count=40 bs=512 conv=notrunc # /dev/sdd is my usb thumb drive

Then I use usb thumb drive to run my OS in the target machine.
Nemindapra
Posts: 1
Joined: Thu Jul 16, 2020 2:08 pm
Libera.chat IRC: Neminda

Re: PartCopy in x64 Bit Windows

Post by Nemindapra »

Hi I'm having a problem using SK317's method.

I have a boot.bin file and kernel.bin file.

If I want to use your method to write the whole .img file to usb drive, how can I know the desired offset and length for my boot.bin and kernel.bin files?
Post Reply