Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account


Photo

On Superfloppies and their Images

- - - - -

  • Please log in to reply
161 replies to this topic

#51
dencorso

dencorso

    Adiuvat plus qui nihil obstat

  • Super Moderator
  • 5,757 posts
  • OS:98SE
  • Country: Country Flag

Donator

I'd say DOS 6.22 isn't a good idea. MS-DOS 7.10 from Win 98SE would be much safer. When in DOS, the DOS device driver for the LS-120 should be loaded from config.sys. On a windows DOS Box, within Win 98SE this may not be necessary, and it would be the first way I'd try. Never mind that Win 98SE is unable to mount the volume, I bet it creates the virtual SCSI device all right. Do give it a shot.


How to remove advertisement from MSFN

#52
jaclaz

jaclaz

    The Finder

  • Developer
  • 13,994 posts
  • OS:none specified
  • Country: Country Flag
@dencorso
Yes, the "FREE" options are used as "separators", to divide three "logically grouped sets":
  • three common floppy formats (compatible with the El-torito standard)
  • three max floppy formats (compatible with the rloew's findings on the El-Torito standard)
  • All the rest (less common floppy formats)
*any* of them can be used, they correspond to "blank" values...

Since Multibooter is also around here :thumbup , I would ask him to post a set of the formats/sizes (and OTHER data) of the hardware he is playing with, like the LS-120/240, the 32 M floppy and the ZIP and clik (PocketZip) discs....

I liked the way it does not impose, but just suggests sensible values, and that it goes on with the red "Calculated image size from data:", until it considers the paramenters sensible.

Yes, that is what I find the most important things and that I hope Drugwash will implement in his nice tool, the problem is not really to create a bootsector BPB, but rather calculating "reasonable" (if not "right" values).

I have changed the .bin to something less common, .t#p :)

Thanks for testing, but I am interested in your (and everyone else's) ideas/comments/corrections on the "naming" and ".ini" idea.

As well, the "Sector per Head" is "intentional", since we have (on hard disks) an addressing convention called CHS (and not CTS) and AFAIK/AFAICR "Track" is used almost exclusively in conjunction with "real" floppies, I thought it to be more descriptive, but this is part of the naming convention that I would like to get a "common agreement upon", just like "Sectors Before" vs. "Hidden Sectors".

About serial, is not a problem to calculate a "random one", I even have *somewhere* a (clever :unsure:) spreadsheet I made to calculate (for forensic scopes) the probabilities of a serial to be an actually "kosher generated" one or a "random" (please read as "counterfeited" one.
Since the algorithm is (partially) reversible something can be done in that sense, but this is an alltogether different topic.


jaclaz

Attached Files


Edited by jaclaz, 08 August 2011 - 02:54 AM.


#53
Multibooter

Multibooter

    Friend of MSFN

  • Member
  • PipPipPipPipPip
  • 896 posts
  • OS:98SE
  • Country: Country Flag

MS-DOS 7.10 from Win 98SE would be much safer... and it would be the first way I'd try. Never mind that Win 98SE is unable to mount the volume, I bet it creates the virtual SCSI device all right.

You were right, AFDISK came up Ok in a Win98SE DOS box, it displayed under Select SCSI Device: "HA #2 - Target 0 MATs***ALS-120 COSM 03". This was the only device displayed, I had a an LS-120 drive connected at the parallel port.

Unfortunately, when I pressed Enter to select the LS-120 drive, the following msg came up:
"!!! Unable to Partition Drive !!!
The ASPI manager controlling this device is returning a Head/Sector translation scheme which this revision of AFDISK does NOT support."

I also connected a USB LS-120 drive and a PCMCIA LS-120 drive, but AFDISK just displayed the msg :"No SCSI drives were found."

When I connected an Iomega zip 100 drive to the parallel port, with a good 100MB zip disk inside, AFDISK listed the drive as as "HA #0 - Target 6 IOMEGA ZIP 100", but when I selected it, the following msg was displayed:
"!!! ATTENTION !!!
You have selected a SCSI drive which is controlled by DOS though the Host Adapter BIOS. Use DOS FDISK and FORMAT commands to partition and format the device.
AFDISK will only allow you to view the devices partitions."

With a bulk-erased zip disk inside the Iomega zip drive, AFDISK displayed the following err msg:
"!!! ERROR OCCURRED DURING IO OPERATION !!!
Read Capacity Command. Check Status Returned. <target 6>
CDB: 25 00 00 00 00 00 00 00 00 00"

If some tool could write track 0 onto these bulk-erased removable disks, GRDuw could subsequently probably transfer the image of a good LS-120 diskette or of a good zip 100 disk to the bulk-erased LS-120/zip disk. By using the image of a virgin LS-120/zip disk, the bulk-erased disk would then be nicely re-initialized and formatted.

Edited by Multibooter, 08 August 2011 - 02:58 AM.


#54
jaclaz

jaclaz

    The Finder

  • Developer
  • 13,994 posts
  • OS:none specified
  • Country: Country Flag

If some tool could write track 0 onto these bulk-erased removable disks, GRDuw could subsequently probably transfer the image of a good LS-120 diskette or of a good zip 100 disk to the bulk-erased LS-120/zip disk. By using the image of a virgin LS-120/zip disk, the bulk-erased disk would then be nicely re-initialized and formatted.


Probably stupid question, but what happens with a "plain" dd-like tool? :unsure: :whistle:

What happens with MHDD?
http://hddguru.com/s...005.10.02-MHDD/

Or with ZAP?
http://www.digitalis...m-wipe-zap.html

Also, I would try the whole set of thingies here:
http://www.shlock.co...Utils/index.htm
the diskimg and omnidisk for DOS first

Also maybe you can create your own parameters for NFORMAT :unsure:
http://toastytech.co...es/nformat.html

jaclaz

Edited by jaclaz, 08 August 2011 - 03:50 AM.


#55
dencorso

dencorso

    Adiuvat plus qui nihil obstat

  • Super Moderator
  • 5,757 posts
  • OS:98SE
  • Country: Country Flag

Donator

And also try AFDISK again in true DOS, after loading the apropriate ASPI drivers.

#56
rloew

rloew

    MSFN Expert

  • Member
  • PipPipPipPipPipPip
  • 1,083 posts
  • OS:98SE
  • Country: Country Flag

As well, the "Sector per Head" is "intentional", since we have (on hard disks) an addressing convention called CHS (and not CTS) and AFAIK/AFAICR "Track" is used almost exclusively in conjunction with "real" floppies, I thought it to be more descriptive, but this is part of the naming convention that I would like to get a "common agreement upon", just like "Sectors Before" vs. "Hidden Sectors".

"Sectors per Head" would not make much sense since that would be half of a entire Floppy Disk.
The concept of Cylinders and Heads, sometimes even Sectors, is meaningless on Hard Disks as they use Zone Recording. Even though Floppies have "Tracks", you do not address them as such in the controller. You select a Head that can access the desired Range of Tracks. This is why you have CHS not CTS.

About serial, is not a problem to calculate a "random one", I even have *somewhere* a (clever :unsure:) spreadsheet I made to calculate (for forensic scopes) the probabilities of a serial to be an actually "kosher generated" one or a "random" (please read as "counterfeited" one.
Since the algorithm is (partially) reversible something can be done in that sense, but this is an alltogether different topic.

Typically the Volume Serial number is generated from the Current Date/Time.



@all As far as the problem with Formatting LS-120 Disks, there are at least Four different situations, listed here in increasing severity:

1. Disk accessible and Mounts.
Access: Interrupts 0x13, 0x21, 0x25, 0x26
Format: Nearly any Formatter will do.

2. Disk accessible but does not Mount.
Access: Interrupt 0x13
Format: Track 0 Writer, my RFDISK.

3. Disk low level Formatted, not accessible by BIOS or Windows.
Access: Direct Port I/O
Format: Low level Disk Utilities, SCSI Tools, My RFDISK (raw mode maybe). For SCSI devices, use Command 4 (Format).

4. Disk blank, bulk-erased, or headers corrupted.
Access: Direct Port I/O maybe or Manufacturer only Connector or Rig.
Format: Depends (see below) Same as #3 if SCSI Command 4 works (A).
Possible Solutions for SCSI:
A: SCSI Format Command (4).
B: Undocumented SCSI Formatting Command (?). Manufacturer's tool may work.
C: Manufacturer's Formatting Rig.
D: Neighborhood Recycling Center.

I do not have a LS-120 so I don't know what is required but the previous Posts are not encouraging. Maybe a SCSI Mode Select Command followed by a SCSI Format Command would help.

A Track Zero Writer is not going to work on a bulk-erased Disk. Even if it could low level Format the Track you would still not be able to write anything to the rest of the Disk.

Low Level Formatting capability is built into the Floppy Controller so FORMAT can do the Low Level Formatting on the entire Disk before writing Track Zero. This is not generally the case with other
magnetic media.

Edited by rloew, 08 August 2011 - 01:23 PM.

Ye who enter my domain. Beware! Lest you become educated in the mysteries of the universe and suffer forever from the desire to know more.

#57
dencorso

dencorso

    Adiuvat plus qui nihil obstat

  • Super Moderator
  • 5,757 posts
  • OS:98SE
  • Country: Country Flag

Donator

Perhaps DISKEDIT.EXE (from Norton Utilities 2002 ..10E) with the /M switch for the ATAPI/IDE LS-120 drive (if it's recognized by the BIOS) on true DOS or (even more delicate) on a Win 98SE DOS box, after telling it to proceed, regardless of its dire warning.

Another idea is either HDD raw Copy Tool or HDD LLF from HDDGuru. There are many possibilities with those tools, but I'd bet on SCSI mode.

#58
dencorso

dencorso

    Adiuvat plus qui nihil obstat

  • Super Moderator
  • 5,757 posts
  • OS:98SE
  • Country: Country Flag

Donator

Even if this is nowadays not more than an intangible metaphor, for floppy disks and very old hard disks (winchester disks, remember them?) a sector is the minimum transferable data packet, a track is a collection of sectors on the same side of the disk, which are at the same distance from the center, and a cylinder is a collection of tracks of the same number throughout the different heads, so that they delineate an imaginary actual cylinder. So, a cylinder is made of tracks and a track is made of sectors. That's why it must be "Sectors per Track".

Attached File  Cylinder-Sectors.jpg   8.62KB   2 downloads Attached File  HDD1.jpg   13.73KB   2 downloads


The left-hand Figure shows reasonably well the relationship between cylinders and tracks, while the one at the right hand highlights in yellow a full track (with its respective sectors) and in blue a single sector within another track.
Now, floppy that have two sides do actually have cylinders: they are composed of the tracks of the same number on each side. Only sigle sided floppies "don't have" cylinders, or, more precisely, are in a situation where tracks = cylinders.

... of course, this is just a model, and as such, not more than a thought-aid, with little or no compromise to reproduce reality (for floppies, for instance, the actual tracks on one side are not exactly below those on the other side, but interleaved instead, in order to minimize the magnetic "print-through"), which always is more "complicated".

#59
Multibooter

Multibooter

    Friend of MSFN

  • Member
  • PipPipPipPipPip
  • 896 posts
  • OS:98SE
  • Country: Country Flag

What happens with MHDD?
http://hddguru.com/s...005.10.02-MHDD/

Under DOS 6.22, with an LS-120 drive connected at the parallel port and a good LS-120 diskette inside, err msg at program start:

"* * * CATASTROPHIC FAILURE * * *
<Message>
MH_SCSIP.SDRV_INQUIRY FAIL
<End of Message>"

I guess MHDD didn't get along with the parallel port driver of the LS-120 drive, or with the IDE/ATAPI to parallel bridge by Shuttle Connection in the drive enclosure.

The manual of MHDD lists as supported hardware "Any SCSI removable media such as tape, CDROM". I would generalize that any formatting software which does not specifically mention the type of superdisk drive (e.g. LS-120, Iomega zip, Iomega jaz) in the program description or in the program menu, will not work with that particular type of superdisk drive.

@dencorso
I had tried HD LLF from HDDguru earlier, but it doesn't see an LS-120 drive at the parallel port. HD LLF is my tool of choice for wiping HDDs, that's why I tried MHDD, also for download at HDDguru, first.

Edited by Multibooter, 09 August 2011 - 12:54 AM.


#60
jaclaz

jaclaz

    The Finder

  • Developer
  • 13,994 posts
  • OS:none specified
  • Country: Country Flag

"Sectors per Head" would not make much sense since that would be half of a entire Floppy Disk.
The concept of Cylinders and Heads, sometimes even Sectors, is meaningless on Hard Disks as they use Zone Recording. Even though Floppies have "Tracks", you do not address them as such in the controller. You select a Head that can access the desired Range of Tracks. This is why you have CHS not CTS.

OK, I'll try again.
In a typical hard disk with a CHS geometry of nx255x63 in the MBR there are two fields that are normally called (see also my old page here):
http://jaclaz.alterv...B/USBstick.html
bHead	
BHd	
Starting Head	
Starting Head	
Starting Head
and
eHead	
EHd	
Ending Head	
Ending Head	
Ending Head
in populated entries, and with the "old" alignment standard, in the "BHd" field there is normally 1 (in first partition, because of the hidden first Track ;)) or 0, whilst in the "EHd" one there is 254 (as heads are numbered in CHS starting from 0).

In the corresponding bootsector, the field "Number of Tracks" or "Number of Heads" is 255.

And two called:
bSect	
BSec	
Starting Sector	
Starting Sector	
Starting Sect
and:
eSect	
ESec	
Ending Sector	
Ending Sector	
Ending Sect
in populated entries, and with the "old" alignment standard, in the "BSec" field there is normally 1, whilst in the "ESec" one there is 63 (as sectors are numbered in CHS starting from 1).

In the corresponding bootsector, the field "Sectors per Track" or "Sector per Head" is 63.

To me in this context of bullding volumes that can be either a volume on Hard disk or represent a "superfloppy", a Head or a Track are exactly the same thing, for which two different names are used, one for floppies and one for Hard Disks.

The size of the volume in bytes is given by:
Bytes_per_Sector*Sectors_per_Head*Number_of_Heads
or:
Bytes_per_Sector*Sectors_per_TracK*Number_of_Heads

No problem whatsoever in naming the field "Sectors_per_ Track" :), but then also the "Number_of_Heads" should become "Number_of_Tracks", thus losing any logical connection with the MBR. :unsure:


Typically the Volume Serial number is generated from the Current Date/Time.

Sure :), dencorso already posted the algorithm used and the little spreadsheet I was talking about was a reversing of that algorithm to check if the Volume serial had been tampered with, by detecting possible dates/times that may have generated the serial and verify if they were within a possible timeframe.
This applies to DOS but NOT to NT systems, for which the algorithm is not AFAIK known.
Here are some details:
http://www.forensicf...iewtopic&t=2134

jaclaz

Edited by jaclaz, 09 August 2011 - 06:24 AM.


#61
rloew

rloew

    MSFN Expert

  • Member
  • PipPipPipPipPipPip
  • 1,083 posts
  • OS:98SE
  • Country: Country Flag

To me in this context of bullding volumes that can be either a volume on Hard disk or represent a "superfloppy", a Head or a Track are exactly the same thing, for which two different names are used, one for floppies and one for Hard Disks.

A Track is one ring of data on one side of a Floppy. A Head can access an entire side, or platter in an old Hard Drive.
The same names are used for Floppies and Hard Disks.

The size of the volume in bytes is given by:
Bytes_per_Sector*Sectors_per_Head*Number_of_Heads

Yes.

or:
Bytes_per_Sector*Sectors_per_TracK*Number_of_Heads

No. This is the size of a Cylinder.

No problem whatsoever in naming the field "Sectors_per_ Track" :), but then also the "Number_of_Heads" should become "Number_of_Tracks", thus losing any logical connection with the MBR. :unsure:

Number_of_Tracks would not be the same. It would equal the Number of Cylinders multiplied by the Number of Heads.
The confusion occurs because of the mixture of data descriptions on the Disk with the hardware access control nomenclature.
A pure data based definition would be as follows:

Sectors per Track
Tracks per Cylinder
Cylinders per Disk (Total Cylinders)
Ye who enter my domain. Beware! Lest you become educated in the mysteries of the universe and suffer forever from the desire to know more.

#62
jaclaz

jaclaz

    The Finder

  • Developer
  • 13,994 posts
  • OS:none specified
  • Country: Country Flag

No. This is the size of a Cylinder.


Sure, sorry :blushing: , I missed the "final" "*Number_of_Cylinders" (that is not a "field" in the bootsector) in the case of hard disk and "*Number_of_Tracks" ( or number of "whatever") (that is also not a "field" in the bootsector) in the case of floppy.

Let's take the example of a "super-floppy" of 9,437,184 bytes, 512 bytes/sector.
That makes 18432 sectors.
Let's say that we have an "extended" ED disk drive :w00t:, thus m/2/36
  • It has 256 "whatever #1"<-this is NOT a field in the bootsector
  • it has 2 "whatever #2" (Sides?, Heads? Tracks?) <-this is a field in the bootsector
  • It has 36 "whatever#3" (Sectors_per_Track? Sector per Head?) <-this is a field in the bootsector

9,437,184 is given by:
Bytes_per_Sector*whatever#3*whatever #2*whatever #1
512*36*2*256=9,437,184

A partition/volume on hard disk 18432 sectors, 512 bytes each, totaling 9,437,184 bytes in size on a hard disk with a nx64x32 CHS geometry will have (let's assume that it is a very small second partition and that we do respect cylinder/head boundaries), first partition being:
CHS 0/1/1-19/63/32 LBA 32/40928
will have:
CHS 20/0/1-28/63/32 LBA 40960/18432

9,437,184 is given by:
Bytes_per_Sector*whatever#3*whatever #2*whatever #1
512*32*(63-0+1)*(28-20+1)=9,437,184

The differences between the two bootsectors should be:
  • whatever#3 (temporarily named "Sectors_per_Head") 36 vs 32
  • whatever #2 (temporarily named "Number_of_Heads ") 2 vs 64
  • "Sectors_Before" (or "Hidden Sectors") 0 vs. 40960
  • "Media_Type" (this should be OK :)) 240 vs 248

How can the two "whatever" be named so that they are "self-explaining" in both cases? :unsure:

jaclaz

Edited by jaclaz, 09 August 2011 - 11:48 AM.


#63
dencorso

dencorso

    Adiuvat plus qui nihil obstat

  • Super Moderator
  • 5,757 posts
  • OS:98SE
  • Country: Country Flag

Donator

To me in this context of bullding volumes that can be either a volume on Hard disk or represent a "superfloppy", a Head or a Track are exactly the same thing, for which two different names are used, one for floppies and one for Hard Disks.

While I don't disagree with you, after some musing, I think you are insisting in using the most misleading label possible, for an otherwise simple thing. :P So let me make some considerations on what CHS is:

Cylinder is the set of all tracks that are at the same distance from the center. Once you define a value for "Cylinder", the position of the whole head-manifold (which moves all heads solidarily) is fixed. So Cylinder means "distance from the center".

Head is which of the heads is the head-manifold that is activated. In general, that means just which side of which plater will be used, and in this general sense, head means "side". However, after fixing the cylinder, defining a head defines one side of one platter, and as such, it does define which track inside the cylinder is used. But this is true solely when the cylinder has already been fixed. And that's why "sectors per track" is unmistakeable and graphic, while "sectors per head" requires contextualizing.

Sector indicates which part of the track selected by the other two coordinates is to be addressed.

Moreover, there's no reason at all for different uses for floppies and hard-disks, unless you go all the way back to single sided floppies, for which cylinder = track and head is irrelevant, because there can be only one (as Connor McCloud used to say :) ).

#64
jaclaz

jaclaz

    The Finder

  • Developer
  • 13,994 posts
  • OS:none specified
  • Country: Country Flag

While I don't disagree with you, after some musing, I think you are insisting in using the most misleading label possible, for and otherwise simple thing :P
So let me make some considerations on what CHS is:

I am actually not asking for "considerations", I am only asking for two (actually three) names we can all agree upon and that are understandable by users, and that make sense BOTH when we are talking of a superfloppy image and when we are talking of a hard disk volume, and I am not "insisting" in anything, only explaining my wrong (in the sense of simplified :ph34r: ) way to describe things in the given context, as you may know the graphical and mechanical representations are completely meaningless on any modern (meaning what, last 15 years? :unsure:) hard disk, so that maybe was CHS.

We have THREE fields that I temporarily (and mistakenly) named:
  • Sectors_per_Head
  • Number_of_Heads
  • Sectors_Before

How should they be named?
  • Sectors_per_Track
  • Number_of_Heads
  • Hidden_Sectors

Is that OK? :unsure:

This only affects the actual variable names, I reserve the right to call them (as I understand them the wrong way) in the "textual part":
  • Sectors per Track (Sectors per Head)
  • Number of Heads
  • Hidden Sectors (Sectors Before)

I also asked, PLEASE for additional corrections to the two added sheets in the Workbook, and to verify and FILL the missing data.
Can I have them?
Or everything is already "perfect" (I doubt it, but I may have been lucky)

jaclaz

#65
rloew

rloew

    MSFN Expert

  • Member
  • PipPipPipPipPipPip
  • 1,083 posts
  • OS:98SE
  • Country: Country Flag

We have THREE fields that I temporarily (and mistakenly) named:

  • Sectors_per_Head
  • Number_of_Heads
  • Sectors_Before

How should they be named?
  • Sectors_per_Track
  • Number_of_Heads
  • Hidden_Sectors

CHS is only literal for Floppies and very old Hard Drives. For everything else the interface is emulated. It is still the same protocol so the same nomenclature should be used for all.

For numbers 1 and 2, I would stick with the latter set which represents the standard nomenclature.

Number 3 is an entirely different story. It has nothing to do with CHS. Hidden_Sectors is Microsoftese. It makes little sense since earlier Partitions can lurk in the space. It would have been more appropriate for the "Reserved Sectors" field at offset 0xE. I personally would suggest "Start_Sector" as it is the primary purpose of the field in primary (possibly Bootable) Partitions. In Logical Partitions it is often set to the Offset from the corresponding Extended Partition, so "Sector_Offset" is another option.
Ye who enter my domain. Beware! Lest you become educated in the mysteries of the universe and suffer forever from the desire to know more.

#66
dencorso

dencorso

    Adiuvat plus qui nihil obstat

  • Super Moderator
  • 5,757 posts
  • OS:98SE
  • Country: Country Flag

Donator

I'll review it again more closely by the weekend, but for now, here's what I got to offer:

1) For the Common Floppy Formats list:

