OSDev.org

The Place to Start for Operating System Developers
It is currently Wed Apr 24, 2024 9:34 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: PartCopy in x64 Bit Windows
PostPosted: Thu Feb 24, 2011 1:06 pm 
Offline

Joined: Thu Feb 24, 2011 11:54 am
Posts: 5
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 ?


Top
 Profile  
 
 Post subject: Re: PartCopy in x64 Bit Windows
PostPosted: Thu Feb 24, 2011 2:14 pm 
Offline
Member
Member
User avatar

Joined: Sun Feb 18, 2007 7:28 pm
Posts: 1564
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();}


Top
 Profile  
 
 Post subject: Re: PartCopy in x64 Bit Windows
PostPosted: Thu Feb 24, 2011 3:54 pm 
Offline

Joined: Thu Feb 24, 2011 11:54 am
Posts: 5
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.


Top
 Profile  
 
 Post subject: Re: PartCopy in x64 Bit Windows
PostPosted: Thu Feb 24, 2011 4:50 pm 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
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 ]


Top
 Profile  
 
 Post subject: Re: PartCopy in x64 Bit Windows
PostPosted: Thu Feb 24, 2011 5:27 pm 
Offline

Joined: Thu Feb 24, 2011 11:54 am
Posts: 5
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 ?


Top
 Profile  
 
 Post subject: Re: PartCopy in x64 Bit Windows
PostPosted: Thu Feb 24, 2011 6:21 pm 
Offline
Member
Member

Joined: Tue Jun 15, 2010 9:27 am
Posts: 255
Location: Flyover State, United States
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.

_________________
Getting_Started on the wiki
x86 technical information
Interrupt Jump Table
Real Programmers Don't Use Pascal
My open-source projects


Top
 Profile  
 
 Post subject: Re: PartCopy in x64 Bit Windows
PostPosted: Thu Feb 24, 2011 8:07 pm 
Offline
Member
Member
User avatar

Joined: Tue Oct 17, 2006 9:29 pm
Posts: 2426
Location: Canada
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.


Top
 Profile  
 
 Post subject: Re: PartCopy in x64 Bit Windows
PostPosted: Thu Feb 24, 2011 9:27 pm 
Offline

Joined: Thu Feb 24, 2011 11:54 am
Posts: 5
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. :)


Top
 Profile  
 
 Post subject: Re: PartCopy in x64 Bit Windows
PostPosted: Fri Oct 27, 2017 10:54 pm 
Offline
Member
Member

Joined: Thu May 25, 2017 10:41 pm
Posts: 29
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:
dd if=your_binary_or_file_to_write.bin of=/dev/fd0


You could also write to a floppy image.

Code:
dd if=still_your_file_to_write.bin of=image.img


You can even write to different sectors!

Code:
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.


Top
 Profile  
 
 Post subject: Re: PartCopy in x64 Bit Windows
PostPosted: Sat Oct 28, 2017 6:04 am 
Offline

Joined: Thu Oct 26, 2017 7:25 pm
Posts: 4
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.


Top
 Profile  
 
 Post subject: Re: PartCopy in x64 Bit Windows
PostPosted: Thu Jul 16, 2020 2:31 pm 
Offline

Joined: Thu Jul 16, 2020 2:08 pm
Posts: 1
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot] and 128 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group