XboxHacker BBS
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 21, 2013, 01:47:06 PM


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 33367 times)
SavageCHRIS
Member
**
Posts: 11


View Profile
« Reply #80 on: January 01, 2010, 07:36:04 AM »

I can't get gentoo to boot. I have usb keyboard and mouse in front ports, boot it up through controller at back usb , xell loads, I take the controller out and plug in external HDD, i get 6 penguins and writing on the screen but it stalls were it says...
 
"attempting to mount CD:- /dev/sr0 "
"No bootable medium found. Waiting for new devices....."
"attempting to mount CD:- /dev/sr0 "
"attempting to mount CD:- /dev/sda "

is there anything else i need to do ? I've burned a few gentoos at slow speeds but all the same. thanks
Logged
Eiji
Master Hacker
****
Posts: 104


View Profile
« Reply #81 on: January 01, 2010, 05:28:18 PM »

Can you flash/write a 16MB Jasper NAND with lflash? I have a 360 with XBR that a friend flashed for me and it doesn't have any LPT wires anymore so my only choice for flashing is lflash.

I want to update my console with XBReboot_8955_3 without messing up the NAND requiring hooking up the LPT again.

Do I use the modified lflash on page 3 by tuxuser?

Can anyone confirm it works properly in writing to a 16MB Jasper NAND?
Logged
Caliga
Newbie
*
Posts: 3


View Profile
« Reply #82 on: January 01, 2010, 07:22:28 PM »

Can you flash/write a 16MB Jasper NAND with lflash? I have a 360 with XBR that a friend flashed for me and it doesn't have any LPT wires anymore so my only choice for flashing is lflash.

I want to update my console with XBReboot_8955_3 without messing up the NAND requiring hooking up the LPT again.

Do I use the modified lflash on page 3 by tuxuser?

Can anyone confirm it works properly in writing to a 16MB Jasper NAND?

I used the code from page 1 but I have a Xenon, page 3 is just for Jasper large block nands (I think). Just did this now and it works like a charm. When writing back to the nand youll get "illogical(illegal?) block error" or something similar, dont be alarmed its the usual.

Make 100% sure you backup your current nand, pop it on your pc and extract the kv and config from your current xbrbackup and then inject the kv and config into the new xbr_8955_3.bin using nand pro. Then transfer your xbr_8955_3 to linux for flashing.

You are probably better off waiting for redlines Xell flasher if your nervs get at you while doing it, better to be safe than sorry.
« Last Edit: January 01, 2010, 07:32:07 PM by Caliga » Logged
vintage_guitar
Hacker
***
Posts: 55


View Profile
« Reply #83 on: January 01, 2010, 07:47:42 PM »

Yeah, the default version of lflash.c (supposedly) works on flashing 16mb NAND. But please, do NOT use the large block version on page 3 to flash anything whatsoever!
Logged
irishwhip
Hacker
***
Posts: 52


View Profile
« Reply #84 on: January 01, 2010, 07:56:44 PM »

I can confirm the default lflash.c from sourceforge works, I just did my xenon with it. It threw up a few error messages near the end of the flashing process, but everything is working fine after a power cycle. Freezing issues are completely eliminated.
Logged
vintage_guitar
Hacker
***
Posts: 55


View Profile
« Reply #85 on: January 01, 2010, 08:08:35 PM »

I can confirm the default lflash.c from sourceforge works, I just did my xenon with it. It threw up a few error messages near the end of the flashing process, but everything is working fine after a power cycle. Freezing issues are completely eliminated.
Bydox fixed this error message in page 2 of this thread. It's nothing to worry about.
Logged
pankake
Member
**
Posts: 10


View Profile
« Reply #86 on: January 01, 2010, 08:57:34 PM »

I am waiting for the lflash.c file that will allow us to flash our 512mb nands through linux.  Smiley

yeah 256 / 512 writing would be nice. hopefully within a few days. thanks to all involved!
Logged
glaze83
Xbox Hacker
*****
Posts: 534


View Profile
« Reply #87 on: January 01, 2010, 11:29:01 PM »

Sure someone will also make an update script.
Logged
thesonandheir
Hacker
***
Posts: 53