800K size=819,200 sectors=1600 c=80 h=2 s=10 (b/s)=512 (s/c)=1 Re=112 Mt ?
1600K Re=224
1760K - 1920K Re=224

The above also adds "10" to the list of known values for sectors_per_track (aka sectors_per_head)

2) For the question of the labels, my suggestion is:

1. Sectors_per_Track
2. Number_of_Heads
3. Sectors Before

3) While I didn't review the FreeDOS bootsector sheet, I did better than that for the MS-DOS sheet:
I actually booted my 128MB SD card using that bootsector and it works OK. So I suppose it's mainly OK, but I'll review both byte by byte during the weekend.

4) I didn't review the INI sheet very closely, because it's not clear to me which application is it intended to work with. Can you please elaborate?

Later edit:
Never mind. I had failed to notice the quote below in a previous post of yours. It's clear enough. I'll review the .INI bearing it in mind.

I added a tentative way of "classification" and naming and an example .ini, as I am thinking we can use a .ini file to create a "database" of known formats and/or let the user choose only a subset of the available and/or have a common "interchange" format between different utilities/scripts.



#67
Multibooter

Multibooter

    Friend of MSFN

  • Member
  • PipPipPipPipPip
  • 896 posts
  • OS:98SE
  • Country: Country Flag

Hidden_Sectors is Microsoftese... It would have been more appropriate for the "Reserved Sectors" field at offset 0xE. I personally would suggest "Start_Sector"

