XboxHacker BBS
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 21, 2013, 10:45:40 AM


Login with username, password and session length


Pages: « 1 2 3 4 5 6 7 8 »
  Print  
Author Topic: Using lflash to flash XBReboot??  (Read 33365 times)
Bydox
Member
**
Posts: 30


View Profile
« Reply #40 on: December 11, 2009, 05:18:17 PM »

I think I read somewhere that the bad block flag is stored elsewhere on the larger NAND's.  Try changing:

if (sector_flash[0x205] != 0xFF) /* bad sector */

to:

if (sector_flash[0x200] != 0xFF) /* bad sector */

That should also work and might fix some of the bad sector errors you're seeing.  Rest looks fine to me.
Logged
tuxuser
Hacker
***
Posts: 50


View Profile WWW
« Reply #41 on: December 11, 2009, 05:49:47 PM »

Tried to edit it a lil bit so it supports all JASPER Nands, standard xenon/zephyr/opus/falcon nands not implemented.

Code:
/* placed in public domain, written by Felix Domke <tmbinc@elitedvb.net> */
/* USE ON YOUR OWN RISK. */
#include <stdio.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>
#include <byteswap.h>
#include <string.h>

int nandsize;

extern void *mmap64 (void *__addr, size_t __len, int __prot, int __flags, int __fd, __off64_t __offset) __THROW;

volatile void * ioremap(unsigned long long physaddr, unsigned size, int sync)
{
int axs_mem_fd = -1;
unsigned long long page_addr, ofs_addr, reg, pgmask;
void* reg_mem = NULL;

/*
* looks like mmap wants aligned addresses?
*/
pgmask = getpagesize()-1;
page_addr = physaddr & ~pgmask;
ofs_addr  = physaddr & pgmask;

/*
* Don't forget O_SYNC, esp. if address is in RAM region.
* Note: if you do know you'll access in Read Only mode,
* pass O_RDONLY to open, and PROT_READ only to mmap
*/
if (axs_mem_fd == -1) {
axs_mem_fd = open("/dev/mem", O_RDWR|(sync ? O_SYNC : 0));
if (axs_mem_fd < 0) {
perror("AXS: can't open /dev/mem");
return NULL;
}
}

/* memory map */
reg_mem = mmap64(
(caddr_t)reg_mem,
size+ofs_addr,
PROT_READ|PROT_WRITE,
MAP_SHARED,
axs_mem_fd,
page_addr
);
if (reg_mem == MAP_FAILED) {
perror("AXS: mmap error");
close(axs_mem_fd);
return NULL;
}

reg = (unsigned long )reg_mem + ofs_addr;
return (volatile void *)reg;
}

int iounmap(volatile void *start, size_t length)
{
unsigned long ofs_addr;
ofs_addr = (unsigned long)start & (getpagesize()-1);

/* do some cleanup when you're done with it */
return munmap((unsigned char*)start-ofs_addr, length+ofs_addr);
}

#define STATUS  1
#define COMMAND 2
#define ADDRESS 3
#define DATA    4
#define LOGICAL 5
#define PHYSICAL 6

volatile unsigned int *flash;

void sfcx_writereg(int reg, int value)
{
flash[reg] = bswap_32(value);
}

unsigned int sfcx_readreg(int reg)
{
return bswap_32(flash[reg]);
}

void readsector(unsigned char *data, int sector, int raw)
{
int status;
sfcx_writereg(STATUS, sfcx_readreg(STATUS));
sfcx_writereg(ADDRESS, sector);
sfcx_writereg(COMMAND, raw ? 3 : 2);

while ((status = sfcx_readreg(STATUS))&1);
 
if (status != 0x200)
{
if (status & 0x40)
printf(" * Bad block found at %08x\n", sector);
else if (status & 0x1c)
printf(" * (corrected) ECC error %08x: %08x\n", sector, status);
else if (!raw)
printf(" * illegal logical block %08x\n", sector);
else
printf(" * Unknown error at %08x: %08x. Please worry.\n", sector, status);
}

sfcx_writereg(ADDRESS, 0);

int i;
for (i = 0; i < 0x210; i+=4)
{
sfcx_writereg(COMMAND, 0);
*(int*)(data + i) = bswap_32(sfcx_readreg(DATA));
}
}