View Profile
« Reply #88 on: January 02, 2010, 12:19:06 AM »

I can't get gentoo to boot. I have usb keyboard and mouse in front ports, boot it up through controller at back usb , xell loads, I take the controller out and plug in external HDD, i get 6 penguins and writing on the screen but it stalls were it says...
 
"attempting to mount CD:- /dev/sr0 "
"No bootable medium found. Waiting for new devices....."
"attempting to mount CD:- /dev/sr0 "
"attempting to mount CD:- /dev/sda "

is there anything else i need to do ? I've burned a few gentoos at slow speeds but all the same. thanks


Probably need internal HDD.
Logged
HuHu
Hacker
***
Posts: 50



View Profile
« Reply #89 on: January 02, 2010, 12:28:18 AM »

You don't need a usb-stick or HDD to lflash your nand. Open a Terminal and change the root password. Now you can connect via SCP to transfer lflash.c and your xbr.bin. With a SSH-Connection to your Xbox you can easyli flash your nand.

But remember, all transfered stuff will be deleted after you reboot your xbox cause' they're saved in the ram.

- I Hate Ginger Kids!
Logged

n00bpwner360
Xbox Hacker
*****
Posts: 615


View Profile
« Reply #90 on: January 02, 2010, 01:12:57 AM »

Nevermind doesn't work.
« Last Edit: January 02, 2010, 01:25:19 AM by n00bpwner360 » Logged

yeah lowering the default reading speed from 12x to let's say 5x, would really let GTA4 (or any of your games) benefit from way less popups and loading times.
joeyddr
Master Hacker
****
Posts: 134


View Profile
« Reply #91 on: January 02, 2010, 03:42:18 PM »

You don't need a usb-stick or HDD to lflash your nand. Open a Terminal and change the root password. Now you can connect via SCP to transfer lflash.c and your xbr.bin. With a SSH-Connection to your Xbox you can easyli flash your nand.

But remember, all transfered stuff will be deleted after you reboot your xbox cause' they're saved in the ram.

- I Hate Ginger Kids!
This is how i did it and it worked perfect.. winscp ssh and i am all set.. of course i have no bad blocks.
Logged
hoozey
Newbie
*
Posts: 1


View Profile
« Reply #92 on: January 03, 2010, 12:38:42 AM »

I can't get gentoo to boot. I have usb keyboard and mouse in front ports, boot it up through controller at back usb , xell loads, I take the controller out and plug in external HDD, i get 6 penguins and writing on the screen but it stalls were it says...
 
"attempting to mount CD:- /dev/sr0 "
"No bootable medium found. Waiting for new devices....."
"attempting to mount CD:- /dev/sr0 "
"attempting to mount CD:- /dev/sda "

is there anything else i need to do ? I've burned a few gentoos at slow speeds but all the same. thanks


I had this same problem with my hitachi drive.

Unplug the 360 with the dvd tray ejected. Plug it back in and boot Xell.

See this thread: http://www.xboxhacker.net/index.php?topic=12264.0
Logged
Rogero
Master Hacker
****
Posts: 165


View Profile WWW
« Reply #93 on: January 03, 2010, 09:04:30 AM »

I can't get gentoo to boot. I have usb keyboard and mouse in front ports, boot it up through controller at back usb , xell loads, I take the controller out and plug in external HDD, i get 6 penguins and writing on the screen but it stalls were it says...
 
"attempting to mount CD:- /dev/sr0 "
"No bootable medium found. Waiting for new devices....."
"attempting to mount CD:- /dev/sr0 "
"attempting to mount CD:- /dev/sda "

is there anything else i need to do ? I've burned a few gentoos at slow speeds but all the same. thanks


I had this same problem with my hitachi drive.

Unplug the 360 with the dvd tray ejected. Plug it back in and boot Xell.

See this thread: http://www.xboxhacker.net/index.php?topic=12264.0

had the same problem while i was flashing my Jasper16 with lFlash, i have a Hitachi079 drive too, all i did was while it gives you the messages:
"attempting to mount CD:- /dev/sr0 "
"No bootable medium found. Waiting for new devices....."
"attempting to mount CD:- /dev/sr0 "
"attempting to mount CD:- /dev/sda "