How about using the terms which Roberto Grassi, the author of GRDuw, the best software for superfloppies, has used in his Disk Information Report, e.g. http://www.msfn.org/...post__p__970657 or http://www.msfn.org/...post__p__973379

Edited by Multibooter, 09 August 2011 - 05:19 PM.


#68
rloew

rloew

    MSFN Expert

  • Member
  • PipPipPipPipPipPip
  • 1,083 posts
  • OS:98SE
  • Country: Country Flag

Hidden_Sectors is Microsoftese... It would have been more appropriate for the "Reserved Sectors" field at offset 0xE. I personally would suggest "Start_Sector"

How about using the terms which Roberto Grassi, the author of GRDuw, the best software for superfloppies, has used in his Disk Information Report, e.g. http://www.msfn.org/...post__p__970657 or http://www.msfn.org/...post__p__973379

It uses the standard notation for CHS.
It also uses "Hidden Sectors" which a number of people, including me, object to.
Ye who enter my domain. Beware! Lest you become educated in the mysteries of the universe and suffer forever from the desire to know more.

#69
jaclaz

jaclaz

    The Finder

  • Developer
  • 13,994 posts
  • OS:none specified
  • Country: Country Flag

It also uses "Hidden Sectors" which a number of people, including me, object to.

Yes, it is "innatural".
Both "Start_Sector" and "Sector_Offset" are both better, the "Sectors_before" comes from the same comparison about different "partition related tools":
http://jaclaz.alterv...B/USBstick.html
SectBefore	
StartSector	
Sectors Before	
Relative Sectors	
Starting
I find it a plain English way (without entering in the detail tha LBA sectors are numbered from 0) to describe what the field should contain, still in the "hard disk" world, the LBA start address is the number of "sectors before" and:
TotSectors	
NumSectors	
Sectors	
Total Sectors
is the number of sectors in the partition, corresponding to either of the two fields "Small_Type_Sectors" and "Large_Sectors", where also as seen before there is not yet an univocal agreement:

"Sectors 16" and "Sectors 32"


@dencorso
The idea of the .ini has several "goals" :w00t:
  • have a "standard" way to exchange "complete" information about such images/formats. As we have seen in this an similar threads it is easy to forget "passing" a parameter (like the number of "ROOT" entries) and often sources you can find miss this or that detail
  • a .ini file (besides being parsable by *anything*, including batches ;)) can be posted "as is" on the board or inside an e-mail, or whatever
  • using a .ini the spreadsheet could output such a .ini and one could use a "generic" batch or program to simply load the .ini settings, being it "plain text" it could be easily modified/tweaked without any spreadsheet app and without actually changing values in the batch, everyone could write his/her own little program to read the "common format" .ini and produce the image, adding also features like "full", "truncated" and "sparse" (this could be "cross-platform")
  • another operation that could be done through an "extension" of the app could be replacing what bootpart does (with a number of limitations) and/or correcting the "Sectors Before" ;) to make logical volumes inside extended bootable, the use of the .ini would be a way to put down all data needed when performing this "kind" of operation and then each program may take from it only what is needed and there could be an app that dreates the .ini from an existing volume or image
  • additionally, in situations like the "flashing cursor" or "j in top left of the screen" the user asking for help may run a little app to create the .ini and post it, and it would be a breeze to troubleshoot the issue...
  • the thing I find more needed is the actual image naming convention (the actual "section" of the .ini) as I often (please read as "always") find myself with a bunch of images with a name that give no hints of their contents, if we could devise a way of naming that would give a hint of the way the image was made, it's size and "contents" (in the sense of boot code in it) it would solve or mitigate this problem, and I am pretty sure I am not the only one having it