void flash_erase(int address)
{
sfcx_writereg(0, sfcx_readreg(0) | 8);
sfcx_writereg(STATUS, 0xFF);
sfcx_writereg(ADDRESS, address);
while (sfcx_readreg(STATUS) & 1);
sfcx_writereg(COMMAND, 0xAA);
sfcx_writereg(COMMAND, 0x55);
while (sfcx_readreg(STATUS) & 1);
sfcx_writereg(COMMAND, 0x5);
while (sfcx_readreg(STATUS) & 1);
int status = sfcx_readreg(STATUS);
if (status != 0x200)
printf("[%08x]", status);
sfcx_writereg(STATUS, 0xFF);
sfcx_writereg(0, sfcx_readreg(0) & ~8);
}

void write_page(int address, unsigned char *data)
{
sfcx_writereg(STATUS, 0xFF);
sfcx_writereg(0, sfcx_readreg(0) | 8);

sfcx_writereg(ADDRESS, 0);

int i;

for (i = 0; i < 0x210; i+=4)
{
sfcx_writereg(DATA, bswap_32(*(int*)(data + i)));
sfcx_writereg(COMMAND, 1);
}

sfcx_writereg(ADDRESS, address);
sfcx_writereg(COMMAND, 0x55);
while (sfcx_readreg(STATUS) & 1);
sfcx_writereg(COMMAND, 0xAA);
while (sfcx_readreg(STATUS) & 1);
sfcx_writereg(COMMAND, 0x4);
while (sfcx_readreg(STATUS) & 1);
int status = sfcx_readreg(STATUS);
if (status != 0x200)
printf("[%08x]", status);
sfcx_writereg(0, sfcx_readreg(0) & ~8);
}



extern volatile void * ioremap(unsigned long long physaddr, unsigned size, int sync);
extern int iounmap(volatile void *start, size_t length);

int dump_flash_to_file(const char *filename)
{
printf(" * Dumping to %s...\n", filename);

FILE *f = fopen(filename, "wb");

int i;
for (i = 0; i < nandsize; i += 0x200)
{
unsigned char sector[0x210];
readsector(sector, i, 1);
if (!(i&0x3fff))
{
printf("%08x\r", i);
fflush(stdout);
}
if (fwrite(sector, 1, 0x210, f) != 0x210)
return -1;
}
printf("done!   \n");
fclose(f);
return 0;
}

int verify_flash_with_file(const char *filename, int raw)
{
FILE *f = fopen(filename, "rb");
if (!f)
return -1;

if (raw == -1) /* auto */
{
fseek(f, 0, SEEK_END);

if (ftell(f) == nandsize / 0x200 * 0x210)
{
raw = 1;
printf(" * detected RAW nand file, verifying in raw mode.\n");
} else
{
raw = 0;
printf(" * detected short nand file, verifying in cooked mode.\n");
}
fseek(f, 0, SEEK_SET);
}

printf(" * Verifying flash with %s...\n", filename);

int i;
for (i = 0; i < nandsize; i += 0x200)
{
unsigned char sector[0x210], sector_flash[0x210];
if (!(i&0x3fff))
{
printf("%08x\r", i);
fflush(stdout);
}
if (fread(sector, 1, 0x210, f) != 0x210)
return i;
readsector(sector_flash, i, raw);
if (sector_flash[0x200] != 0xFF) /* bad sector */
{
printf(" * ignoring bad sector at %08x\n", i);
continue;
}
if (memcmp(sector, sector_flash, 0x210))
{
printf(" * VERIFY error at %08x\n", i);
return -2;
}
}
printf("done!   \n");
fclose(f);
return i;
}

