XboxHacker BBS
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 21, 2013, 05:36:41 PM


Login with username, password and session length


Pages: 1
  Print  
Author Topic: anyone willing to help getting xbox360 formatted drives mount under linux?  (Read 3015 times)
MastaG
Master Hacker
****
Posts: 343


What have you done for me lately?


View Profile
« on: January 06, 2010, 12:15:02 PM »

Hi there,

I was looking into getting the internal hdd to work under linux.
Since there is already a working sata-bus driver the drive gets detected but partition table and fatx support aren't available.
I've been looking into some xbox1-linux patches and found the following:

Xbox1 partition table support in 2.6.16:
Code:
--- a/fs/partitions/xbox.c 1969-12-31 19:00:00.000000000 -0500
+++ b/fs/partitions/xbox.c 2006-03-26 20:13:52.000000000 -0500
@@ -0,0 +1,117 @@
+/*
+ * fs/partitions/xbox.c
+ * Xbox disk partition support.
+ *
+ * Copyright (C) 2002  John Scott Tillman <speedbump@users.sourceforge.net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include <linux/errno.h>
+#include <linux/genhd.h>
+#include <linux/kernel.h>
+
+#include "check.h"
+#include "xbox.h"
+
+
+/*
+ * The native Xbox kernel makes use of an implicit partitioning
+ * scheme. Partition locations and sizes on-disk are hard-coded.
+ */
+#define XBOX_CONFIG_START 0x00000000L
+#define XBOX_CACHE1_START 0x00000400L
+#define XBOX_CACHE2_START 0x00177400L
+#define XBOX_CACHE3_START 0x002EE400L
+#define XBOX_SYSTEM_START 0x00465400L
+#define XBOX_DATA_START 0x0055F400L
+#define XBOX_EXTEND_START 0x00EE8AB0L
+
+#define XBOX_CONFIG_SIZE (XBOX_CACHE1_START - XBOX_CONFIG_START)
+#define XBOX_CACHE1_SIZE (XBOX_CACHE2_START - XBOX_CACHE1_START)
+#define XBOX_CACHE2_SIZE (XBOX_CACHE3_START - XBOX_CACHE2_START)
+#define XBOX_CACHE3_SIZE (XBOX_SYSTEM_START - XBOX_CACHE3_START)
+#define XBOX_SYSTEM_SIZE (XBOX_DATA_START - XBOX_SYSTEM_START)
+#define XBOX_DATA_SIZE (XBOX_EXTEND_START - XBOX_DATA_START)
+
+#define XBOX_MAGIC_SECT 3L
+
+
+static int xbox_check_magic(struct block_device *bdev, sector_t at_sect,
+ char *magic)
+{
+ Sector sect;
+ char *data;
+ int ret;
+
+ data = read_dev_sector(bdev, at_sect, &sect);
+ if (!data)
+ return -1;
+
+ /* Ick! */
+ ret = (*(u32*)data == *(u32*)magic) ? 1 : 0;
+ put_dev_sector(sect);
+
+ return ret;
+}
+
+static inline int xbox_drive_detect(struct block_device *bdev)
+{
+ /**
+ * "BRFR" is apparently the magic number in the config area
+ * the others are just paranoid checks to assure the expected
+ * "FATX" tags for the other xbox partitions
+ *
+ * the odds against a non-xbox drive having random data to match is
+ * astronomical...but it's possible I guess...you should only include
+ * this check if you actually *have* an xbox drive...since it has to
+ * be detected first
+ *
+ * @see check.c
+ */
+ return (xbox_check_magic(bdev, XBOX_MAGIC_SECT, "BRFR") &&
+ xbox_check_magic(bdev, XBOX_SYSTEM_START, "FATX") &&
+ xbox_check_magic(bdev, XBOX_DATA_START, "FATX")) ?
+ 0 : -ENODEV;
+}
+
+int xbox_partition(struct parsed_partitions *state, struct block_device *bdev)
+{
+ int slot, err;
+ sector_t last, size;
+
+ err = xbox_drive_detect(bdev);
+ if (err)
+ return err;
+
+ slot = 50;
+ printk(" [xbox]");
+
+ put_partition(state, slot++, XBOX_DATA_START, XBOX_DATA_SIZE);
+ put_partition(state, slot++, XBOX_SYSTEM_START, XBOX_SYSTEM_SIZE);
+ put_partition(state, slot++, XBOX_CACHE1_START, XBOX_CACHE1_SIZE);
+ put_partition(state, slot++, XBOX_CACHE2_START, XBOX_CACHE2_SIZE);
+ put_partition(state, slot++, XBOX_CACHE3_START, XBOX_CACHE3_SIZE);
+
+ /*
+ * Xbox HDDs come in two sizes - 8GB and 10GB. The native Xbox kernel
+ * will only acknowledge the first 8GB, regardless of actual disk
+ * size. For disks larger than 8GB, anything above that limit is made
+ * available as a seperate partition.
+ */
+ last = bdev->bd_disk->capacity;
+ if (last == XBOX_EXTEND_START)
+ goto out;
+
+ printk(" <");
+ size = last - XBOX_EXTEND_START;
+ put_partition(state, slot++, XBOX_EXTEND_START, size);
+ printk(" >");
+
+out:
+ printk("\n");
+ return 1;
+}
diff -uprN a/fs/partitions/xbox.h b/fs/partitions/xbox.h
--- a/fs/partitions/xbox.h 1969-12-31 19:00:00.000000000 -0500
+++ b/fs/partitions/xbox.h 2006-03-26 20:13:52.000000000 -0500
@@ -0,0 +1,6 @@
+/*
+ *  fs/partitions/xbox.h
+ */
+
+int xbox_partition(struct parsed_partitions *state,
+ struct block_device *bdev);

