Kaynağa Gözat

commit: Fix crash on create RamDisk from file large than 2GB; Change default TargetName format; Update bdd format spec

HOME 5 yıl önce
ebeveyn
işleme
7e6e462705

+ 30 - 6
DiskAccessLibrary/Mod/BlockDifferencingDiskImage/BddFormat.txt

@@ -1,4 +1,4 @@
-Sln - 1
+Sln - 1 Initial version
 =======
 =======
 2: Length of based image file path
 2: Length of based image file path
 N: Based image file path UTF-8
 N: Based image file path UTF-8
@@ -7,7 +7,7 @@ N: Based image file path UTF-8
 N: Block index table
 N: Block index table
 N: Dynamic allocated data blocks
 N: Dynamic allocated data blocks
 
 
-Sln - 2
+Sln - 2 Reserved base image file path for flexible change [Not adopted]
 =======
 =======
 65535-8: Fixed Based image file path UTF-8
 65535-8: Fixed Based image file path UTF-8
 4: Size of Block Byte
 4: Size of Block Byte
@@ -15,8 +15,16 @@ Sln - 2
 N: Block index table
 N: Block index table
 N: Dynamic allocated data blocks
 N: Dynamic allocated data blocks
 
 
+Sln - 3 No based image just dynamic allocate
+=======
+2: Zero value to indicate 
+4: Size of Block Byte
+4: Number of Blocks
+N: Block index table
+N: Dynamic allocated data blocks
+
 
 
-Block index entry
+Block index entry Rev.1  16 Bytes [Not adopted]
 =================
 =================
 4: Flags
 4: Flags
     Bit0: when allocated then set bit0 from 0 to 1
     Bit0: when allocated then set bit0 from 0 to 1
@@ -24,9 +32,25 @@ Block index entry
 8: Offset 64bit unsigned integer
 8: Offset 64bit unsigned integer
 4: Resvered, Checksum?
 4: Resvered, Checksum?
 
 
-
-Block index entry Rev.2
+Block index entry Rev.2  8 Bytes
 =======================
 =======================
 8: Compound bits
 8: Compound bits
     Bit0~62: Offset of data block
     Bit0~62: Offset of data block
-    Bit63: Allocated flag
+    Bit63: Allocated flag
+
+Block index entry Rev.3  8 Bytes
+=======================
+8: Compound bits
+    Bit00~07: O O O O  O O O O
+    Bit08~15: O O O O  O O O O
+    Bit16~23: O O O O  O O O O
+    Bit24~39: O O O O  O O O O
+    Bit40~47: O O O O  O O O O
+    Bit48~56: S S S S  S S S S
+    Bit57~63: R R R R  R R C A
+
+    O: Offset of data block in file
+    R: Reserved bits, not used yet
+    S: If block data all same, the value
+    C: Compacted, use with S
+    A: Allocated flag

+ 1 - 1
ISCSIConsole/AddTargetForm.cs

@@ -36,7 +36,7 @@ namespace ISCSIConsole
 
 
         private void AddTargetForm_Load(object sender, EventArgs e)
         private void AddTargetForm_Load(object sender, EventArgs e)
         {
         {
-            txtTargetIQN.Text = String.Format("{0}:target{1}", DefaultTargetIQN, m_targetNumber);
+            txtTargetIQN.Text = String.Format("{0}:target-{1:00}", DefaultTargetIQN, m_targetNumber);
         }
         }
 
 
         private void btnCreateDiskImage_Click(object sender, EventArgs e)
         private void btnCreateDiskImage_Click(object sender, EventArgs e)

+ 1 - 1
ISCSIConsole/CreateRAMDiskForm.cs

@@ -125,7 +125,7 @@ namespace ISCSIConsole
 
 
                     bdd.ReadBlock(buffer, 0, buffer.Length, i, 0);
                     bdd.ReadBlock(buffer, 0, buffer.Length, i, 0);
 
 
-                    loadableRamDisk.WriteData(i * bdd.BlockSize, buffer);
+                    loadableRamDisk.WriteData((long)i * bdd.BlockSize, buffer);
                 }
                 }
 
 
                 bdd.ReleaseLock();
                 bdd.ReleaseLock();