int flash_from_file(const char *filename, int raw)
{
printf(" * Flashing from %s...\n", filename);

FILE *f = fopen(filename, "rb");
if (!f)
return -1;

if (raw == -1) /* auto */
{
fseek(f, 0, SEEK_END);

if (ftell(f) == nandsize / 0x200 * 0x210)
{
raw = 1;
printf(" * detected RAW nand file, flashing in raw mode.\n");
} else
{
raw = 0;
printf(" * detected short nand file, flashing in cooked mode.\n");
}
fseek(f, 0, SEEK_SET);
}

int i;
for (i = 0; i < nandsize; i += 0x4000)
{
unsigned char sector[0x210*32], sector_flash[0x210*32];
memset(sector, 0xFF, sizeof(sector));
if (!fread(sector, 1, 0x210*32, f))
return i;

printf("%08x\r", i);
fflush(stdout);

readsector(sector_flash, i, 0);

int phys_pos;

if (!raw)
{
phys_pos = sfcx_readreg(PHYSICAL);

if (!(phys_pos & 0x04000000)) /* shouldn't happen, unless the existing image is broken. just assume the sector is okay. */
{
printf(" * Uh, oh, don't know. Reading at %08x failed.\n", i);
phys_pos = i;
}
phys_pos &= 0x3fffe00;

if (phys_pos != i)
printf(" * relocating sector %08x to %08x...\n", i, phys_pos);
} else
phys_pos = i;

flash_erase(phys_pos);
int j;
for (j = 0; j < 32; ++j)
write_page(phys_pos + j * 0x200, sector + j * 0x210);
}
return 0;
}

int main(int argc, char **argv)
{
flash = ioremap(0xea00c000, 0x1000, 1);

printf(" * flash config: %08x\n", sfcx_readreg(0));

sfcx_writereg(0, sfcx_readreg(0) &~ (4|8|0x3c0));

int reg = sfcx_readreg(0);

switch(reg)
{
case 0x00AA3020:
nandsize = 512 * 1024 * 1024;
break;
case 0x008A3020:
nandsize = 256 * 1024 * 1024;
break;
case 0x00023010:
nandsize = 16 * 1024 * 1024;
break;
default:
printf(" * unknown flash config %08x\n", reg);
return 1;
}

if (argc != 2 && argc != 3)
{
printf("usage: %s <current> [<new>]\n", *argv);
return 2;
}

const char *orig = argv[1];
int res = verify_flash_with_file(orig, 1);
if (res == -1)
{
dump_flash_to_file(orig);
res = verify_flash_with_file(orig, 1);
}

if (res != nandsize)
{
if (res == -2)
printf(" * verify failed!\n");
else if (res > 0)
printf(" * verified correctly, but only %d bytes.\n", res);
else
printf(" * original image invalid\n");
printf(" * I won't flash if you don't have a full, working backup, sorry.\n");
return 1;
}
printf(" * verify ok.\n");

if (argc > 2)
{
const char *image = argv[2];

flash_from_file(image, -1);
res = verify_flash_with_file(image, -1);
if (res > 0)
printf(" * verified %d bytes ok\n", res);
else
printf(" * verify failed! (%d)\n", res);
}
return 0;
}

edit: made the bad sector change that Bydox mentioned
« Last Edit: December 11, 2009, 05:59:01 PM by tuxuser » Logged
vintage_guitar
Hacker
***
Posts: 55


View Profile
« Reply #42 on: December 11, 2009, 06:02:28 PM »

I think I read somewhere that the bad block flag is stored elsewhere on the larger NAND's.  Try changing:

if (sector_flash[0x205] != 0xFF) /* bad sector */

to:

if (sector_flash[0x200] != 0xFF) /* bad sector */

That should also work and might fix some of the bad sector errors you're seeing.  Rest looks fine to me.
This did it. Did not freeze up this time, or give any errors (other than "ECC error") Well, actually it did freeze, during the verifying stage. it finished dumping.. I'm thinking this is due to a RAM limitation. It seems to have dumped successfully though. I'm currently dumping with tuxuser's code to compare the results.
[edit] OK finished dumping with tuxuser's code. Froze again during verifying, but completed dump with no "bad sector" errors. Just the usual 4 "bad blocks" errors which I believe to be legitimate. Both my code and tuxuser's code gave identical dumps.. but his is dynamic, and should be used as a starting point for more code changed for jasper lflash.
« Last Edit: December 11, 2009, 06:31:52 PM by vintage_guitar » Logged
vintage_guitar
Hacker
***
Posts: 55


View Profile
« Reply #43 on: December 11, 2009, 06:48:56 PM »

Ok i injected my LPT dump's first 2MB i got from nandpro 2.0b into the first 2MB of the 512MB dump i got from lflash. This dumped in around 10 minutes, vs the 16 hours it would have taken through LPT. Injecting the original 2MB is a correct procedure for making an untouched 512MB dump? Just checking to make sure.
Logged
tuxuser
Hacker
***
Posts: 50


View Profile WWW
« Reply #44 on: December 11, 2009, 06:56:56 PM »

Yep should be the way to go
Logged
iLLNESS
Master Hacker
****
Posts: 398


