Rockbox Technical Forums

Rockbox Development => New Ports => Topic started by: BenBrown on October 28, 2013, 09:55:30 PM

Title: SDL app for "WinCE/PPC/Windows Mobile" with CEgcc toolchain Mingw32ce
Post by: BenBrown on October 28, 2013, 09:55:30 PM
A WinCE SDL app port of rockbox via CEgcc's mingw32ce.  Using arm-mingw32ce toolchain and sdl libraries for wince.  Gerrit #656 is where the port, the toolchain builds and the configure script works.  Next task is to get a wince SDL port into the tools, and see what happens when I issue 'make'.  The build arch is armv4 so it should run on most any Windows Mobile with an arm processor when it's done. 

http://creativepc.no-ip.org/projects/wince-rock/wiki/Wiki
Title: Re: SDL app for "WinCE/PPC/Windows Mobile" with mingw32ce toolchain
Post by: BenBrown on October 30, 2013, 02:37:47 PM
I have a few question about assembly function /arm/fft.S

First question: I'm cross compiling with mingw32ce, should I just try using gcc's built in function for "find-first-bit-set"  which is " __builtin_ffs"?
I'll probably try this.

Second question:  Or add an assembly instruction for armv4.
Might try however unlikely to succeed, but good excuse to learn assembly.

Wait this may be gcc related, working on installing 4.4.1
Title: Re: SDL app for "WinCE/PPC/Windows Mobile" with mingw32ce toolchain
Post by: saratoga on October 30, 2013, 02:39:49 PM
Initially I would simply use the c version of those routines.  Once the target it working, you can figure out which assembly you need.
Title: Re: SDL app for "WinCE/PPC/Windows Mobile" with mingw32ce toolchain
Post by: BenBrown on October 30, 2013, 03:21:20 PM
Thanks,  :D that was my first impression.  There is evidence that gcc 4.4.0 maybe to blame.  So, I'm off to rewrite the the build script to use 4.4.1 and see if this just goes away.
Title: Re: SDL app for "WinCE/PPC/Windows Mobile" with mingw32ce toolchain
Post by: saratoga on October 30, 2013, 07:40:52 PM
Have you been active in IRC?  My advice would be to talk to people there before diving too deep into the guts of rockbox. 
Title: Re: SDL app for "WinCE/PPC/Windows Mobile" with mingw32ce toolchain
Post by: BenBrown on October 30, 2013, 08:22:08 PM
Yeah, lately I have been on IRC everyday foolsh is my handle.

After some digging, turns out cegcc/mingw32ce doesn't come in a 4.4.1 flavor.  But it appears to be that all arch specific asm found in /firmware/asm/$arch has a generic function to go with it in /firmware/asm/.  I just have to discover how to set the proper flag in /firmware/asm/asm.make when it's called.

The learning, struggling to understand and getting frustrated at the code, before I make a discovery is part of the discovery.  If the developers handed over all the answers, yeah I would have a working port, but I wouldn't know anymore about it than I do now.  So, yeah if I get stuck for too long, be all means I'll readily ask.  But, I don't want to sound as if no one else is welcome to jump in and help out.  Also I don't expect to many to be interested in this, I admit it's not a very exciting target, and I don't imagine much needs to be done to get it to run.
Title: Re: SDL app for "WinCE/PPC/Windows Mobile" with CEgcc toolchain
Post by: gbl08ma on November 03, 2013, 02:35:56 PM
I have five (perhaps more) Windows Mobile devices laying around unused, one of them with superb audio quality, and I'm watching the progress of this very closely.
Windows Mobile is an "exciting target" because many of the devices powered by it don't have the horsepower to do certain tasks most smartphones do today, also the amount of software to choose from is reduced, but they can still play music perfectly - it's just that the music players aren't too good. Most WM phones also have removable storage in the form of SD or microSD cards, so in that aspect they are even more expandable than certain dedicated music players.