I don't know how much modification would be needed in order to support the mapping of the third partion since it can be any size if it's formatted with XBR/freeBOOT.
According to free60.org:

Address            Description                                      Format
0x80000            Cache Partition                                 FATX
0x80080000       Game Cache Partition                        STFC
0x120EB0000     Xbox Backwards compatibility drive     FATX
0x130EB0000     Main Xbox 360 Partition                     FATX

The fatx patch is a little large to post.
I couldn't find any info regarding the differences between fatx formatted partition on the xbox vs xbox360.

Logged

I understand. You found paradise in America, you had a good trade, you made a good living.
The police protected you and there were courts of law.
And you didn't need a friend like me.
But, uh, now you come to me, and you say: "Don Corleone, give me justice."
But you don't ask with respect.
You don't offer friendship.
You don't even think to call me Godfather.
Instead, you come into my house on the day my daughter is to be married, and you ask me to do murder for money.
Coniger12
Master Hacker
****
Posts: 148


View Profile
« Reply #1 on: January 06, 2010, 10:48:34 PM »

I'm not sure if you've read the free60 article, but just to make sure: http://www.free60.org/FATX
There is a link on that page to a Kernel Module for FreeBSD, but dead dl links. You might be able to mess with that code as it references 20gb, 60gb, and 120gb drive sizes.

I found everything sitting in a weird "svn"-ish reposiory here: http://p4db.freebsd.org/depotTreeBrowser.cgi?FSPC=/depot/user/rene/xtaf&HIDEDEL=NO

Hope that helps.
Logged

I like being the only person to rip from Lite-Ons using uxrip360.
littlestevie360
Master Hacker
****
Posts: 313

past the point of caring


View Profile
« Reply #2 on: January 07, 2010, 05:11:26 AM »

the difference is Endianness xbox 360 is big endian while xbox 1 was little endian looking at the fatx magic should be enough to show the difference (xbox 1 is XTAF)
Logged
patstew
Member
**
Posts: 20


View Profile
« Reply #3 on: January 08, 2010, 10:12:59 AM »

I haven't actually tried this yet, but I found this when I was looking for a way to do mount in linux http://code.google.com/p/x360/
Logged
nevernow
Hacker
***
Posts: 67


View Profile
« Reply #4 on: January 08, 2010, 09:08:07 PM »

I hadn't even considered connecting my "proper", FATX drive to my Linux PC, now I tried and it doesn't receive a /dev/sdX device - it spins up but that's all. Am I missing some USB or udev quirk? I am using a 3rd party 360drive-to-USB adapter, by the way.
Logged
Coniger12
Master Hacker
****
Posts: 148


View Profile
« Reply #5 on: January 09, 2010, 01:26:31 AM »

try "fdisk -l" and lok for any devide without a valid partition table.
Logged

I like being the only person to rip from Lite-Ons using uxrip360.
slasherking823
Master Hacker
****
Posts: 222


View Profile
« Reply #6 on: January 09, 2010, 01:28:56 AM »

I haven't actually tried this yet, but I found this when I was looking for a way to do mount in linux http://code.google.com/p/x360/

cool, had no idea that that existed
Logged

If that gamerscore or tenth prestige is so important to you that you absolutely need a pointless number - get it legit
If you are just trying to show off - throw a party(real party, not nerd party, some of you would miss that point)
If you like to be a fagot and go by "Jtags are for Mw2" - GTFO
nevernow
Hacker
***
Posts: 67


View Profile
« Reply #7 on: January 09, 2010, 10:08:35 AM »

try "fdisk -l" and lok for any devide without a valid partition table.
Thanks! Wink That was it. I tried mounting it and it worked.
This is the progress of the project as reported in the latest SVN revision ( not directly visible on the web page), 18:
Quote
FEATURES

Directory Listing:     90%              multi-cluster directories can be listed but not modified (untested)
File Stating:            60%              name, file vs directory, and file size are supported; time is weirdly supported
File Creation:         100%             Creates an entry in the directory table and allocates a cluster for use
File Reading:          100%             full file read support with error-checking
File Writing:           100%             full file write support with error-checking
File Renaming:         50%             Renaming across directories (moving) is not supported.
File Truncation:      100%             Truncating allocates/frees clusters appropriately
File Deletion:         100%             Marks directory entry as 'deleted' and frees clusters
Directory Creation: 100%             Makes 100% genuine directories Smiley
Directory Deletion:   50%             Believe it or not, you have to actually remove all the files from a directory before deleting it (I thought that file managers did that automatically, but I guess not)
Partitions:                5%              partition 3 support only; automatic size detection
Multi-User Support:  60%             mounted files have user's uid/gid as owner uid/gid; user can set arbitrary uid/gid for owner
Logged
Thinkdiff
Hacker
***
Posts: 64


View Profile
« Reply #8 on: January 09, 2010, 01:01:40 PM »

Were you able to create files on the drive? It thinks there's no free space on my 160GB XBR drive.
Logged
nevernow
Hacker
***
Posts: 67


View Profile
« Reply #9 on: January 09, 2010, 01:14:15 PM »

Same here. I'm not too familiar with the FUSE filesystem, but maybe there are some tweaks to do. Also, I'm afraid memory handling needs some attention. I tried:
Code:
du -h --max-depth=1
and memory usage quickly jumped to 83.8% of my 4GB of RAM.  Shocked
« Last Edit: January 09, 2010, 01:26:24 PM by nevernow » Logged
tuxuser
Hacker
***
Posts: 50


View Profile WWW
« Reply #10 on: January 11, 2010, 06:24:17 PM »

Hey,
Did anybody got it to compile @powerpc ?
Logged
gnome_u_didnt
Newbie
*
Posts: 2


View Profile
« Reply #11 on: June 21, 2010, 04:43:14 AM »

Old topic but thought I would ask...Can we defrag the three60 fat drive in linux once it's mounted? "fsck -a"Huh Will attempt and if successful work on app to automate. 1tb internal drive has become fragmented slow and skipping. Must be due to FAT filesystem.
Logged
Isaac356
Newbie
*
Posts: 1


View Profile
« Reply #12 on: January 05, 2011, 06:00:39 PM »

Hi,

I know this topic is old, but I just thought I'd say that there's a new version of x360 on Google Code. It's a complete rewrite, and it's performing much better than the old one. I think that it would compile on PowerPC, but I don't have an exploitable 360 to test it on. It's read only, though, for the time being.
Logged
Pages: 1
  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