View Profile
« Reply #45 on: December 11, 2009, 10:56:58 PM »

heh. i did it the other way.

i read my nand in ubuntu with tuxusers lflash for large nands.
i took my original nand and injected the xell into that nand.

so my read from lflash should match my original+injected xell flash and i SHOULD be able to write that back to the 360, disconnect power and reboot into xell Smiley

comparing nands now to see

EDIT: files matched. so lflash is correctly dumping the nand.
EDIT: tuxuser, i still get bad sector errors during verify. it says it verifies ok though

does the flashing work fine for this? i let it flash as i can recover no problem with usb.. but i forgot to unplug power before reboot got %100 fans.. so i reflashed xell. i still got %100 fans so im expecting the flash was empty aside from xell.

just looking for confirmation
« Last Edit: December 11, 2009, 11:28:44 PM by iLLNESS » Logged
vintage_guitar
Hacker
***
Posts: 55


View Profile
« Reply #46 on: December 11, 2009, 11:29:07 PM »

It's good that now we have confirmation. Nobody should sit through a 16 hour NAND dump now for 512MB jasper.. This dump method takes about 10 minutes. DO NOT USE THIS TO FLASH!!! ONLY DUMP!!! Mini tutorial:
1.) Wire up jtag+LPT and dump the first 2MB. (DUMP MULTIPLE TIMES AND COMPARE UNTIL YOU GET MATCHING FILES)
2.) Copy this code in the box in its entirety
Code:
/* placed in public domain, written by Felix Domke <tmbinc@elitedvb.net> */
/* USE ON YOUR OWN RISK. */
#include <stdio.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>
#include <byteswap.h>
#include <string.h>

int nandsize;

extern void *mmap64 (void *__addr, size_t __len, int __prot, int __flags, int __fd, __off64_t __offset) __THROW;

volatile void * ioremap(unsigned long long physaddr, unsigned size, int sync)
{
int axs_mem_fd = -1;
unsigned long long page_addr, ofs_addr, reg, pgmask;
void* reg_mem = NULL;

/*
* looks like mmap wants aligned addresses?
*/
pgmask = getpagesize()-1;
page_addr = physaddr & ~pgmask;
ofs_addr  = physaddr & pgmask;

/*
* Don't forget O_SYNC, esp. if address is in RAM region.
* Note: if you do know you'll access in Read Only mode,
* pass O_RDONLY to open, and PROT_READ only to mmap
*/
if (axs_mem_fd == -1) {
axs_mem_fd = open("/dev/mem", O_RDWR|(sync ? O_SYNC : 0));
if (axs_mem_fd < 0) {
perror("AXS: can't open /dev/mem");
return NULL;
}
}

/* memory map */
reg_mem = mmap64(
(caddr_t)reg_mem,
size+ofs_addr,
PROT_READ|PROT_WRITE,
MAP_SHARED,
axs_mem_fd,
page_addr
);
if (reg_mem == MAP_FAILED) {
perror("AXS: mmap error");
close(axs_mem_fd);
return NULL;
}

reg = (unsigned long )reg_mem + ofs_addr;
return (volatile void *)reg;
}

int iounmap(volatile void *start, size_t length)
{
unsigned long ofs_addr;
ofs_addr = (unsigned long)start & (getpagesize()-1);

/* do some cleanup when you're done with it */
return munmap((unsigned char*)start-ofs_addr, length+ofs_addr);
}

#define STATUS  1
#define COMMAND 2
#define ADDRESS 3
#define DATA    4
#define LOGICAL 5
#define PHYSICAL 6

volatile unsigned int *flash;

void sfcx_writereg(int reg, int value)
{
flash[reg] = bswap_32(value);
}

unsigned int sfcx_readreg(int reg)
{
return bswap_32(flash[reg]);
}

void readsector(unsigned char *data, int sector, int raw)
{
int status;
sfcx_writereg(STATUS, sfcx_readreg(STATUS));
sfcx_writereg(ADDRESS, sector);
sfcx_writereg(COMMAND, raw ? 3 : 2);

while ((status = sfcx_readreg(STATUS))&1);
 
if (status != 0x200)
{
if (status & 0x40)
printf(" * Bad block found at %08x\n", sector);
else if (status & 0x1c)
printf(" * (corrected) ECC error %08x: %08x\n", sector, status);
else if (!raw)
printf(" * illegal logical block %08x\n", sector);
else
printf(" * Unknown error at %08x: %08x. Please worry.\n", sector, status);
}

sfcx_writereg(ADDRESS, 0);

int i;
for (i = 0; i < 0x210; i+=4)
{
sfcx_writereg(COMMAND, 0);
*(int*)(data + i) = bswap_32(sfcx_readreg(DATA));
}
}