Tell me if you need help with testing. I'll try to build something out of the gerrit you posted.
Title: Re: SDL app for "WinCE/PPC/Windows Mobile" with CEgcc toolchain
Post by: BenBrown on November 03, 2013, 09:20:35 PM
Well I'm glad to hear that  8) I meant "not exciting" as in nitty gritty bare metal *ASM all the things* excitement!!  But there might be only a few who call that excitement, good thing they all hang out here  :P

Right now I'm trying to gain confidence in a few toolchain builds I worked up.  One does assembly just fine but chokes on some built in functions, the other build environment chokes on the assembly side and plows through built in functions.  I'm hoping to find a happy place between them.
Title: Re: SDL app for "WinCE/PPC/Windows Mobile" with CEgcc toolchain
Post by: gbl08ma on November 09, 2013, 06:55:13 AM
So it appears that what you're doing involves not only porting Rockbox, but first and foremost trying to fix ceGCC to a point where one can use it to compile Rockbox for WinCE?
I think that makes it more challenging than other RaaA ports, where SDKs (that integrated more or less well with GCC) were available and proven to work. Good luck :)
Title: Re: SDL app for "WinCE/PPC/Windows Mobile" with CEgcc toolchain Mingw32ce
Post by: LADave on May 04, 2015, 04:34:11 AM
Windows Mobile 5 and 6 smartphones are roadkill on the information highway, but that has advantages.  They are expendably cheap at around five bucks if you buy several at a time.  They also have attractive hardware: no-tool battery replacement, 1,000 to 2,000 mAh, removeable SD flash cards to 32GB, jacks for microphones as well as headphones, more screen real estate than many players, virtual and even physical QWERTY keyboards, 32M up to 128M RAM plus some built-in flash memory, still and video camera, and sometimes Bluetooth, GPS and WiFi.  For recording, the biggest shortcoming seems to be microphone equalization de-emphasizing frequencies outside voice range.  Can this be defeated?
Title: Re: SDL app for "WinCE/PPC/Windows Mobile" with CEgcc toolchain Mingw32ce
Post by: [Saint] on May 04, 2015, 09:34:05 PM
For what it's worth, I don't believe there is any such limit on the upper value of the size of an sdcard in Windows Mobile devices.

Such "limitations" are almost always the result of brain dead marketing.

It is incredibly rare to find devices that actually have an artificial (because it would be entirely artificial) limitation on how much storage it can address embedded in their firmware. Off the top of my head, I can only think of a few examples.

The whole "supports up to N GB sdcard" thing is usually just the highest capacity sdcard available at the time the product was launched. Unless they actually made an effort to specifically artificially limit the amount of storage these devices can address, it should be perfectly capable of addressing (even though such a card does not {and likely never will} exist) up to 2TB of storage, as the sd specification allows.


[Saint]
Title: Re: SDL app for "WinCE/PPC/Windows Mobile" with CEgcc toolchain Mingw32ce
Post by: gbl08ma on May 06, 2015, 08:55:54 AM
I can tell things are not as straightforward and there's definitely a limit on many Windows Mobile devices. One of my phones doesn't support SDHC or higher due to driver incompatibility (the hardware itself allows for it, as was discovered when Linux was ported to the thing). Another only supports SDHC with some driver patching or registry hacking (can't remember), and then you need to "fix" the hack for each kind of SD card (i.e., when it is in high-capacity mode it won't read older non-HC cards). Others support SDHC but not SDXC, which effectively yields the 32 GB limit, the highest a SDHC card can have.

Still this is a minor issue (I'd much prefer a 32 GB flash to a 4 GB one as found on many iPods...) and I keep hoping that some day, we'll see Rockbox running on WM. I wouldn't mind porting it myself, but the issue appears to be more of a toolchain one than anything else (no good GCC is available for WM) and I don't have patience for this sort of problems. The batteries on my WM devices are also dying one by one...