You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* \author Christian SCHROETTER, (http://www.quatilfait.fr)
7
+
* \example examples/BootCatalog_test.php
8
+
* \copyright Creative Commons (BY NC SA)
9
+
* The holder allows the use of the original in non-commercial work and the creation of derived works provided they are distributed in a manner identical to the one that governs the original work license.
10
+
*/
11
+
class CBootCatalog
12
+
{
13
+
/**
14
+
* \public
15
+
* \param int $header (MUST be 0x01)
16
+
*/
17
+
var $header;
18
+
/**
19
+
* \public
20
+
* \param int $platformID
21
+
* \see PlatformIDToName
22
+
* \brief The platform identifier
23
+
*
24
+
* 0 = 80x86
25
+
* 1 = Power PC
26
+
* 2 = Mac
27
+
*
28
+
*/
29
+
var $platformID;
30
+
/**
31
+
* \public
32
+
* \param int $reserved (MUST be 0)
33
+
*/
34
+
var $reserved;
35
+
/**
36
+
* \public
37
+
* \param string $manufacturerID
38
+
* \brief The manufacturer/developer of the CD-ROM.
39
+
*
40
+
* This is intended to identify the manufacturer/developer of the CD-ROM.
41
+
*
42
+
*/
43
+
var $manufacturerID;
44
+
/**
45
+
* \public
46
+
* \param int $checksum
47
+
* \brief Check the entry validation integrity
48
+
*
49
+
* This sum of all the words in this record should be 0.
50
+
*
51
+
*/
52
+
var $checksum;
53
+
/**
54
+
* \public
55
+
* \param int $key1 (MUST be 0x55)
56
+
*/
57
+
var $key1;
58
+
/**
59
+
* \public
60
+
* \param int $key2 (MUST be 0xAA)
61
+
*/
62
+
var $key2;
63
+
64
+
/**
65
+
* \fn static public function PlatformIDToName($platformID)
66
+
* \param int $platformID The platform identifier number.
67
+
* \see $platformID
68
+
* \brief Convert platformID to string
69
+
* Convert the platform identifier (int) to a human readable string.
70
+
* \return string The readable platform identifier
71
+
*/
72
+
staticpublicfunctionPlatformIDToName($platformID)
73
+
{
74
+
switch($platformID)
75
+
{
76
+
case0: return'80x86';
77
+
case1: return'Power PC';
78
+
case2: return'Mac';
79
+
}
80
+
81
+
return'ID inconnu: ' . $platformID;
82
+
}
83
+
/**
84
+
* \fn public function IsValid()
85
+
* \brief Check is this validation entry is 'valid'
86
+
* Check all the member's of the "validation entry"
87
+
* The \a $header, \a $key1 and \a $key2 param and also the \a $cheksum value
88
+
* \see $header
89
+
* \see $checksum
90
+
* \see $key1
91
+
* \see $key2
92
+
* \todo Implemente the checksum validation algo...
* \author Christian SCHROETTER, (http://www.quatilfait.fr)
7
+
* \example examples/BootCatalogEntry_test.php
8
+
* \copyright Creative Commons (BY NC SA)
9
+
* The holder allows the use of the original in non-commercial work and the creation of derived works provided they are distributed in a manner identical to the one that governs the original work license.
10
+
*/
11
+
class CBootCatalogEntry
12
+
{
13
+
/**
14
+
* \public
15
+
* \param int $indicator (MUST be 0x88)
16
+
*/
17
+
var $indicator;
18
+
/**
19
+
* \public
20
+
* \param int $mediaType
21
+
* \brief the type of media emulated
22
+
* 0 No Emulation
23
+
* 1 1.2 meg diskette
24
+
* 2 1.44 meg diskette
25
+
* 3 2.88 meg diskette
26
+
* 4 Hard Disk (drive 80)
27
+
*/
28
+
var $mediaType;
29
+
/**
30
+
* \public
31
+
* \param int $loadSegment
32
+
* \brief loaded segment.
33
+
* This is the load segment for the initial boot image
34
+
*/
35
+
var $loadSegment;
36
+
/**
37
+
* \public
38
+
* \param int $systemType
39
+
* \brief The type of system
40
+
* This must be a copy of byte 5 (System Type) from the "Partition Table" found in the boot image
41
+
*/
42
+
var $systemType;
43
+
/**
44
+
* \public
45
+
* \param int $unused
46
+
*/
47
+
var $unused;
48
+
/**
49
+
* \public
50
+
* \param int $sectorCount
51
+
* This is the number of segment loaded by the BIOS
52
+
* But this value is confusing because the microcode store in the entry can load mores block
53
+
* \warning ONE sector of the boot image is equal to 512 bytes (not the standart 2048 bytes of a Optical media LBA)
54
+
*/
55
+
var $sectorCount;
56
+
/**
57
+
* \public
58
+
* \param int $loadRDA
59
+
* \brief The location of the boot image
60
+
* This is the start address of the virtual disk.
61
+
* \warning Optical media use Relative/Logical block addressing
62
+
*/
63
+
var $loadRDA;
64
+
65
+
/**
66
+
* \fn public function IsValid()
67
+
* \brief Check is this Initial/Default Entry is 'valid'
68
+
* Check all the member's of the "Initial/Default Entry"
69
+
* The \a $indicator value (also correct the \a $loadSegment value)
70
+
* \return boolean TRUE OR FALSE
71
+
* \see $indicator
72
+
* \see $loadSegment
73
+
*/
74
+
publicfunctionIsValid()
75
+
{
76
+
if($this->indicator != 0x88)
77
+
returnfalse;
78
+
79
+
// set default load segment is not set...
80
+
if($this->loadSegment == 0)
81
+
$this->loadSegment = 0x7c0;
82
+
83
+
returntrue;
84
+
}
85
+
/**
86
+
* \fn static public function BootMediaTypeToName($mediaType)
87
+
* \param int $mediaType The media identifier number.
88
+
* \see $mediaType
89
+
* \brief Convert mediaType to string
90
+
* Convert the media identifier (int) to a human readable string.
0 commit comments