void flash_erase(int address)
{
sfcx_writereg(0, sfcx_readreg(0) | 8);
sfcx_writereg(STATUS, 0xFF);
sfcx_writereg(ADDRESS, address);
while (sfcx_readreg(STATUS) & 1);
sfcx_writereg(COMMAND, 0xAA);
sfcx_writereg(COMMAND, 0x55);
while (sfcx_readreg(STATUS) & 1);
sfcx_writereg(COMMAND, 0x5);
while (sfcx_readreg(STATUS) & 1);
int status = sfcx_readreg(STATUS);
if (status != 0x200)
printf("[%08x]", status);
sfcx_writereg(STATUS, 0xFF);
sfcx_writereg(0, sfcx_readreg(0) & ~8);
}

void write_page(int address, unsigned char *data)
{
sfcx_writereg(STATUS, 0xFF);
sfcx_writereg(0, sfcx_readreg(0) | 8);

sfcx_writereg(ADDRESS, 0);

int i;

for (i = 0; i < 0x210; i+=4)
{
sfcx_writereg(DATA, bswap_32(*(int*)(data + i)));
sfcx_writereg(COMMAND, 1);
}

sfcx_writereg(ADDRESS, address);
sfcx_writereg(COMMAND, 0x55);
while (sfcx_readreg(STATUS) & 1);
sfcx_writereg(COMMAND, 0xAA);
while (sfcx_readreg(STATUS) & 1);
sfcx_writereg(COMMAND, 0x4);
while (sfcx_readreg(STATUS) & 1);
int status = sfcx_readreg(STATUS);
if (status != 0x200)
printf("[%08x]", status);
sfcx_writereg(0, sfcx_readreg(0) & ~8);
}



extern volatile void * ioremap(unsigned long long physaddr, unsigned size, int sync);
extern int iounmap(volatile void *start, size_t length);

int dump_flash_to_file(const char *filename)
{
printf(" * Dumping to %s...\n", filename);

FILE *f = fopen(filename, "wb");

int i;
for (i = 0; i < nandsize; i += 0x200)
{
unsigned char sector[0x210];
readsector(sector, i, 1);
if (!(i&0x3fff))
{
printf("%08x\r", i);
fflush(stdout);
}
if (fwrite(sector, 1, 0x210, f) != 0x210)
return -1;
}
printf("done!   \n");
fclose(f);
return 0;
}

int verify_flash_with_file(const char *filename, int raw)
{
FILE *f = fopen(filename, "rb");
if (!f)
return -1;

if (raw == -1) /* auto */
{
fseek(f, 0, SEEK_END);

if (ftell(f) == nandsize / 0x200 * 0x210)
{
raw = 1;
printf(" * detected RAW nand file, verifying in raw mode.\n");
} else
{
raw = 0;
printf(" * detected short nand file, verifying in cooked mode.\n");
}
fseek(f, 0, SEEK_SET);
}

printf(" * Verifying flash with %s...\n", filename);

int i;
for (i = 0; i < nandsize; i += 0x200)
{
unsigned char sector[0x210], sector_flash[0x210];
if (!(i&0x3fff))
{
printf("%08x\r", i);
fflush(stdout);
}
if (fread(sector, 1, 0x210, f) != 0x210)
return i;
readsector(sector_flash, i, raw);
if (sector_flash[0x200] != 0xFF) /* bad sector */
{
printf(" * ignoring bad sector at %08x\n", i);
continue;
}
if (memcmp(sector, sector_flash, 0x210))
{
printf(" * VERIFY error at %08x\n", i);
return -2;
}
}
printf("done!   \n");
fclose(f);
return i;
}

