|
sectroyer
|
 |
« on: March 19, 2007, 07:08:07 PM » |
|
Hi would like to announce that It is now possible to write standard C apps for Xbox 360. Here is the example app: http://sectroyer.110mb.com/xbox/hello.cIt uses library xbox360.c that is also here: http://sectroyer.110mb.com/xbox/xbox360.cAnd compiled version: http://sectroyer.110mb.com/xbox/hello.binThe code should be compiled by with the following commands: powerpc64-linux-gnu-gcc hello.c -nostdlib -Ttext=0x1300000 powerpc64-linux-gnu-objcopy -O binary a.out hello.bin echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" >> ./hello.bin I am now working to add support for basic libc functions printf/mem* and all that stuff. If I can xbox360.c will include standard powerpc65 linux (by using #include <foo.h>) but sometimes it is required to use a specific library for Xbox 360 in that case it is included in a different way (by using #include "bar.c") and then bar.c has to be also downloaded from the site (i.e. http://sectroyer.110mb.com/xbox/bar.c). I would like to thank mwk from asm channel for help with toc section initialization. Felix Domke from free60 project for allowing me to use a piece of his Linux loader code. And stonesmurf from XBH for doing tons of test on his box and having so much patience for my lack of knowledge  I hope this will help people to develop their own small apps for Xbox 360. Please note that there is one problem: getchar function sometimes returns an enter key (0xa) where in fact it was not pressed. It can cause gets function to return without getting anything from the user. Sample code can also behave in this way. You will just have to correct the code by adding some getchar(); lines.
|
|
|
|
« Last Edit: March 19, 2007, 07:23:50 PM by stonersmurf »
|
Logged
|
|
|
|
|
tmbinc
|
 |
« Reply #1 on: March 19, 2007, 07:49:31 PM » |
|
Also, i've now put up XeLL into the free60 cvs ( http://free60.cvs.sourceforge.net/free60/xell/). It includes basic hardware support for DVDROM, Network and provides a simple C environment. Feel free ripping any code, but it's all GPLv2. Also, with this loader, you can load linux (using the posted patches, they should be complete).
|
|
|
|
|
Logged
|
Please don't copy/quote full text outside this board. Instead, summarize and link to this post. Thanks! This lets me keep information updated and doesn't pull things out of context.
|
|
|
|
Cpasjuste
|
 |
« Reply #2 on: March 19, 2007, 09:12:30 PM » |
|
Omg, thanks tmbinc its an awsome news for me.
Edit : I just linked this thread to xbox-scene forum since its a really cool news for me, let me know if i did a mistake.
|
|
|
|
« Last Edit: March 19, 2007, 09:23:05 PM by Cpasjuste »
|
Logged
|
|
|
|
|
k0mpresd
|
 |
« Reply #3 on: March 19, 2007, 10:32:05 PM » |
|
yes, thank you 
|
|
|
|
|
Logged
|
|
|
|
|
Cpasjuste
|
 |
« Reply #4 on: March 19, 2007, 11:15:24 PM » |
|
Thanks for your work again tmbinc. I have a little question anyway, could you make a default configuration file for the xenon kernel build process so we can do : "make xenon_defconfig" to create the default configfile like its usally the case ? (eg for ps3).
|
|
|
|
|
Logged
|
|
|
|
|
warpjavier
|
 |
« Reply #5 on: March 20, 2007, 03:04:19 AM » |
|
Hi everyone, Glad to see this released, I can't wait to see linux running in my 360.  Trying to compile xell, but got some errors: powerpc-elf-gcc -Iinclude -m64 -c -o startup2.o startup2.S startup2.S:0: error: -m64 not supported in this configuration make: *** [startup2.o] Error 1
Then I changed -m64 to -mpowerpc64 and everything compiles but does not link and I got this error: powerpc-elf-gcc -n -T rom.lds -nostdlib -o rom.elf startup2.o main.o string.o sprintf.o ctype.o time.o cache.o ./lwip/core/tcp_in.o ./lwip/core/inet.o ./lwi /core/mem.o ./lwip/core/memp.o ./lwip/core/netif.o ./lwip/core/pbuf.o ./lwip/co e/stats.o ./lwip/core/sys.o ./lwip/core/tcp.o ./lwip/core/ipv4/ip_addr.o ./lwi /core/ipv4/icmp.o ./lwip/core/ipv4/ip.o ./lwip/core/ipv4/ip_frag.o ./lwip/core/ cp_out.o ./lwip/core/udp.o ./lwip/netif/etharp.o ./lwip/netif/loopif.o ./lwip/c re/dhcp.o ./lwip/core/raw.o ./lwip/arch/xenon/lib.o ./lwip/arch/xenon/netif/en t.o network.o tftp.o httpd/httpd.o httpd/vfs.o dtc.o cdrom.o /usr/local/lib/gcc/powerpc-elf/4.1.1/../../../../powerpc-elf/bin/ld: section .t xt [00000000 -> 0000f97b] overlaps section .bss [00000000 -> 000d6e1b] collect2: ld returned 1 exit status make: *** [rom.elf] Error 1
I'm not sure that changing -m64 to -mpowerpc64 would work. But anyway I couldn't manage to get rid of this error. Help will be appreciated warpjavier PS. Keep up the good work guys!
|
|
|
|
|
Logged
|
Internet Explorer is only useful to download Firefox.
|
|
|
|
tmbinc
|
 |
« Reply #6 on: March 20, 2007, 05:53:50 AM » |
|
I've uploaded my .config file at http://rapidshare.com/files/21917268/.config.html , that should be fine for a start. warpjavier, i think your crosscompiler is not ok. Please compiler a crosscompiler for powerpc64-linux (as oppose to powerpc-linux). But i'm not sure about the concrete differences.
|
|
|
|
|
Logged
|
Please don't copy/quote full text outside this board. Instead, summarize and link to this post. Thanks! This lets me keep information updated and doesn't pull things out of context.
|
|
|
|
kalle_19
|
 |
« Reply #7 on: March 20, 2007, 08:31:05 AM » |
|
tmbinc: What Distro do you use? Hasn't suse enterprise a powerpc64-linux-gcc binary?
|
|
|
|
|
Logged
|
|
|
|
|
tmbinc
|
 |
« Reply #8 on: March 20, 2007, 09:12:57 AM » |
|
i've manually compiled my toolchain using crosstool (gcc-4.1.0-glibc-2.3.6, modified to powerpc64-linux).
|
|
|
|
|
Logged
|
Please don't copy/quote full text outside this board. Instead, summarize and link to this post. Thanks! This lets me keep information updated and doesn't pull things out of context.
|
|
|
|
Cpasjuste
|
 |
« Reply #9 on: March 20, 2007, 11:02:11 AM » |
|
I'm sorry tmbinc but i have another question : First thanks again for taking the time to send your config file, but i have the same problem. I'm not a linux guru, but i presume that i should copy a rootfs on my hardrive isnt it (i dont have the hardware to) ? here is my prob : [ 84.656515] VFS: Cannot open root device "sda1" or unknown-block(8,1) [ 84.672804] Please append a correct "root=" boot option [ 84.687883] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,1) [ 84.706218] <0>Rebooting in 180 seconds..
My boot process log : http://mydedibox.homelinux.com/downloads/x360/xlinux.txt
|
|
|
|
|
Logged
|
|
|
|
|
tmbinc
|
 |
« Reply #10 on: March 20, 2007, 11:13:46 AM » |
|
Nice that it works for you. btw, people using samsung drives have to disable that sata channel, or fix the kernel. XeLL enables modeB for hitachi, but that of course doesn't help for samsung. might be an easy fix, i don't know.
Yes, you need a root file system available.
Be careful when overwriting your harddisk. better use a different one. If you overwrite the signature block on your retail harddisk, it will never work again for the original kernel. (it will be fine for linux, though).
Somebody should make a live cd.
|
|
|
|
|
Logged
|
Please don't copy/quote full text outside this board. Instead, summarize and link to this post. Thanks! This lets me keep information updated and doesn't pull things out of context.
|
|
|
|
Cpasjuste
|
 |
« Reply #11 on: March 20, 2007, 11:24:06 AM » |
|
Yep i think i really understand now, our problem is that our hard disk partition (fatx like xbox1 ?) isnt properly recognized : [ 81.153746] SCSI device sda: 39070080 512-byte hdwr sectors (20004 MB) [ 81.170933] sda: Write Protect is off [ 81.185406] SCSI device sda: write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 81.205826] sda: unknown partition table
The solution would be to either format my hardrive to a standard linux partition, make a compatible fatx? driver to load a virtual rootfs, or to boot on usb. I'll try right now to boot on an usb hard drive since its properly recognized on the startup process 
|
|
|
|
« Last Edit: March 20, 2007, 11:34:35 AM by Cpasjuste »
|
Logged
|
|
|
|
|
Surrido
|
 |
« Reply #12 on: March 21, 2007, 07:15:29 AM » |
|
If I remember right TheSpecialist's HD tool allows to use also larger than 20GB HD to work as 360 HDs. However the rest of the space could not be used since the signature only allows 20GB.
maybe it is possible to have 2 partitions. one 20GB signed my M$ and one with linux file system...
|
|
|
|
|
Logged
|
|
|
|
|
tmbinc
|
 |
« Reply #13 on: March 21, 2007, 09:45:10 AM » |
|
You can use bigger HDDs today. They just won't work in dashboard etc., but will work under linux.
|
|
|
|
|
Logged
|
Please don't copy/quote full text outside this board. Instead, summarize and link to this post. Thanks! This lets me keep information updated and doesn't pull things out of context.
|
|
|
|
Surrido
|
 |
« Reply #14 on: March 21, 2007, 11:15:24 AM » |
|
the question is, are you able to use a HD split into 20GB M$ and rest linux...
|
|
|
|
|
Logged
|
|
|
|
|
tmbinc
|
 |
« Reply #15 on: March 21, 2007, 11:20:49 AM » |
|
Yes, there was a (now deleted) post inbetween, to which i've answered.
(Somehow i start to dislike that posts are removed without notice - even if they are OT or whatever). But IANAM, so I don't *really* care.
You could try setting a "host protected area". That should reduce the net capacity of the drive, so the drive is reported as a smaller drive. Linux already knows how to disable the HPA.
TheSpecialist, do you think this would be possible?
|
|
|
|
|
Logged
|
Please don't copy/quote full text outside this board. Instead, summarize and link to this post. Thanks! This lets me keep information updated and doesn't pull things out of context.
|
|
|
|
TheSpecialist
|
 |
« Reply #16 on: March 21, 2007, 01:09:19 PM » |
|
Yes, there was a (now deleted) post inbetween, to which i've answered.
(Somehow i start to dislike that posts are removed without notice - even if they are OT or whatever). But IANAM, so I don't *really* care.
You could try setting a "host protected area". That should reduce the net capacity of the drive, so the drive is reported as a smaller drive. Linux already knows how to disable the HPA.
TheSpecialist, do you think this would be possible?
Hi tmbinc, some great work you've done, congratulations  Anyway, yeah, if the drive reports different size in the 'identify_device' packet, then yes, it's possible. But I don't know about HPA on the WD drives, haven't looked at it ...
|
|
|
|
|
Logged
|
|
|
|
|
Cpasjuste
|
 |
« Reply #17 on: March 22, 2007, 02:25:49 PM » |
|
Hehe ^^ cpasjuste@xenon$ cat /proc/cpuinfo processor : 0 cpu : Xenon, altivec supported clock : 3192.000000MHz revision : 2.0 (pvr 0071 0200)
processor : 2 cpu : Xenon, altivec supported clock : 3192.000000MHz revision : 2.0 (pvr 0071 0200)
processor : 4 cpu : Xenon, altivec supported clock : 3192.000000MHz revision : 2.0 (pvr 0071 0200)
timebase : 49875000 platform : Xenon machine : CHRP Xenon Game Console
|
|
|
|
|
Logged
|
|
|
|
|
Cpasjuste
|
 |
« Reply #18 on: March 22, 2007, 02:36:45 PM » |
|
I have now some problem's to make X to work but i will work on it. Its just so nice already. Anyway, it seems that the external usb hardrive isnt mounted when the kernel is booting, it is recognized its sure but it is only mounted after my nfs-root is loaded. Is theire a way to mount an usb drive directly from a kernel command line ? For now i'm using nfs to make the root filesystem but its not a final solution ..
|
|
|
|
« Last Edit: March 22, 2007, 02:45:39 PM by Cpasjuste »
|
Logged
|
|
|
|
|
tmbinc
|
 |
« Reply #19 on: March 22, 2007, 04:22:05 PM » |
|
X requires a special driver which takes care of the tiling. I have it here but i'm not the only author of it so i need to fix up some stuff before.
Interesting is, btw, that there are two different CPUs: On one of my (retail) xboxes, the PVR is 00710300, all the others have 00710200. I couldn't find any differences, though.
you can boot from usb, you probably need a root fs mount delay to make sure it will scan the usb devices first. and of course you need usb-storage etc. all in kernel.
You could also write an initramfs, which is probably the right way to do this :)
|
|
|
|
|
Logged
|
Please don't copy/quote full text outside this board. Instead, summarize and link to this post. Thanks! This lets me keep information updated and doesn't pull things out of context.
|
|
|
|