Sdimgr DISK-BLOB Size algorithm

  • Thread starter Thread starter Slobodan Brcin \(eMVP\)
  • Start date Start date
S

Slobodan Brcin \(eMVP\)

Hi Harald,

Can you describe exactly your goal and current procedure that you use to create SDI file with DISK BLOB?
I cannot determine the scale factors 1000*1000 or 1024*1024
when the documentation speaks about Kilo- Mega and Gigabytes.

I suck in telling jokes especially on English, but one that apply to your question goes something like this.
If you ask physician how many bytes there is in one kilobyte he will say 1000.
If you ask programmer how many meters there are in one kilometer he will say 1024 :-)

Regards,
Slobodan
PS: What or better to say why are you doing so many calculations, for what end?
 
Hello,

Sdimgr Size algorithm

i have trouble to specify suitable sizes for my SDI Images:

For booting i dont use SDI Files containing a "PARTITION BLOB".
Instead i build them with a disk BLOB, which also works fine for
network boot ( rdimageoffset=36352 instead of 4096 ).
Disk Blobs can be loaded and maintained with sdiloader. This
allows commit of a running RAMDISK with "snapshot.exe" from
"www.drivesnapshot.de" after driver installation and hardare detection.

Sdimgr creates nearly every size of total SDI size, but the
formatted Partitions within the BLOB seems to be aligned on
a track based algorithm. This results in more or less ( up to8 Mbtye )
waisted space in the SDI File.

I cannot determine the scale factors 1000*1000 or 1024*1024
when the documentation speaks about Kilo- Mega and Gigabytes.

Is there formula which gives the optimal SDI size for SDIMgr to create
a BLOB from a given number of logical disk tracks?

My workarond for now is a lookup from the following (incomplete) table:
My goal is : compute a proper setting for sdiauth.dll in the appened vbs
code.

' SDI Disk Header : 4096 + 512
' SDI Disk CHS Mapping : 255Heads 63Sectors a 512Byte
' SDI Track Capazity : 8225280B = 0x7D8200 Bytes
' SDI /readpartition result in
' SDI PartSize = TrackSize - 63*512 + 4096

' Trks Size SDI-PartSize Explore ca.
SDiMgr
'---------------------------------------------------------------------------
--

' 08 = 65802240 = 0x03EC1000 Part 65765888
' 09 = 74027520 = 0x04699200 Part 73991168 74452992
' 10 = 82252800 = 0x04E71400 Part 82216448 82841600 616960
' 11 = 90478080 = 0x05649600 Part 90441728 91230208 779568
' 12 = 98703360 = 0x05E21800 Part 98667008 100667392
' 13 = 106928640 = 0x065F9A00 Part 106892288 106958048
' 14 = 115153920 = 0x06DD1C00 Part 115117568 115121152 ~116500000
' 15 = 123379200 = 0x075A9E00 Part 123342848 123345020 ~124900000
' 16 = 131604480 = 0x07D82000 Part 131568128 131571712 133173248
~134134000
' 17 = 139829760 = 0x0855A200 Part 139793408 140206080 141561856
~141600000
' 18 = 148055040 = 0x08D32400 Part 148018688 148022272 149950464
~150000000
' 19 = 156280320 = 0x0950A600 Part 156243968 156247040 158339072
~158400000
' 20 = 164505600 = 0x09CE2800 Part 164469248 164472832 165679104
~165700000
' 21 = 172730880 = 0x0A4BAA00 Part 172694528
' 22 = 180956160 = 0x0AC92C00 Part 180919808
' 23 = 189181440 = 0x0B46AE00 Part 189145088
' 24 = 197406720 = 0x0BC43000 Part 197370368


Public Property Get pSdiDiskSize( nSizeEstimated )
Const cFkt = "SdiSize> "
Dim aSdiSizes : aSdiSizes = Array()
Dim i
Dim nTrack : nTrack = 8225280 ' SDI Track Capazity = 0x7D8200 Bytes
Dim nHeader: nHeader = 4608 ' SDI Disk Header Size 0x1000 + 0x200
Dim nSize
Dim sStr : sStr = ""
Call oLog.fInfo( cFkt & "request=" & nSize )
If formulaWorksproperly Then
' compute Sizes
For i = 8 to 24
If Ubound( aSdiSizes ) < i Then Redim Preserve aSdiSizes( i - 8 )
sStr = sStr & vbCrLf
nSize = CLng( i * nTrack )
sStr = sStr & "Tracks = " & Right( "0" & i , 2 )
sStr = sStr & " = " & Right( " " & nSize , 10 )
sStr = sStr & " = 0x" & Right( "0000" & Hex( nSize ) , 8 )
nsize = CLng( nSize - ( (63*512 ) + 4096 ) )
sStr = sStr & " Part" & Right( " " & nSize , 10 )
aSdiSizes( i - 8 ) = nSize
Next
Else
' workaround fixed lookuptabe

aSdiSizes = Array( 66064384, 74452992, 82841600, 91230208, _
100667392, 106958048, 116500000, 124900000, _
134134000, 141600000, 150000000, 158400000, _
165700000 )
End if
For i = 0 to UBound( aSdiSizes )
If ( nSizeEstimated < aSdiSizes( i ) ) Then
Call oLog.fInfo( cFkt & "granted=" & aSdiSizes( i ) )
pSdiDiskSize = aSdiSizes( i )
Exit Property
End If
Next
pSdiDiskSize = nSize
aSdiSizes = Array()
End Property

Kind Regards

Harald
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top