int flash_from_file(const char *filename, int raw)
{
printf(" * Flashing from %s...\n", filename);

FILE *f = fopen(filename, "rb");
if (!f)
return -1;

if (raw == -1) /* auto */
{
fseek(f, 0, SEEK_END);

if (ftell(f) == nandsize / 0x200 * 0x210)
{
raw = 1;
printf(" * detected RAW nand file, flashing in raw mode.\n");
} else
{
raw = 0;
printf(" * detected short nand file, flashing in cooked mode.\n");
}
fseek(f, 0, SEEK_SET);
}

int i;
for (i = 0; i < nandsize; i += 0x4000)
{
unsigned char sector[0x210*32], sector_flash[0x210*32];
memset(sector, 0xFF, sizeof(sector));
if (!fread(sector, 1, 0x210*32, f))
return i;

printf("%08x\r", i);
fflush(stdout);

readsector(sector_flash, i, 0);

int phys_pos;

if (!raw)
{
phys_pos = sfcx_readreg(PHYSICAL);

if (!(phys_pos & 0x04000000)) /* shouldn't happen, unless the existing image is broken. just assume the sector is okay. */
{
printf(" * Uh, oh, don't know. Reading at %08x failed.\n", i);
phys_pos = i;
}
phys_pos &= 0x3fffe00;

if (phys_pos != i)
printf(" * relocating sector %08x to %08x...\n", i, phys_pos);
} else
phys_pos = i;

flash_erase(phys_pos);
int j;
for (j = 0; j < 32; ++j)
write_page(phys_pos + j * 0x200, sector + j * 0x210);
}
return 0;
}

int main(int argc, char **argv)
{
flash = ioremap(0xea00c000, 0x1000, 1);

printf(" * flash config: %08x\n", sfcx_readreg(0));

sfcx_writereg(0, sfcx_readreg(0) &~ (4|8|0x3c0));

int reg = sfcx_readreg(0);

switch(reg)
{
case 0x00AA3020:
nandsize = 512 * 1024 * 1024;
break;
case 0x008A3020:
nandsize = 256 * 1024 * 1024;
break;
case 0x00023010:
nandsize = 16 * 1024 * 1024;
break;
default:
printf(" * unknown flash config %08x\n", reg);
return 1;
}

if (argc != 2 && argc != 3)
{
printf("usage: %s <current> [<new>]\n", *argv);
return 2;
}

const char *orig = argv[1];
int res = verify_flash_with_file(orig, 1);
if (res == -1)
{
dump_flash_to_file(orig);
res = verify_flash_with_file(orig, 1);
}

if (res != nandsize)
{
if (res == -2)
printf(" * verify failed!\n");
else if (res > 0)
printf(" * verified correctly, but only %d bytes.\n", res);
else
printf(" * original image invalid\n");
printf(" * I won't flash if you don't have a full, working backup, sorry.\n");
return 1;
}
printf(" * verify ok.\n");

if (argc > 2)
{
const char *image = argv[2];

flash_from_file(image, -1);
res = verify_flash_with_file(image, -1);
if (res > 0)
printf(" * verified %d bytes ok\n", res);
else
printf(" * verify failed! (%d)\n", res);
}
return 0;
}
3.) Open notepad (start->run->notepad) and paste the contents inside.
4.) Save the file as "lflash.c" (The quotes here are required to stop it from saving as a *.txt file)
5.) Put lflash.c on a USB stick that is formatted to fat32. (The USB stick needs to be larger than 512MB obviously as the NAND is larger than this)
6.) Download xell jasper 256 512 file at the "usual places" and rename to "xell.bin"
7.) Flash the file to the NAND nandpro 2.0b. "nandpro lpt: -w512 xell.bin" (Without quotes, Injecting keyvault is optional. This will only write the first 1.5MB or so, which is why you dumped the first 2MB already)
8.) Burn gentoo livecd beta 2 http://www.free60.org/LiveCD
9.) Put the gentoo livecd beta 2 disc in the xbox and boot. (or boot without it in the drive and write down your CPU key)
10.) Plug in the USB
11.) Open up the terminal (Applications->Accessories->Terminal)
12.) Type "sudo passwd" (without quotes)this will prompt you to enter a new password and verify it
13.) Type "su" (without quotes) it will ask for your password, the one you just created
14.) Type "cd Desktop"
15.) Type "mkdir flash"
16.) Type "dmesg | grep -i "SCSI device""(without the outer most quotes the quotes around SCSI Device should be kept. The important part here is the part after Device (sda, could also be sdb, sdc etc))
17.) Type "mount -t vfat -o uid=gentoo,gid=users /dev/sda1 /home/gentoo/Desktop/flash" (without quotes. Change the sda to the value you had)
18.) You should have a folder on the desktop named flash and inside you should see lflash.c
19.) Type "cd flash" to change dir to the USB drive
20.) Type "gcc lflash.c", this will compile lflash and create an a.out file on the USB drive
21.) Type "chmod +x a.out", this will make it executable
22.) Type "./a.out backupnand.bin"
23.) Dump this a few times and compare in a hex editor for file accuracy (maybe one dump at a time between transferring to your PC if your stick doesn't have a lot of space.. each dump is 512MB)
24.) Copy the contents of your original 2MB NAND dump in your favorite hex editor, and inject them into the first 2MB of your 512MB dump you just made (in your favorite hex editor).
25.) You should now have a legitimate backup of your large block jasper without the multiple day long dump from LPT.
Parts of the gentoo tutorial taken from "X-QlusioN".
Updated lflash.c code taken from "tuxuser" and "Bydox"
« Last Edit: December 11, 2009, 11:57:48 PM by vintage_guitar » Logged
iLLNESS
Master Hacker
****
Posts: 398