just open the DVD drive then closed it right away, it will recheck the DVD again and loads fine Wink  simple trick that worked every time.
« Last Edit: January 03, 2010, 09:11:03 AM by Rogero » Logged
Rogero
Master Hacker
****
Posts: 165


View Profile WWW
« Reply #94 on: January 03, 2010, 09:22:57 AM »

Yeah, my xbox kept freezing during the dumping process. But, if you just keep doing it, eventually you'll get through to the verifying stage, at which point it's finished anyway. Just make sure you get more than 1 dump , and still compare them to one another..

please can you post the command used with Lflash to only dump the nand and not flash it with another image.

I already used Lflash to flash the new XBR3 to my Jasper16, now i need to have a dump of the flashed XBR3 to do some checks,but i dont want to flash back anything, just need to dump with Lflash.

Thanks
Logged
vintage_guitar
Hacker
***
Posts: 55


View Profile
« Reply #95 on: January 03, 2010, 09:26:53 AM »

please can you post the command used with Lflash to only dump the nand and not flash it with another image.
Code:
./a.out backupnand.bin
Logged
Rogero
Master Hacker
****
Posts: 165


View Profile WWW
« Reply #96 on: January 03, 2010, 09:51:40 AM »

please can you post the command used with Lflash to only dump the nand and not flash it with another image.
Code:
./a.out backupnand.bin

just what i thought, but didn't want to take the chance and try it out.
Thank you for the quick reply  Wink
Logged
Eiji
Master Hacker
****
Posts: 104


View Profile
« Reply #97 on: January 06, 2010, 11:45:51 PM »

Assuming I have a good back up of my 512mb nand, what is the worst that could happen by using lflash.c to flash my nand?  I see a lot of tutorials that say, do not under any circumstance flash your nand with the un-updated version of lflash.c  now i am afraid to even try it...haha

so, if anyone knows what the worst that could happen is, and let me know, that would be cool

thanks!

Two things can happen:

1) You don't have your LPT/USB flasher connected to the 360 anymore and the flash via lflash fails so you need to reconnect the LPT/USB up again


2) The flash fails half-way or a powercut occurs causing the NAND to become undetecable via nandpro so you need to short some pins on the nand to get it recognisable again in nandpro and then flash with LPT/USB
Logged
tuxuser
Hacker
***
Posts: 50


View Profile WWW
« Reply #98 on: January 06, 2010, 11:57:08 PM »

Here is a lil bit newer version of lflash, which is now "all-in-one". It *should* support Reading/Flashing ALL 16MB Consoles and Reading 256/512MB Consoles. The Illegal block warnings are also gone.
Big Nand Flashing is still not workin. Would be nice if somebody could help me with that.

Like the src says, USE AT YOUR OWN RISK!

http://ep-comps.com/free60/Sources/lflash64.c

edited: changed the script to read only 64MB of the large nand to avoid ram issues with using a live cd. Also dumping 64mb is safe since thats the area where the systemdata/filesystem is located, the rest of the nand is only for internal memory unit.

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;
int bsec;

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[bsec] != 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);

int phys_pos;

if (!raw)
{
readsector(sector_flash, i, 0);

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)
{
// 512MB/256MB NAND
case 0x00AA3020:
case 0x008A3020:
nandsize = 64 * 1024 * 1024;
bsec = 0x200;
break;
// 16 MB NAND
case 0x00023010:
case 0x01198010:
nandsize = 16 * 1024 * 1024;
bsec = 0x205;
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;
}
« Last Edit: January 07, 2010, 02:40:46 PM by tuxuser » Logged
Starspin
Member
**
Posts: 28


View Profile
« Reply #99 on: January 07, 2010, 04:22:45 AM »

Here is a lil bit newer version of lflash, which is now "all-in-one". It *should* support Reading/Flashing ALL 16MB Consoles and Reading 256/512MB Consoles. The Illegal block warnings are also gone.
Big Nand Flashing is still not workin. Would be nice if somebody could help me with that.

Like the src says, USE AT YOUR OWN RISK!

http://ep-comps.com/free60/Sources/lflash.c

Excellent job! Thanks!
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