Subversion Repositories freemyipod

Rev

Rev 630 | Rev 651 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 630 Rev 633
Line 132... Line 132...
132
        fatsectors = (clustercount + 1025) >> 10;
132
        fatsectors = (clustercount + 1025) >> 10;
133
    }
133
    }
134
    uint32_t database = fatsectors + reserved;
134
    uint32_t database = fatsectors + reserved;
135
    uint32_t clusoffset = 0;
135
    uint32_t clusoffset = 0;
136
    uint32_t* buf = memalign(0x10, 0x20000);
136
    uint32_t* buf = memalign(0x10, 0x20000);
137
    memset(buf, 0, 0x800);
137
    memset(buf, 0, 0x1000);
138
    memcpy(buf, "\xeb\x58\x00MSWIN5.0\0\x10", 0xd);
138
    memcpy(buf, "\xeb\x58\x00MSWIN5.0\0\x10", 0xd);
139
    ((uint8_t*)buf)[0xd] = secperclus;
139
    ((uint8_t*)buf)[0xd] = secperclus;
140
    ((uint16_t*)buf)[7] = reserved;
140
    ((uint16_t*)buf)[7] = reserved;
141
    memcpy(&((uint8_t*)buf)[0x10], "\x01\0\0\0\0\xf8\0\0\x3f\0\xff", 0xb);
141
    memcpy(&((uint8_t*)buf)[0x10], "\x01\0\0\0\0\xf8\0\0\x3f\0\xff", 0xb);
142
    buf[8] = totalsectors;
142
    buf[8] = totalsectors;
Line 148... Line 148...
148
    memcpy(&((uint8_t*)buf)[0x43], "\0\0\0\0iPodClassic", 0xf);
148
    memcpy(&((uint8_t*)buf)[0x43], "\0\0\0\0iPodClassic", 0xf);
149
    memcpy(&((uint8_t*)buf)[0x52], "FAT32   ", 8);
149
    memcpy(&((uint8_t*)buf)[0x52], "FAT32   ", 8);
150
    ((uint16_t*)buf)[0xff] = 0xaa55;
150
    ((uint16_t*)buf)[0xff] = 0xaa55;
151
    if (rc = storage_write_sectors_md(0, 0, 1, buf))
151
    if (rc = storage_write_sectors_md(0, 0, 1, buf))
152
        panicf(PANIC_KILLTHREAD, "Error writing MBR: %08X", rc);
152
        panicf(PANIC_KILLTHREAD, "Error writing MBR: %08X", rc);
153
    memset(buf, 0, 0x800);
153
    memset(buf, 0, 0x1000);
154
    buf[0] = 0x41615252;
154
    buf[0] = 0x41615252;
155
    buf[0x79] = 0x61417272;
155
    buf[0x79] = 0x61417272;
156
    buf[0x7a] = clustercount - 1;
156
    buf[0x7a] = clustercount - 1;
157
    buf[0x7b] = 2;
157
    buf[0x7b] = 2;
158
    buf[0x7f] = 0xaa550000;
158
    buf[0x7f] = 0xaa550000;