View Profile
« Reply #47 on: December 11, 2009, 11:40:38 PM »

well its tested for flash. i tested.

doesnt work Smiley but yeah, reading works %100 i can guarantee that.

flashing over usb now will be back for tomorrow. need some sex and sleep
Logged
vintage_guitar
Hacker
***
Posts: 55


View Profile
« Reply #48 on: December 11, 2009, 11:41:11 PM »

well its tested for flash. i tested.

doesnt work Smiley but yeah, reading works %100 i can guarantee that.

flashing over usb now will be back for tomorrow. need some sex and sleep
ok, thanks for the test. I'll put it up at the top of my post.
Logged
iLLNESS
Master Hacker
****
Posts: 398


View Profile
« Reply #49 on: December 12, 2009, 12:03:45 AM »

if anyone else has some spare time maybe they can try what i did as well (actually flash 512mb).. do it before bed or something so u can reflash over usb/lpt and wake up and it be done or half done Smiley.

do this only if you already have a legit dump from lpt/usb already!!!!!!!!!!!

run lflash to read your nand and write with your original 512mb dump.
after it fails writing (it should spit out an illegal block error for every block written) read it again to see the data. im taking a stab at it and guessing that the nand is erased completely.

might be useful for the guys working on the script Smiley
Logged
Eiji
Master Hacker
****
Posts: 104


View Profile
« Reply #50 on: December 14, 2009, 06:54:39 PM »

If flashing with lflash and the flash goes wrong, can you lose access to Xell?

tuxuser, is your lflash for "Jasper NANDS" for only dumping the NAND or also to flash with?
« Last Edit: December 14, 2009, 06:57:05 PM by Eiji » Logged
iLLNESS
Master Hacker
****
Posts: 398


View Profile
« Reply #51 on: December 14, 2009, 06:57:18 PM »

If flashing with lflash and the flash goes wrong, can you lose access to Xell?
of course
this is why you use lpt/usb to recover Tongue

lflash doesnt work unless you have flashing abilities in the first place so its not a big deal.

things are in the early stages so i dont know why you'd want to remove lpt/usb flashing abilities right now anyways.
Logged
Eiji
Master Hacker
****
Posts: 104


View Profile
« Reply #52 on: December 14, 2009, 07:03:34 PM »

of course
this is why you use lpt/usb to recover Tongue

lflash doesnt work unless you have flashing abilities in the first place so its not a big deal.

things are in the early stages so i dont know why you'd want to remove lpt/usb flashing abilities right now anyways.

I already have my console JTAG'd but yes, one day I want to remove the LPT so I can flash via the console itself. I guess I'll have to wait sometime for on-Xbox flashing methods to become stable and reliable enough to remove LPT for.
Logged
infidelity
Member
**
Posts: 17


View Profile
« Reply #53 on: December 15, 2009, 08:07:36 AM »

I'm unable to mount my usbstick, i get the "flash" folder created on the linux desktop, but the lflash file is not put in there

i type the following

"mount -t vfat -o uid=gentoo,gid=users /dev/sda /home/gentoo/Desktop/flash"

it gives me the message

"mount: only root can do that"