jaclaz

#70
dencorso

dencorso

    Adiuvat plus qui nihil obstat

  • Super Moderator
  • 5,757 posts
  • OS:98SE
  • Country: Country Flag

Donator

I see. I think the best way to determine the contents of the bootstrap code might be:

1. Copy the whole bootsector to a temporary buffer
2. Zero-out the first 64 bytes to remove the BPB down to a paragraph boundary.
3. Calculate the MD-5 Hash for the resulting image in the buffer.
This is fast and efficient, provided we create a list of such "truncated MD-5"s for all "known bootstraps"
The "truncated MD-5 of bootsector" or "partial bootstrap MD-5" would become an entry in the .INI, of course.

MD-5s have been gathering discredit in recent times because they're not unuque. However, they're way better than CRC-32s, and, moreover, only in very contrieved situations does their non-uniqueness manifest itself, so I do think they're still distinctive enough for our purposes and small enough, when compared with their "better" competitiors.

#71
rloew

rloew

    MSFN Expert

  • Member
  • PipPipPipPipPipPip
  • 1,083 posts
  • OS:98SE
  • Country: Country Flag

I see. I think the best way to determine the contents of the bootstrap code might be:

1. Copy the whole bootsector to a temporary buffer
2. Zero-out the first 64 bytes to remove the BPB down to a paragraph boundary.
3. Calculate the MD-5 Hash for the resulting image in the buffer.

