Changeset 219 in xtideuniversalbios for trunk/Serial_Server/library/Library.h


Ignore:
Timestamp:
Jan 25, 2012, 7:04:43 AM (12 years ago)
Author:
gregli@…
google:author:
gregli@hotmail.com
Message:

Serial Server, more minor improvements, added support for larger than 2 GB disks under Win32

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Serial_Server/library/Library.h

    r217 r219  
    99#define LIBRARY_H_INCLUDED
    1010
    11 #include "stdio.h"
     11void log( int level, char *message, ... );
    1212
    13 void log( int level, char *message, ... );
    1413unsigned long GetTime(void);
    1514unsigned long GetTime_Timeout(void);
     
    2019{
    2120public:
    22     virtual int seekSector( unsigned long cyl, unsigned long sect, unsigned long head ) = 0;
    23     virtual int seekSector( unsigned long lba ) = 0;
     21    virtual void seekSector( unsigned long lba ) = 0;
    2422
    25     virtual int writeSector( void *buff ) = 0;
     23    virtual void writeSector( void *buff ) = 0;
    2624   
    27     virtual int readSector( void *buff ) = 0;
     25    virtual void readSector( void *buff ) = 0;
    2826
    2927    Image( char *name, int p_readOnly, int p_drive );
     
    5755struct baudRate *baudRateMatchDivisor( unsigned char divisor );
    5856
    59 class Serial
    60 {
    61 public:
    62     virtual unsigned long readCharacters( void *buff, unsigned long len ) = 0;
     57#ifdef WIN32
     58#include "../win32/win32serial.h"
     59#else
     60// there is no standard way to read/write and configure the serial port, OS specifc only
     61#endif
    6362
    64     virtual unsigned long writeCharacters( void *buff, unsigned long len ) = 0;
     63#ifdef WIN32
     64#include "../win32/win32file.h"
     65#else
     66#include "file.h"
     67#endif
    6568
    66     Serial( char *name, struct baudRate *p_baudRate )
    67     {
    68         speedEmulation = 0;
    69         resetConnection = 0;
    70         baudRate = p_baudRate;
    71     };
    72 
    73     virtual ~Serial() {};
    74 
    75     int speedEmulation;
    76     int resetConnection;
    77 
    78     struct baudRate *baudRate;
    79 };
    80 
    81 void processRequests( Serial *serial, Image *image0, Image *image1, int timeoutEnabled, int verboseLevel );
    82 
    83 #define ATA_COMMAND_LBA 0x40
    84 #define ATA_COMMAND_HEADMASK 0xf
    85 
    86 #define ATA_DriveAndHead_Drive 0x10
     69void processRequests( SerialAccess *serial, Image *image0, Image *image1, int timeoutEnabled, int verboseLevel );
    8770
    8871#endif
Note: See TracChangeset for help on using the changeset viewer.