flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Problems With PartCopy

Author
Thread Post new topic Reply to topic
nathanpc



Joined: 23 Aug 2009
Posts: 40
Location: Brazil
nathanpc
Hello,
I'm trying to copy my binary file(created with Fasm) to the boot sector of a floppy. For this, I'm using PartCopy, but when I tried to copy, I got this:
Code:
C:\Documents and Settings\Nathan Campos\My Documents\OS Tests\BootProg>partcopy
boot.bin a: 0 200

C:\Documents and Settings\Nathan Campos\My Documents\OS Tests\BootProg>
PartCopy - Version 1.11 Release 2 Build 4
Copyright (C) 2005-2010 John Buoro, VirtualObjectives.
All Rights Reserved.
This program is Freeware and must not be distributed or sold for profit.

Using Command-Line Parameters
Source File = boot.bin
Destination File = a:
Start Position = 0
ERROR: Start position was not specified correctly.
Offset Length = 200
ERROR: Offset length was not specified correctly.    

What I need to do?

Best Regards,
Nathan Paulino Campos

_________________
Developer: C++, Java, C/C++, Java ME, Java EE, Pascal, Assembly(8086, 6502, z80, ARM and MIPS), Delphi, Visual Basic, Pascal, Ruby and Perl
Post 04 Jul 2010, 13:26
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17667
Location: In your JS exploiting you and your system
revolution
For PartCopy help perhaps Google can help you?

Does PartCopy not come with a help file?

Moved to OS Construction
Post 04 Jul 2010, 13:33
View user's profile Send private message Visit poster's website Reply with quote
nathanpc



Joined: 23 Aug 2009
Posts: 40
Location: Brazil
nathanpc
I've downloaded from the project homepage, but it didn't came with a help file. Sad
Post 04 Jul 2010, 13:55
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17667
Location: In your JS exploiting you and your system
revolution
Perhaps typing PartCopy without any parameters gives a usage/help response?
Post 04 Jul 2010, 13:58
View user's profile Send private message Visit poster's website Reply with quote
dosin



Joined: 24 Aug 2007
Posts: 337
dosin
just wondering - why use partcopy?

if on windows you can use debug to write to a floppy...
or there are other tools avail..

for debug:

type:
debug file_name.bin
-w 100 0 0 1

or you can use winimage -to make a floppy image..

ect..

http://wiki.osdev.org/Babystep1

scroll down to : Creating disk image
Post 04 Jul 2010, 16:07
View user's profile Send private message Reply with quote
Mac2004



Joined: 15 Dec 2003
Posts: 313
Mac2004
Here are some examples how to use partcopy:

http://hem.passagen.se/danma/nboot.htm

regards
Mac2004
Post 04 Jul 2010, 17:02
View user's profile Send private message Reply with quote
mindcooler



Joined: 01 Dec 2009
Posts: 423
Location: Västerås, Sweden
mindcooler
This is a little tool I made a couple of years ago. Writes the first 512 bytes of a file to the first 512 bytes of a floppy a:, which happens to be the boot sector. Only tested on XP.

Delphi 5 code:

Code:
program boohsec;
{$APPTYPE CONSOLE}
uses windows;
const IOCTL_DISK_IS_WRITABLE=458788;
var
   drivehandle:hwnd;
   buffer:array[0..511] of byte;
   n:cardinal;
   sectorfile:hfile;
   filename:widestring;

function getparam:widestring;
var
   posi:integer;
begin
   result:=getcommandlinew;
   if result[1]='"' then
   begin
      delete(result,1,1);
      posi:=pos('"',result);
      delete(result,1,posi+1);
   end
   else
   begin
      posi:=pos(' ',result);
      delete(result,1,posi);
   end;
end;

function MAKELANGID(p,s:word):dword;
begin
    result:=(s shl 10) or p;
end;

procedure err(title:widestring='Error');
var buffer:pwidechar;
begin
   FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER or
                  FORMAT_MESSAGE_FROM_SYSTEM or
                  FORMAT_MESSAGE_IGNORE_INSERTS,
                  nil,GetLastError,MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT),
                  @buffer,0,nil);
   MessageBoxW(0,buffer,pwidechar(title),mb_ok);
   halt(getlasterror);
end;

begin
   filename:=getparam;
   drivehandle:=createfile('\\.\a:',GENERIC_READ or GENERIC_WRITE,FILE_SHARE_WRITE,nil,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0);
   if not(DeviceIoControl(drivehandle,IOCTL_DISK_IS_WRITABLE,nil,0,nil,0,n,nil)) then
   begin
      MessageBox(0,'Drive is not writable',nil,mb_ok);
      halt(1);
   end;
   sectorfile:=createfilew(pwidechar(filename),GENERIC_READ,FILE_SHARE_READ,nil,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0);
   if sectorfile=INVALID_HANDLE_VALUE then
      err(filename);
   if not(readfile(sectorfile,buffer,512,n,nil)) then
      err('readfile');
   if not(writefile(drivehandle,buffer,sizeof(buffer),n,nil)) then
      err('writefile');
   closehandle(drivehandle);
end.    


Description: Boot sector writing tool (Delphi 5 source + exe).
Download
Filename: boohsec.zip
Filesize: 11.54 KB
Downloaded: 66 Time(s)


_________________
This is a block of text that can be added to posts you make.
Post 04 Jul 2010, 20:20
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.