64 Bytes is not enough. FAT32's BPB extends to 0x5A (90 Bytes). In addition it has another Sector of Code.
Ye who enter my domain. Beware! Lest you become educated in the mysteries of the universe and suffer forever from the desire to know more.

#72
dencorso

dencorso

    Adiuvat plus qui nihil obstat

  • Super Moderator
  • 5,757 posts
  • OS:98SE
  • Country: Country Flag

Donator

Very true... OK. If it should cater for FAT-32 too, let's make it thus:

1. Copy the whole bootsector to a temporary buffer
2. Zero-out the first 96 bytes to remove the BPB down to a paragraph boundary.
3. Calculate the MD-5 Hash for the resulting image in the buffer.

As for the fact that the bootstrap is divided in two sectors, I'd bet the MD-5 of just the last 416 bytes of the 1st sector should still be distinctive enough.

#73
allen2

allen2

    Not really Newbie

  • Member
  • PipPipPipPipPipPipPip
  • 1,812 posts
Sorry to intrude on this thread, but instead of calculating a md5 of something this small, i would compress it with 7zip (for example):
- You might be interested in looking at it after and you can't get it from its md5.
- You 'll have a limited number of md5 of bootstrap.
- Someone might have created a new bootstrap and then you'll need to update your md5 reference.
- How are you going to handle the unknown md5 ? If your entire bootstrap is stored, you can find the closest one (with a binary comparison for example) but you can't do this with md5.
- As you said 2 md5 might be identical and the probability for such thing on such a low number of bytes should be extremely low but even then you might want to be sure that they're different or not.
Sorry again if i am totally of topic there.

