Ignore:
Timestamp:
Feb 2, 2016, 9:54:35 PM (8 years ago)
Author:
coas-nagasima
Message:

SDカードの中身を/~/でアクセスできるよう変更

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uKadecot/trunk/pfatfs/diskio.c

    r108 r154  
    2121#define RamDisk         ((unsigned char *)0xfff00000)
    2222#else
    23 #include <windows.h>
    24 #include <tchar.h>
    25 #include <winioctl.h>
    26 
    2723unsigned char RamDisk[SZ_RAMDISK * 1024];
     24extern void win_disk_initialize(void *ramDisk, int size);
    2825#endif
    2926
     
    3431        DWORD wip;
    3532        DWORD n_sectors;
    36 } STAT;
     33} RD_STAT;
    3734
    3835static volatile
    39 STAT Stat[MAX_DRIVES];
     36RD_STAT Stat[MAX_DRIVES];
    4037
    4138static
     
    4340
    4441static
    45 int get_status(volatile STAT *stat) {
     42int get_status(volatile RD_STAT *stat) {
    4643        stat->sz_sector = SS_RAMDISK;
    4744        if(stat->sz_sector < _MIN_SS || stat->sz_sector > _MAX_SS) return 0;
     
    5451/* Initialize Disk Drive                                                 */
    5552/*-----------------------------------------------------------------------*/
    56 DSTATUS disk_initialize (void)
     53DSTATUS ramdisk_initialize (void)
    5754{
    5855        DSTATUS sta;
    5956#ifdef _MSC_VER
    60         HANDLE h;
    61         DWORD br;
    62 
    63         h = CreateFile(_T("..\\..\\..\\..\\uip\\apps\\webserver\\httpd-fs.bin"), GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0);
    64         if (h != INVALID_HANDLE_VALUE) {
    65                 ReadFile(h, RamDisk, sizeof(RamDisk), &br, 0);
    66                 CloseHandle(h);
    67         }
     57        win_disk_initialize(RamDisk, sizeof(RamDisk));
    6858#endif
    6959        get_status(&Stat[0]);
     
    7767/* Get Disk Status                                                       */
    7868/*-----------------------------------------------------------------------*/
    79 DSTATUS disk_get_status (void)
     69DSTATUS ramdisk_get_status (void)
    8070{
    8171        return Stat[0].status;
     
    8575/* Read Partial Sector                                                   */
    8676/*-----------------------------------------------------------------------*/
    87 DRESULT disk_readp (
     77DRESULT ramdisk_readp (
    8878        BYTE* buff,             /* Data read buffer */
    8979        DWORD sector,   /* Sector number (LBA) */
     
    118108/* Write Partial Sector                                                  */
    119109/*-----------------------------------------------------------------------*/
    120 DRESULT disk_writep (
     110DRESULT ramdisk_writep (
    121111        const BYTE* buff,       /* Pointer to the write data */
    122112        DWORD sc                        /* Sector number (LBA), Number of bytes to send */
Note: See TracChangeset for help on using the changeset viewer.