Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

RbuLowLevel.h

Go to the documentation of this file.
00001 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
00002  * vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c:cindent:textwidth=0:
00003  *
00004  * Copyright (C) 2005 Dell Inc.
00005  *  by Michael Brown <Michael_E_Brown@dell.com>
00006  * Licensed under the Open Software License version 2.1
00007  *
00008  * Alternatively, you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published
00010  * by the Free Software Foundation; either version 2 of the License,
00011  * or (at your option) any later version.
00012  
00013  * This program is distributed in the hope that it will be useful, but
00014  * WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016  * See the GNU General Public License for more details.
00017  */
00018 
00019 #ifndef RBULOWLEVEL_H
00020 #define RBULOWLEVEL_H
00021 
00022 // compat header should always be first header if including system headers
00023 #include "smbios/compat.h"
00024 
00025 #   define RBU_SMBIOS_STRUCT (0xDE)
00026 #   define RBU_ACTIVATE (0x005c)
00027 #   define RBU_CANCEL   (0x005d)
00028 
00029 namespace rbu 
00030 {
00031 #   if defined(_MSC_VER)
00032 #       pragma pack(push,1)
00033 #   endif
00034 
00035     /* RBU packets are 4 KB-aligned and consist of a header and data. The packet header contains the necessary information for BIOS to find the packets in memory, and assemble them in proper order. */
00036 
00037     struct  rbu_packet
00038     {
00039         u32 pktId;      // must be '$RPK'
00040         u16 pktSize;    // size of packet in KB
00041         u16 reserved1;  // 
00042         u16 hdrSize;    // size of packet header in paragraphs (16 byte chunks)
00043         u16  reserved2; //
00044         u32 pktSetId;   // unique id for packet set, can be anything
00045         u16 pktNum;     // sequential pkt number (only thing that changes)
00046         u16 totPkts;    // total number of packets
00047         u8  pktVer;     // version == 1 for now
00048         u8  reserved[9];
00049         u16 pktChksum;  // sum all bytes in pkt must be zero
00050         u8  pktData;  // Start of packet data.
00051     }
00052     LIBSMBIOS_PACKED_ATTR;
00053 
00054 
00055     /* RBU Packet Requirements
00056     
00057     1.All values in the packet header except PktNum must be the same for all packets in a set with the following exception:
00058             -- Packet 0 may have a different packet size (PktSize).
00059             -- checksums
00060     2.Packet 0 data does not contain RBU data. Packet 1 contains the first chunk of RBU data.
00061     3.Packet data begins immediately after the header. Packet data size and offset can be calculated from PktSize and HdrSize. 
00062     4.Reserved fields are 0.
00063     5.If multiple packets sets are written to memory, all packet sets must be identical.
00064     6.All packets must start on 4 KB boundaries.
00065     7.All packets must be placed in non-paged memory.
00066     8.The maximum size of a packet is 64 MB.
00067     9.The maximum size of a packet header is 4 KB.
00068     10.The maximum number of packets is 64 KB - 1.
00069     11.CPU INIT# must be immediately asserted (e.g. via OS shutdown/restart) after the RBU packet set is placed in memory.
00070     12.PktChk is the value resulting in a zero sum of all packet words (header and data).
00071     13.PktSetId uniquely identifies a packet set. BIOS aborts the packet search if all packets do not have the same PkSetId. Example identifiers: a 4-character ASCII ID string (e.g. “_A00”), a 4-byte hash value (e.g. CRC).
00072         */
00073     
00074     /*  RBU Packet 0 */
00075     
00076     struct  rbu_packet_0
00077     {
00078         rbu_packet  header;
00079         u8  passwordCheckInfo;  // bit 7: passwordCheck is present   bits 0-6: reserved
00080         u32 passwordCheck;      // crc-32 of admin/setup password
00081         // the rest is reserved for future expansion.
00082     }
00083     LIBSMBIOS_PACKED_ATTR;
00084 
00085     /* RBU Packet 0 Definition
00086 
00087     Packet 0 is reserved for packet set information. Packet 0 data consists of data items -- each item consists of an info byte followed by the actual data item. If bit 0 of the info byte is 1, the actual data starting at the next byte is present. If bit 0 is 0, the data is not present.
00088     
00089     The system flash password is currently defined as the admin or setup password.
00090     
00091     BIOS reject the packet set when:
00092     1.The packet set flash password CRC and the system flash password CRC do not match.
00093     2.The packet set flash password CRC is not present but the system flash password is present.
00094     
00095     */
00096 
00097 
00098     /* 
00099        RBU BIOS UPDATE HEADER FILE (.HDR) structure
00100        */
00101 
00102     const int NUM_SYS_ID_IN_HDR = 12;
00103 
00104     struct rbu_hdr_file_header
00105     {
00106         char headerId[4];
00107         u8  headerLength;
00108         u8  headerMajorVer;
00109         u8  headerMinorVer;
00110         u8  numSystems;
00111         char quickCheck[40];
00112         char biosVersion[3];
00113         u8  miscFlags;
00114         u8  biosInternalUse;
00115         u8  reserved[5];
00116         u16 compatFlags;
00117         u16 systemIdList[NUM_SYS_ID_IN_HDR]; /* 
00118             Contains the list of NumSystems Dell System ID and Hardware Revision 
00119             ID pairs for which the Image Data is valid, in the following format:
00120             Bit Range  Description
00121             15:11      Dell System ID, bits 12:8.  
00122                         This range is set to 00000b if the Dell System ID 
00123                         is a 1-byte value.
00124             10:8       Hardware Revision ID
00125             7:0        Dell System ID, bits 7:0. */
00126     }
00127     LIBSMBIOS_PACKED_ATTR;
00128 
00129 #   if defined(_MSC_VER)
00130 #       pragma pack(pop)
00131 #   endif
00132 
00133 }
00134 
00135 #endif /* RBUIMPL_H */

Generated on Wed Apr 11 16:25:10 2007 for SMBIOS Library by doxygen 1.3.5