Edited by allen2, 10 August 2011 - 11:37 PM.


#74
jaclaz

jaclaz

    The Finder

  • Developer
  • 13,994 posts
  • OS:none specified
  • Country: Country Flag
FAT32 has actually three of them sectors, but I thought we were (at the moment) inside the FAT12/16 realm. :unsure:

With FAT32 we additionally have the "third" sector being in "variable places", namely, for the ones I remember:
  • MS_DOS sector 2
  • NT sector 12
  • ReactOS 14
Summed up here:
http://www.msfn.org/...t/page__st__103
(I presume - but haven't checked - that FreeDOS is similar to MS-DOS)

Using an MD5 or even a simpler algorithm is OK, I don't think we will ever have enough samples to have even a minimal possibility of a collision. :whistle:

Personally I think that zeroing out a number of initial bytes in the sectors is not the "right" approach. :ph34r:

Why not simply have:
the original bootsector(s) copy.
apply to it a .ini with all the values we will change, exception made for:
  • Jump_Bytes
  • OEM_String
  • System_ID
  • Magic_bytes
set to 00's?

jaclaz

#75
dencorso

dencorso

    Adiuvat plus qui nihil obstat

  • Super Moderator
  • 5,757 posts
  • OS:98SE
  • Country: Country Flag

Donator

The FAT-32 "bootsector" actually comprises 3 sectors, but since the second of these is the FSINFO sector, the bootstrap itself is somewhat less than 2 sectors, like I said.

Now, if we just consider the FAT12/16 bootsector for the moment, by simply zeroing out the first 64 bytes, we loose just the initial jump and two bytes of code before the region that would be preserved. I think that's acceptable. A more extensive idea would be just to zero out the BPB, then calculate the MD-5. Then again allen2 is right when he says that compressing the actual bootstrap might be more useful, although that would be less compact.

Another question you posed and that remained unanswered:
The MS standard (fatgen.pdf v. 1.03) has BPB_TotSec16 for BPB+0x10 and BPB_TotSec32 for BPB+0x1D, and I think this is good, in that it does not create ambiguity. I do think "Total Sectors (16)" and "Total Sectors (32)" are good labels. Of course, everybody else will disagree, but life is like that. :}

I've revised the bootsector sheets and they are correct, byte-by-byte. An interesting fact is that, when the FreeDOS bootsector is compared to the one present in the released floppy image version of FreeDOS 1.0 Final (2006-08-11), the bootstrap code in both is identical, but they have different OEM names, the one in your worksheet using the already classic FreeDOS, while the FreeDOS 1.0 Final (2006-08-11) floppy has "LINUX4.1" (attached).

Attached Files






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users



How to remove advertisement from MSFN