diff options
author | Patrick J Volkerding <volkerdi@slackware.com> | 2009-08-26 10:00:38 -0500 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2018-05-31 22:41:17 +0200 |
commit | 5a12e7c134274dba706667107d10d231517d3e05 (patch) | |
tree | 55718d5acb710fde798d9f38d0bbaf594ed4b296 /isolinux/sbootmgr | |
download | current-5a12e7c134274dba706667107d10d231517d3e05.tar.gz |
Slackware 13.0slackware-13.0
Wed Aug 26 10:00:38 CDT 2009
Slackware 13.0 x86_64 is released as stable! Thanks to everyone who
helped make this release possible -- see the RELEASE_NOTES for the
credits. The ISOs are off to the replicator. This time it will be a
6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD.
We're taking pre-orders now at store.slackware.com. Please consider
picking up a copy to help support the project. Once again, thanks to
the entire Slackware community for all the help testing and fixing
things and offering suggestions during this development cycle.
As always, have fun and enjoy! -P.
Diffstat (limited to 'isolinux/sbootmgr')
-rw-r--r-- | isolinux/sbootmgr/RAWRITE12.DOC | 86 | ||||
-rw-r--r-- | isolinux/sbootmgr/RAWRITENT.DOC | 176 | ||||
-rw-r--r-- | isolinux/sbootmgr/README.TXT | 29 |
3 files changed, 291 insertions, 0 deletions
diff --git a/isolinux/sbootmgr/RAWRITE12.DOC b/isolinux/sbootmgr/RAWRITE12.DOC new file mode 100644 index 00000000..f4871d1f --- /dev/null +++ b/isolinux/sbootmgr/RAWRITE12.DOC @@ -0,0 +1,86 @@ +RaWrite 1.2 +----------- + +Purpose +------- + +Write a disk image file to a 360K floppy disk. + + +Equipment/Software Requirements +------------------------------- + +PC/XT/AT with a floppy disk drive capable of reading and writing a 360K +diskette. + +This program uses generic low-level BIOS diskette read/write functions. It +should be portable to nearly every PC in existance. PS/2's should be able +to run RawWrite but this has not been tested. + + +CAVEAT +------ + +This program will write ANY disk file to a floppy, overwriting any previous +information that may have been present. If you wish to re-use a diskette +under MS-DOS thats been written to by RawWrite then the disk will need to be +reformatted; all MS-DOS specific information will have been erased. + + +How to Compile +-------------- + +TCC rawrite.c + +The source code is specific to Borland International's Turbo C 2.01 and has +been tested in all memory models. + + +Usage +----- + +C> RAWRITE + +And follow the prompts. All arguments are case-insensitive. + +A sample run is shown below. The disk file being written, in this example, +is named DEMODISK and the destination - where the image is being written - +is the B: drive. + +This program may be aborted at any time by typing ^C. + + +Sample Run +---------- + +C> RAWRITE +RaWrite 1.2 - Write disk file to raw floppy diskette + +Enter source file name: DEMODISK +Enter destination drive: B +Please insert a formatted 360K diskette into drive B: and press -ENTER- : +Writing image to drive B: + + +Errors +------ + +RaWrite attempts to determine if the diskette is a 360K, 720K, 1.2M, or +1.44M diskette by reading specific sectors. If the inserted diskette is not +one of the mentioned types, then RaWrite will abort with a short error +message. + +Errors such as write protect, door open, bad disk, bad sector, etc. cause a +program abort with a short error message. + + +History +------- + + 1.0 - Initial release + 1.1 - Beta test (fixing bugs) 4/5/91 + Some BIOS's don't like full-track writes. + 1.101 - Last beta release. 4/8/91 + Fixed BIOS full-track write by only only + writing 3 sectors at a time. + 1.2 - Final code and documentation clean-ups. 4/9/91 diff --git a/isolinux/sbootmgr/RAWRITENT.DOC b/isolinux/sbootmgr/RAWRITENT.DOC new file mode 100644 index 00000000..6b8dcb38 --- /dev/null +++ b/isolinux/sbootmgr/RAWRITENT.DOC @@ -0,0 +1,176 @@ +{ This Program is released unter the terms of the GNU Public License (GPL).
+ In short words this means anybody can do anything with it except incorporating it
+ in whole or part into a new application that is sold and/or marketed commercially,
+ without disclosing the sources to the public.
+ For further details, refer to www.gnu.org.
+
+ This program has been written by Benedikt Hochstrasser (bhoc@pentagroup.ch or
+ tictactux@swissonline.ch. Its purpose is to transfer raw images to diskette, just
+ like the rawrite program supplied with Slackware Linux. The difference is: this is
+ a native Windows NT application.
+ Syntax: RaWriteNT <source image file> <target drive>
+
+ Use at your own risk. Although that piece of software has been thouroughly tested I
+ am not responsible for any damage resulting in the use of this software. This software
+ will overwrite stuff stored on a direct-access storage device such as a diskette,
+ hard disk, zip drive, LS-120 drive or similar medium. You have been warned.
+
+ Zurich, Late August 2000. (c) 2000 bhoc@pentagroup.ch
+}
+
+program RaWriteNT;
+
+{$APPTYPE CONSOLE}
+{$D-,L-,Y-,C-}
+
+uses windows;
+
+{$R *.RES}
+
+const IOCTL_DISK_GET_DRIVE_GEOMETRY: Cardinal = $70000;
+
+type TDiskGeometry = record
+ Cylinders : Int64;
+ Media_Type : LongInt;
+ TracksPerCylinder : Cardinal;
+ SectorsPerTrack : Cardinal;
+ BytesPerSector : Cardinal;
+ end;
+
+var InFileName, OutFileName: String;
+ Drive: Char;
+ HIn, HOut, BufBytes, FileSize, MediaSize, BlkSize, BlkNum, i: Cardinal;
+ Buf: Array[0..65535] of Byte;
+ DriveGeometry: TDiskGeometry;
+
+function ExtractFileName(FullName: String): String;
+ { cf SysUtils.ExtractFileName - mimicked here for size purposes }
+ var i, n: integer;
+ begin
+ n := Length(FullName);
+ Result := FullName;
+ for i := n downto 1 do if FullName[i] = '\' then break;
+ if i > 1 then Result := Copy(FullName, i+1, n-i);
+ end;
+
+function IsWinNT: Boolean;
+ { that should be obvious }
+ var osinfo: TOSVersionInfo;
+ begin
+ Result := False;
+ osinfo.dwOSVersionInfoSize := SizeOf(osinfo);
+ if GetVersionEx(osinfo) then
+ Result := (osinfo.dwPlatformId = VER_PLATFORM_WIN32_NT);
+ end;
+
+procedure ReReadDrive;
+ { just invoke a dummy 'get free disk space' to re-initialize the drive after
+ the write }
+ var BytesPerSect, FreeCl, TotCl, SecPerCl: Cardinal;
+ begin
+ GetDiskFreeSpace(PChar(Drive + ':\'), SecPerCl, BytesPerSect, FreeCl, TotCl);
+ end;
+
+begin { finally. dah main program. }
+
+ Writeln;
+
+ { do the copyright messages }
+ Writeln('RaWriteNT 1.0 by Ben Hochstrasser (bhoc@pentagroup.ch)');
+
+ { discourage Win9x users }
+ If Not IsWinNT then begin
+ Writeln(ParamStr(0), ' has been tested under Windows NT only. Sorry...');
+ halt(255);
+ end;
+
+ { get parameters }
+ InFileName := '';
+ OutFileName := '';
+ if ParamCount > 0 then InFileName := ParamStr(1);
+ if ParamCount > 1 then OutFileName := ParamStr(2);
+ if InFileName = '' then begin
+ Write('Source Image File name: ');
+ Readln(InFileName);
+ if InFileName = '' then halt(255);
+ end;
+ if OutFileName = '' then begin
+ Write('Target Drive [A]: ');
+ Readln(OutFileName);
+ end;
+
+ { check target }
+ if OutFileName = '' then
+ Drive := 'A'
+ else
+ Drive := UpCase(Char(OutFileName[1]));
+ if GetDriveType(PChar(Drive + ':\')) in [DRIVE_FIXED, DRIVE_REMOTE, DRIVE_CDROM] then begin
+ Writeln('Drive ' + Drive + ': does not appear to be a removable (and writable) drive.');
+ Writeln('Hard Disks, Network Drives and CD-ROM Drives cannot be Targets. Sorry.');
+ Halt(255);
+ end;
+ { prepend the NT incantation stuff }
+ OutFileName := '\\.\' + Drive + ':';
+
+ { try to open devices }
+ HIn := CreateFile(PChar(InFileName), GENERIC_READ, 0, NIL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL or FILE_FLAG_SEQUENTIAL_SCAN, 0);
+ if HIn = 0 then begin
+ Writeln('Fatal Error: Cannot open ' + InFileName + ' for read.');
+ Halt(1);
+ end;
+ HOut := CreateFile(PChar(OutFileName), GENERIC_WRITE, 0, NIL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
+ if HOut = 0 then begin
+ Writeln('Fatal Error: Cannot open ' + OutFileName + ' for write.');
+ CloseHandle(HIn);
+ Halt(2);
+ end;
+
+ { overwrite 1st sector with 0 };
+ FillChar(Buf, 512, 0);
+ WriteFile(HOut, Buf, 512, BufBytes, NIL);
+ { get target geometry }
+ DeviceIoControl(HOut, IOCTL_DISK_GET_DRIVE_GEOMETRY, nil, 0, @DriveGeometry, SizeOf(DriveGeometry), BufBytes, NIL);
+ { determine sizes }
+ MediaSize := DriveGeometry.BytesPerSector * DriveGeometry.SectorsPerTrack * DriveGeometry.TracksPerCylinder * DriveGeometry.Cylinders;
+ FileSize := GetFileSize(HIn, Nil);
+ if FileSize > MediaSize then begin
+ Writeln('Oops - That file is too big for this medium (', FileSize, ' vs. ', MediaSize, ' Bytes).');
+ Halt(3);
+ end;
+ { block size is 1 track }
+ BlkSize := DriveGeometry.SectorsPerTrack * DriveGeometry.BytesPerSector;
+ { round up # of blocks if necessary }
+ BlkNum := (FileSize + BlkSize - 1) DIV BlkSize;
+ Writeln('Transferring ', FileSize, ' Bytes (',
+ (FileSize + DriveGeometry.BytesPerSector - 1) div DriveGeometry.BytesPerSector,
+ ' Sectors) from Image ', ExtractFileName(InFileName), ' to Drive ', Drive, ':');
+ { move file pointers to beginning }
+ SetFilePointer(hIn, 0, NIL, FILE_BEGIN);
+ SetFilePointer(hOut, 0, NIL, FILE_BEGIN);
+ { loop through all blocks }
+ for i := 1 to BlkNum do begin
+ if not ReadFile(HIn, Buf, BlkSize, BufBytes, NIL) then begin
+ writeln('Error ', GetLastError, ' on File Read');
+ break;
+ end;
+ if not WriteFile(HOut, Buf, BlkSize, BufBytes, NIL) then begin
+ writeln('Error ', GetLastError, ' on File Write');
+ break;
+ end;
+ write((100 * i) div BlkNum, '% completed.', #13);
+ end;
+ writeln;
+ { close files }
+ CloseHandle(HIn);
+ CloseHandle(HOut);
+
+ { re-read target medium information }
+ ReReadDrive;
+
+ If ParamCount = 0 then begin
+ Writeln;
+ Writeln('(Press any Key) ');
+ Readln;
+ end;
+end.
+
diff --git a/isolinux/sbootmgr/README.TXT b/isolinux/sbootmgr/README.TXT new file mode 100644 index 00000000..204d5d82 --- /dev/null +++ b/isolinux/sbootmgr/README.TXT @@ -0,0 +1,29 @@ +sbootmgr.dsk This nifty little tool allows selecting various devices to boot
+ from a menu, and even allows booting a CD-ROM in machines where
+ the BIOS doesn't support it (or it's supposed to support it, but
+ it just doesn't work). If you have trouble booting the
+ Slackware CD-ROM, you might try writing this image to a floppy,
+ booting it, and then selecting your CD-ROM drive as the boot
+ device.
+
+ The SBM installer is available as a Slackware package (called
+ "btmgr") in the extra/ packages collection.
+
+----------------------------
+Generic floppy image creation info:
+
+To create a floppy disk from one of these images, use the RAWRITE command on
+DOS or Windows. For example, to make the first rootdisk image (install.1),
+you'd put a formatted 1.44MB floppy in your floppy drive, and then run this
+command:
+
+C:\> RAWRITE INSTALL.1 A:
+
+There are several versions of RAWRITE provided to handle most versions of DOS
+and Windows. If one version doesn't seem to work, try another.
+
+To make the floppy images under Linux, use the "cat" command to send them to
+the floppy device. This command will make the first install disk:
+
+cat install.1 > /dev/fd0
+
|