Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
Fx_upg.c
Package: tb_i86_wr_1019_1102. [view]
Upload User: super_houu
Upload Date: 2008-09-21
Package Size: 4099k
Code Size: 13k
Category:
DVD
Development Platform:
Others
- /**************************************************************************/
- /* */
- /* Copyright (c) 1996-2002 by Express Logic Inc. */
- /* */
- /* This software is copyrighted by and is the sole property of Express */
- /* Logic, Inc. All rights, title, ownership, or other interests */
- /* in the software remain the property of Express Logic, Inc. This */
- /* software may only be used in accordance with the corresponding */
- /* license agreement. Any unauthorized use, duplication, transmission, */
- /* distribution, or disclosure of this software is expressly forbidden. */
- /* */
- /* This Copyright notice may not be removed or modified without prior */
- /* written consent of Express Logic, Inc. */
- /* */
- /* Express Logic, Inc. reserves the right to modify this software */
- /* without notice. */
- /* */
- /* Express Logic, Inc. info@expresslogic.com */
- /* 11423 West Bernardo Court http://www.expresslogic.com */
- /* San Diego, CA 92127 */
- /* */
- /**************************************************************************/
- /**************************************************************************/
- /**************************************************************************/
- /** */
- /** FileX Component */
- /** */
- /** Utility (UTI) */
- /** */
- /**************************************************************************/
- /**************************************************************************/
- #include "Config.h" // Global Configuration - do not remove!
- #ifdef ENABLE_FILEX
- #ifdef _DEBUG
- #undef IFTRACE
- #define IFTRACE if (gTraceFileSys)
- #include "DebugDbgMain.h"
- #endif //_DEBUG
- #define FX_SOURCE_CODE
- /* Include necessary system files. */
- #include "PlaycoreFileSysFileXfx_api.h"
- #ifndef FX_MEDIA_PART_DEFINED
- typedef struct FX_MEDIA_PART_STRUCT
- {
- ULONG fx_media_part_start;
- ULONG fx_media_part_size;
- } FX_MEDIA_PART;
- #endif
- /**************************************************************************/
- /* */
- /* FUNCTION RELEASE */
- /* */
- /* _fx_utility_partition_get PORTABLE C */
- /* 3.0 */
- /* AUTHOR */
- /* */
- /* Mohammad N. Minhaz, Express Logic, Inc. */
- /* */
- /* DESCRIPTION */
- /* */
- /* This function parses the partition sector and completes the */
- /* supplied partition entry structure. */
- /* */
- /* INPUT */
- /* */
- /* part_tab Pointer to partition table */
- /* count Number of partitions found */
- /* sect Base sector */
- /* sect_buf Buffer containing partition */
- /* table */
- /* */
- /* OUTPUT */
- /* */
- /* return status */
- /* */
- /* CALLS */
- /* */
- /* None */
- /* */
- /* CALLED BY */
- /* */
- /* Application Driver */
- /* */
- /* RELEASE HISTORY */
- /* */
- /* DATE NAME DESCRIPTION */
- /* */
- /* 07-04-2002 Mohammad N. Minhaz Initial Version 1.0 */
- /* */
- /**************************************************************************/
- UINT _fx_utility_partition_get(FX_MEDIA_PART *part_tab,
- UINT *count, ULONG sect, UCHAR *sect_buf)
- {
- UINT i;
- ULONG base_sect, val;
- base_sect = 0;
- /* find out if it is a sub partition */
- for(i = 0; i < *count ; i++)
- if (sect == part_tab[i].fx_media_part_start){
- base_sect = part_tab[i].fx_media_part_start;
- break; /* sub part */
- }
- for(i = 446; i <= 494; i+=16)
- {
- if (sect_buf[i + 4] == 0) /* no partition entry here */
- continue;
- val = (ULONG) sect_buf[i + 8] ; /* little endian start value */
- val = (((ULONG) sect_buf[i + 9]) << 8) | val;
- val = (((ULONG) sect_buf[i + 10]) << 16) | val;
- val = (((ULONG) sect_buf[i + 11]) << 24) | val;
- part_tab[*count].fx_media_part_start = val + base_sect;
- val =(ULONG) sect_buf[i + 12] ; /* little endian size value */
- val = (((ULONG) sect_buf[i + 13]) << 8) | val;
- val = (((ULONG) sect_buf[i + 14]) << 16) | val;
- val = (((ULONG) sect_buf[i + 15]) << 24) | val;
- part_tab[*count].fx_media_part_size = val;
- (*count)++;
- }
- return FX_SUCCESS;
- }
- /**************************************************************************/
- /* */
- /* FUNCTION RELEASE */
- /* */
- /* _fx_partition_offset_calculate PORTABLE C */
- /* 3.0 */
- /* AUTHOR */
- /* */
- /* Mohammad N. Minhaz, Express Logic, Inc. */
- /* */
- /* DESCRIPTION */
- /* */
- /* This function calculates the sector offset to the specified */
- /* partition. The buffer containing the partition table is also */
- /* supplied to this function. If the buffer supplied is a boot */
- /* record (which could be the case in non-partition systems), this */
- /* function returns an offset of zero and a successful status */
- /* indicating that the buffer supplied is the boot record. Otherwise, */
- /* if the partition is found, this function returns the sector offset */
- /* to its boot record along with a successful status. If the */
- /* specified partition is not found or the buffer is not a partition */
- /* table or boot record, this function returns an error. */
- /* */
- /* INPUT */
- /* */
- /* part_sector Pointer to buffer containing */
- /* either the partition table */
- /* or the boot sector */
- /* partition Desired partition */
- /* partition_sector_offset Pointer to destination for */
- /* returning the sector offset */
- /* table */
- /* */
- /* OUTPUT */
- /* */
- /* return status */
- /* */
- /* CALLS */
- /* */
- /* _fx_utility_partition_get Actual partition parsing */
- /* routine */
- /* */
- /* CALLED BY */
- /* */
- /* Application Driver */
- /* */
- /* RELEASE HISTORY */
- /* */
- /* DATE NAME DESCRIPTION */
- /* */
- /* 07-04-2002 Mohammad N. Minhaz Initial Version 1.0 */
- /* */
- /**************************************************************************/
- UINT _fx_partition_offset_calculate( VOID *part_sector,
- UINT partition,
- ULONG *partition_start,
- ULONG *partition_size )
- {
- FX_MEDIA_PART part_tab[4];
- UINT count;
- UCHAR *part_sect;
- part_sect = part_sector;
- count = 0;
- if ((part_sect[510] != 0x55) || (part_sect[511] != 0xAA))
- return FX_NOT_FOUND ; /* not a valid sector to work on */
- if ((part_sect[0] == 0xe9) || ((part_sect[0] == 0xeb) && (part_sect[2] == 0x90)))
- { /* a bootable sector */
- *partition_start = 0;
- return FX_SUCCESS;
- }
- /* not bootable, look for partition */
- _fx_utility_partition_get(part_tab, &count, 0, part_sect);
- if (partition >= count)
- return FX_NOT_FOUND;
- if ( partition_start != NULL )
- {
- *partition_start = part_tab[partition].fx_media_part_start;
- }
- if ( partition_size != NULL )
- {
- *partition_size = part_tab[partition].fx_media_part_size;
- }
- return(FX_SUCCESS);
- }
- #endif