my usbstick is in the rear usb port, it's flashed with fat32, it has the lflash.c file on it, and I believe that it is "sda" because when i did the dmesg | grep -i "SCSI device" command, the following comment "in red" about the SCSI device, was that it was "sda"

please, could someone help me out with this, I spent all night trying to mount this and it hasn't worked Sad
Logged
duggyuk
Master Hacker
****
Posts: 271


View Profile
« Reply #54 on: December 15, 2009, 08:10:42 AM »

I'm unable to mount my usbstick, i get the "flash" folder created on the linux desktop, but the lflash file is not put in there

i type the following

"mount -t vfat -o uid=gentoo,gid=users /dev/sda /home/gentoo/Desktop/flash"

it gives me the message

"mount: only root can do that"

my usbstick is in the rear usb port, it's flashed with fat32, it has the lflash.c file on it, and I believe that it is "sda" because when i did the dmesg | grep -i "SCSI device" command, the following comment "in red" about the SCSI device, was that it was "sda"

please, could someone help me out with this, I spent all night trying to mount this and it hasn't worked Sad


sudo mount -t vfat -o uid=gentoo,gid=users /dev/sda /home/gentoo/Desktop/flash

or "sudo su - " just before you issue that command.,
Logged
infidelity
Member
**
Posts: 17


View Profile
« Reply #55 on: December 15, 2009, 08:55:53 AM »

i tried the following...

sudo mount -t vfat -o uid=gentoo,gid=users /dev/sda /home/gentoo/Desktop/flash

and i got this message...

mount: wrong fs type, bad option, bad superblock on /dev/sda,
           missing codepage or other error
           In some cases useful info is found in syslog - try
           dmesg | tail or so

and then I tried the following...

sudo su - mount -t vfat -o uid=gentoo,gid=users /dev/sda /home/gentoo/Desktop/flash

and i got this message...

Unknown id: mount

Sad Sad
Logged
littlestevie360
Master Hacker
****
Posts: 313

past the point of caring


View Profile
« Reply #56 on: December 15, 2009, 09:19:08 AM »

"sudo su" is its own command to elevate you to superuser for that session
Logged
duggyuk
Master Hacker
****
Posts: 271


View Profile
« Reply #57 on: December 15, 2009, 09:21:46 AM »

i tried the following...

sudo mount -t vfat -o uid=gentoo,gid=users /dev/sda /home/gentoo/Desktop/flash

and i got this message...

mount: wrong fs type, bad option, bad superblock on /dev/sda,
           missing codepage or other error
           In some cases useful info is found in syslog - try
           dmesg | tail or so

and then I tried the following...

sudo su - mount -t vfat -o uid=gentoo,gid=users /dev/sda /home/gentoo/Desktop/flash

and i got this message...

Unknown id: mount

Sad Sad

no first you do

"sudo su -"

that will stop those permissions errors.

Next issue is you are saying VFAT for filesystem on drive sda1, is that the right drive?. once you did "su -" try "fdisk -l|grep Disk", you'll get something like

Disk /dev/sda: 250.0 GB, 250059350016 bytes
Disk /dev/sdg: 251.0 GB, 251000193024 bytes

That tells me i have two harddisks in my system (/dev/sda and /dev/sdg) each is 250GB. your drive size should tell you which you want. if STILL unsure you can use "fdisk -l /dev/sdg" where sdg is drive you are interested to show you partition layout.

hth
Logged
infidelity
Member
**
Posts: 17


View Profile
« Reply #58 on: December 15, 2009, 09:25:56 AM »

ok i was able to get to "livecd ~ #"

then i did this...

mount -t vfat -o uid=gentoo,gid=users /dev/sda1 /home/gentoo/Desktop/flash

now "lflash.c" has appeared in the flash folder! Smiley

finally

Now i'll try to continue on, hopefuly with no more issues. Thanks for your help guys Smiley
« Last Edit: December 15, 2009, 09:29:01 AM by infidelity » Logged
littlestevie360
Master Hacker
****
Posts: 313

past the point of caring


View Profile
« Reply #59 on: December 15, 2009, 09:28:48 AM »

Is it just a plain old fat drive? because the way i have been doing any of the CLI apps for flashing and dumping is from TTY1(ctrl+alt+f).
To mount all i do is "mkdir /mnt/usb" "mount /dev/sda1 /mnt/usb"
Then of course navigate there.
Logged
Pages: « 1 2 3 4 5 6 7 8 »
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM