Discussion:
[Xbox-linux] Stupid noob question: where can I get old messages from this list in raw format?
Ronald C.F. Antony
2007-02-25 00:28:09 UTC
Permalink
Hi,

I'm trying to apply the xpad.c patch posted on this list back in 5
October 2006 by Matt.
All the list archives seem to be web based, and I can't download a
raw patch file (or copy/paste in a useful way) the patch as displayed
by the various web interfaces and web archives of the list.

Also, why isn't a patch like this reflected in the current source or
available on the files list on sourceforge.

I'm currently in the process of trying to get a 2.6.21-rc1 kernel
running (2.6.20.1 is already working), but getting all the latest
patches into the code is a major PITA because they are not collected
in a central location from what I can tell.

Any hints/help appreciated.

Ronald
Matt Finnicum
2007-02-25 00:43:16 UTC
Permalink
I've copy-pasted it for you. See attached.
Post by Ronald C.F. Antony
Hi,
I'm trying to apply the xpad.c patch posted on this list back in 5
October 2006 by Matt.
All the list archives seem to be web based, and I can't download a
raw patch file (or copy/paste in a useful way) the patch as displayed
by the various web interfaces and web archives of the list.
Also, why isn't a patch like this reflected in the current source or
available on the files list on sourceforge.
I'm currently in the process of trying to get a 2.6.21-rc1 kernel
running (2.6.20.1 is already working), but getting all the latest
patches into the code is a major PITA because they are not collected
in a central location from what I can tell.
Any hints/help appreciated.
Ronald
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Xbox-linux-devel mailing list
https://lists.sourceforge.net/lists/listinfo/xbox-linux-devel
Ronald C.F. Antony
2007-02-25 01:36:29 UTC
Permalink
Post by Matt Finnicum
I've copy-pasted it for you. See attached.
Hi,

thanks. Unfortunately, this patch seems to create more questions than
it solves ;-)

Since most of the xbox kernel patches I could find were rather old
and wouldn't cleanly patch, I followed the instructions found here:
http://www.phoronix.net/forums/showthread.php?p=4445
and use the files found here:
http://xbox-linux.cvs.sourceforge.net/*checkout*/xbox-linux/
kernel-2.6/drivers/usb/input/xpad.c
http://xbox-linux.cvs.sourceforge.net/*checkout*/xbox-linux/
kernel-2.6/drivers/usb/input/xpad.h
Post by Matt Finnicum
for the 2.6.19 kernel it states that you're supposed to edit
"#include <linux/usb_input.h>" and change it to
"#include <linux/usb/input.h>"
and comment lines 54 "#include <linux/config.h>" to
"/* #include <linux/config.h> */"
and line 161 "input_regs(dev, regs);" to
"/* input_regs(dev, regs); */"
except instead of commenting out, I just deleted the corresponding
lines, since there's no point to carry old code in the source for a
new version of the kernel.

The problem is, the patch doesn't work with these versions of the
files, and now I don't know if I work with files that are
a) too new
b) too old
c) from a totally different, incompatible branch
for the patch to work.

If the sources I use are newer, then is the functionality of the
patch already in there?
If the sources I use are older, then were is a more up to date
version of the xpad.c to be found to which I can apply the patch?
If the sources I use are from a separate source branch, then which
should I use and why, and why do we have more than one branch in the
first place?

Just trying to get the cleanest (most applicable patches applied) and
newest kernel running on an XBoX such that I have a good basis from
which to work forward, but it's not like I know anything about xpad
device drivers...

Ronald
Ronald C.F. Antony
2007-02-26 06:21:15 UTC
Permalink
Hi,

I have a bootable kernel for 2.6.20.1 kernel. Of course, I have no
idea if/how well the FATX support will crash the system, but at least
it will compile, and thus hopefully entice someone who knows what
he's doing to fix it eventually ;-)

I have however another problem: I tried to configure that's as
universally useful as possible w/o sacrificing XBOX bootability. The
only way I get a bootable kernel though is if I use the 2.6.18-fc6
xbox kernel, and then do a make oldconfig.

However, the moment I try to make a slightly more universally useful
kernel by enabling a few options that seem like they might come in
handy at some point or another, the kernel won't boot anymore.

Now, since each option change and compile install, and rescue boot
and revert cycle takes several hours, it's extremely unpractical the
enable options one-by one, or to try to narrow down which option(s)
it is exactly that make the kernel not boot.

So what I wonder is if any of you had similar experiences when you
compiled an xbox kernel. If you know/remember any option that you
tried that made the kernel not boot, I'd be very interested in
knowing which because maybe it's as simple as deselecting a few known
bad options to achieve what I want with the rest.

Greetings,

Ronald
Ronald C.F. Antony
2007-02-28 21:53:20 UTC
Permalink
Hi,

I have been able to eliminate a lot of potential sources for the
unbootable kernel.

I have found one culprit however (there may be more, I'm still testing).
A local APIC (Advanced Programmable Interrupt Controller) is an
integrated interrupt controller in the CPU. If you have a single-
CPU system which has a processor with a local APIC, you can say Y
here to enable and use it. If you say Y here even though your
machine doesn't have a local APIC, then the kernel will still run
with no slowdown at all. The local APIC supports CPU-generated self-
interrupts (timer, performance counters), and the NMI watchdog
which detects hard lockups.
Symbol: X86_UP_APIC
[=n]
Prompt: Local APIC support on
uniprocessors
Defined at arch/i386/Kconfig:289
Depends on: !SMP && !X86_VISWS && !X86_VOYAGER && !X86_GENERICARCH
Luke Yelavich
2007-03-01 22:31:54 UTC
Permalink
Post by Ronald C.F. Antony
Hi,
I have been able to eliminate a lot of potential sources for the
unbootable kernel.
I have found one culprit however (there may be more, I'm still testing).
<snip>

This option is only needed if the Xbox's CPU supports apic. Have a look
at /proc/cpuinfo. If apic is not mentioned in the flags, this option can
remain deselected.

I think that the PIII CPUs don't support this option, unless they are
used in an SMP configuration.
--
Luke Yelavich
GPG key: 0xD06320CE
(http://www.themuso.com/themuso-gpg-key.txt)
Email & MSN: ***@themuso.com
Jabber: ***@jabber.org.au
Ronald C.F. Antony
2007-03-02 01:05:00 UTC
Permalink
Post by Luke Yelavich
Post by Ronald C.F. Antony
Hi,
I have been able to eliminate a lot of potential sources for the
unbootable kernel.
I have found one culprit however (there may be more, I'm still testing).
<snip>
This option is only needed if the Xbox's CPU supports apic. Have a look
at /proc/cpuinfo. If apic is not mentioned in the flags, this
option can
remain deselected.
I think that the PIII CPUs don't support this option, unless they are
used in an SMP configuration.
That may well be true. However, at least according to the make
menuconfig option help, this should (and likely is in non-XBOX
configurations) a safe option to select, and the kernel should just
ignore it at run time when the CPU doesn't support the feature.

Depending on which precise version of the kernel source you have, it
basically says "when in doubt, select this option" because the kernel
will just ignore it if the CPU doesn't support the feature and will
run w/o slowdown if the option is selected.

However, something about the XBOX prevents the system from booting
when the option is selected. So ideally, either the option should not
be selectable if the XBOX subarchitecture is selected, or the code
needs to be fixed somehow, such that the option behaves as benignly
on an XBOX as it supposedly behaves on other PC platforms.

Unfortunately I know way too little about the linux kernel to attempt
fixing this.

Ronald
Ronald C.F. Antony
2007-03-02 18:59:48 UTC
Permalink
OK, my quest for fairly universal, modular kernel has been reasonably
successful.
I now have a 2.6.20.1 kernel working that has modular support for
just about anything one might want to run on an XBOX or use the XBOX
to do development work on.
Only actual hardware drivers have not been compiled into modules,
because there are so many, and some seem to result in an unbootable
kernel and if I wanted to try which, I'd still be running compile
cycles for the next three months. Most subsystems however seem to
work, e.g. if anyone wants to play with ATM, they can use the ATM
over ethernet module and know the basic infrastructure is in the
kernel. For some that's overkill, for me it's just an insurance that
I don't have to keep dealing with the kernel itself, except if
there's significant upgrade.

The two stumbling blocks I found are the APIC setting
( CONFIG_X86_UP_API ) as mentioned previously. It claims to be
harmless, but for some reason on the XBOX it is not.

The other is the fact that FATX seems to be dependent on NOT having
CONFIG_LBD set. Interestingly enough, though, having CONFIG_LSF set
doesn't seem to be a problem.
It seems odd, though, that a modular file system would depend on the
system's ability to deal with large volumes. Just because that file
system cannot address that large a volume shouldn't mean that the
rest of the system and other file systems should not be able to do
so. Even more curious: the FAT file system code, on which FATX is
based, does NOT have that restriction.

So do we REALLY need that restriction of not having CONFIG_LBD set?

Otherwise, if someone tells me where I can upload the source and
kernel rpms along with the patch and config file, then I'm pretty
much ready to share the results if anyone is interested.

Ronald
Ronald C.F. Antony
2007-03-03 18:21:56 UTC
Permalink
Subject says it all.

One question, though, that I don't get. In the kernel configuration's
"Processor type and features" section, the "Math emulation" help
Linux can emulate a math coprocessor (used for floating point
operations) if you don't have one. 486DX and Pentium processors
have a math coprocessor built in, 486SX and 386 do not, unless you
added a 487DX or 387, respectively. (The messages during boot time
can give you some hints here ["man dmesg"].) Everyone needs either
a coprocessor or this emulation.
If you don't have a math coprocessor, you need to say Y here; if
you say Y here even though you have a coprocessor, the coprocessor
will be used nevertheless. (This behavior can be changed with the
kernel command line option "no387", which comes handy if your
coprocessor is broken. Try "man bootparam" or see the documentation
of your boot loader (lilo or loadlin) about how to pass options to
the kernel at boot time.) This means that it is a good idea to say
Y here if you intend to use this kernel on different machines.
More information about the internals of the Linux math coprocessor
emulation can be found in <file:arch/i386/math-emu/README>.
If you are not sure, say Y; apart from resulting in a 66 KB
biggerkernel, it won't hurt.
Symbol: MATH_EMULATION [=y]
Prompt: Math emulation
Defined at arch/i386/Kconfig:676
-> Processor type and features
So if Linux automatically uses a math processor, if present, unless
told to do so otherwise, then why on the one hand does the arch/i386/
Makefile specify in the standard kernel the -msoft-float compiler
flag, and why do we bother removing it for the xbox if the standard
kernel decides it's important to have that option?

I mean, either the kernel does the right thing, even with this
option, and uses the coprocessor if present, or it doesn't. Somehow,
this seems somewhat contradictory to me.

I then googled on the subject, and found this here:

http://uwsg.iu.edu/hypermail/linux/kernel/0409.1/2266.html
Why this kernel is always compiled with the FP emulation for x86?
CFLAGS += -pipe -msoft-float
And it's hardcoded, it does not depend on CONFIG_MATH_EMULATION. So,
is this just a typo or not?
It catches bogus attempts to use floating point in the kernel by
making them error at link-time.
So does this mean the kernel is not supposed to use floating point at
all, and the -msoft-float forces the compiled to create references to
libraries, which then aren't linked and hence cause a link error to
catch this problem?

If so, shouldn't we stop patching this, and leave the -msoft-float
compiler flag where it is and reduce the size of the xbox-linux
kernel patch a bit?

Ronald
Ronald C.F. Antony
2007-03-04 12:25:45 UTC
Permalink
Post by Ronald C.F. Antony
So if Linux automatically uses a math processor, if present, unless
told to do so otherwise, then why on the one hand does the arch/
i386/Makefile specify in the standard kernel the -msoft-float
compiler flag, and why do we bother removing it for the xbox if the
standard kernel decides it's important to have that option?
I mean, either the kernel does the right thing, even with this
option, and uses the coprocessor if present, or it doesn't.
Somehow, this seems somewhat contradictory to me.
http://uwsg.iu.edu/hypermail/linux/kernel/0409.1/2266.html
Why this kernel is always compiled with the FP emulation for x86?
CFLAGS += -pipe -msoft-float
And it's hardcoded, it does not depend on CONFIG_MATH_EMULATION. So,
is this just a typo or not?
It catches bogus attempts to use floating point in the kernel by
making them error at link-time.
So does this mean the kernel is not supposed to use floating point
at all, and the -msoft-float forces the compiled to create
references to libraries, which then aren't linked and hence cause a
link error to catch this problem?
If so, shouldn't we stop patching this, and leave the -msoft-float
compiler flag where it is and reduce the size of the xbox-linux
kernel patch a bit?
To answer my own question:
a) the kernel isn't supposed to use floating point calculations
=> http://uwsg.iu.edu/hypermail/linux/kernel/0409.1/2534.html
Post by Ronald C.F. Antony
The problem is that the kernel can't use the FPU. I think this is
because its context is not saved on context switch (userland ->
kernel), so we'd end up messing up the FPU state, and userland
applications would get silly results for calculations with context
switches in between.
Thus we force gcc to use the library functions for floating point
arith, and since we don't link against gcc's lib, FPU users get a
fancy linker error.
If you want to use floating point arith inside the kernel, you're
probably wrong wanting it. If you really need it, you can
a) emulate it using fixed-point math on unsigned long or
b) manually save the FPU state, load your operations into it, operate,
get the results and restore the FPU state.
I have yet to see someone who really needs to do floating point maths
inside the kernel.
b) we DO use floating point in drivers/video/xbox/conexant.c

Now if all the other screen drivers can figure out the parameters w/o
floating point calcuations, why does the XBOX chip need such tricks?
First, all screen dimensions are integer in the first place. Second,
even things like clock rates, etc. can be made integer by getting the
proper unit e.g. 0.3 seconds are 300ms.

If the code were a bit more readable/documented, then I'd take it
upon myself to convert that into integer math, but given the
potential to fry screens and graphic chips with the wrong data in the
registers, that's not something I want to debug without having a
clear understanding of what is supposed to be going on. :)

The amount and kind of math done in floating point seems trivial, but
it's not clear to me what precision is required and what some of
these parameters mean, because fields in some structs are not
documented, etc.

Any takers for either explaining me the details or converting this to
integer math? It seems odd that for one such module we run afoul of
the rules.

Ronald
Jukka Aho
2008-04-17 00:04:07 UTC
Permalink
This post might be inappropriate. Click to display it.
Matthew A. Nicholson
2007-02-27 15:43:52 UTC
Permalink
Post by Ronald C.F. Antony
Hi,
I'm trying to apply the xpad.c patch posted on this list back in 5
October 2006 by Matt.
All the list archives seem to be web based, and I can't download a raw
patch file (or copy/paste in a useful way) the patch as displayed by the
various web interfaces and web archives of the list.
Also, why isn't a patch like this reflected in the current source or
available on the files list on sourceforge.
I'm currently in the process of trying to get a 2.6.21-rc1 kernel
running (2.6.20.1 is already working), but getting all the latest
patches into the code is a major PITA because they are not collected in
a central location from what I can tell.
Any hints/help appreciated.
Ronald
My patch only has stuff for the Xbox360 controller. I can update it if
you need to use it.
--
Matthew A. Nicholson
matt-land.com
Ronald C.F. Antony
2007-02-27 18:37:22 UTC
Permalink
Post by Matthew A. Nicholson
Post by Ronald C.F. Antony
Hi,
I'm trying to apply the xpad.c patch posted on this list back in 5
October 2006 by Matt.
All the list archives seem to be web based, and I can't download a
raw patch file (or copy/paste in a useful way) the patch as
displayed by the various web interfaces and web archives of the list.
Also, why isn't a patch like this reflected in the current source
or available on the files list on sourceforge.
I'm currently in the process of trying to get a 2.6.21-rc1 kernel
running (2.6.20.1 is already working), but getting all the latest
patches into the code is a major PITA because they are not
collected in a central location from what I can tell.
Any hints/help appreciated.
Ronald
My patch only has stuff for the Xbox360 controller. I can update
it if you need to use it.
Thanks for the offer. *RIGHT NOW* I don't need the Xbox 360
controller. So for myself it's not much of an issue, particularly
since I'm not a game player, but I hope to make my 2.6.20.1 patches
available once things work smoothly, so others can use it, too.

So the issue is much more how to get a definitive version of that
code, particularly since the xpad driver is also in the standard
Linux kernel distribution, so changes really should be pushed
upstream. The less patches we need to do an xbox kernel, and the more
we can push into the regular kernel sources, the better.

Maybe if you have the time, you could compare the state of affairs in
the 2.6.20.1 source tree, and what's on the xbox-linux sourceforge
site, add whatever may be missing from your patches and the xbox-
linux version into the official version, and propagate it to the
kernel maintainers. That way we can then hopefully just get
completely rid of a separately maintained xpad driver.

Greetings,

Ronald
Loading...