View Full Version : Mediagate MG-35 -- new firmware available
Pages :
1
2
3
4
5
6
7
[ 8]
9
10
11
12
13
14
15
16
17
EmuMannen 08-27-06, 02:31 PM I'd appreciate an experienced C coder having a read through. I don't write C. But I have just written 400+ lines of C that does heavy pointer wrangling to access the flash, and it could all do with a sanity check.
Ian, where can I find the source?
It's not clear to me which version of the firmware zand is discussing. But in my case, 3b shows up with a medium blue background in that popup window. You never see these dialog boxes at all unless you are using the DVD Wizard. This is activated by using the Select button on the video_ts.ifo file, not the Play button. (Playback of an mpeg program stream, or a VOB file played via Play button, cannot be resumed.)
No, sorry for my bad english. I have the firmware 3beta too, and when when I stop watching an avi file, then I choose to watch it again, a yellow message pop up and let me choose if I want to continue watching from where I left or see the avi from start. In that window the X, the V and the green dot have a black frame around.
gadgetmind 08-27-06, 05:41 PM Ian, where can I find the source?
I'll upload a copy tomorrow. I need to groom the comments and slightly neaten things up. It really needs a bit of a refactor, but as with all new languages, I'm writing stuff in Fortran. :)
Ian
TheKrell 08-27-06, 06:06 PM ...when I stop watching an avi file, then I choose to watch it again, a yellow message pop up and let me choose if I want to continue watching from where I left or see the avi from start.Really! I tried mpg files and VOB files and of course I used the DVD Wizard. Only the latter let me continue from the stop-point. [Edit: Well, I don't know what I was doing before, but as zand said, the Mediagate does keep in memory your stop-point for mpg, avi, and possibly other filetypes.] BTW - this info doesn't survive cycling the power...
P.S. Your English is very good; I just didn't see where you identified the firmware version at all. :)
teddystacker 08-27-06, 07:02 PM NewGui-3-144-eng - GUI V3.0 - My Report..
Function-wise - No problems at all - Seems to function exactly the same as GUI version 2 Firmware - ISO,AVI,MPG,Photo and MP3 playback all tested and work as previous..
GUI:
1)"File Info" - As already posted, txt on lefthand side now a Lighter green making the txt much easier to read - not quite there yet , maybe the yellow txt (as shows up on the right hand side of the dialogue) would be better,as its much easier to read..
2)"Stop and continue boxes" (Also applies to the fimware update Dialogue box) - Now MUCH better with the white txt on Blue (txt at the VERY top of the box is still yellow,maybe look better just white txt like the rest of the dialogue box) - looks real nice - only slight "bug" is the Light green box that appears as you switch from X to check mark - but to me this is no big deal,if the fix is too complex..
3) Subtitle Colours are way off - not of any concern to me,but i know many others reply on subtitles - also already reported.
4)Last thing for me is the Big Red X that appears on the main "Media Type" screen , nothing wrong with this , but I think it would look much better if this was changed back to the "Back and arrow" (as in the menu at the top of the file browser) , that was in the first ver of the gui - This is just a personal prefrence and again no big deal..
Have to admit these are my only criticisms,and again EmuMannen,truly great work here..
teddystacker 08-27-06, 08:36 PM Over at the Yahoo group , Lucas posted some photos of the New Gui firmware - these are only of Ver 1 of the Gui (it has undergone lots of improvement since then) but at least, it will give users some idea of what they wil see if they try out the new Gui firmware..
At a later date I will try and take some Hi Rez screen grabs..
Details here:
http://codenet.homedns.org/mg35
gadgetmind 08-28-06, 04:46 AM Attached is a new bb-package of busybox, lash, hush, and telnetd These are the same as before but with stack sizes at the default 4k Googling suggests that this should be OK for busybox. It works for me running them all stand-alone but I haven't yet built a .upgrade with them in.
I have also attached a release of mgnv with source code. This should be very safe for people to use in read mode to explore the .config. You can also try writing to some known areas, such as the LED on/off byte at decimal 172.
The 1st command will read the byte and the second prints the new value.
./mgnv b:172=1
./mgnv "%d" b:172
These do the same for the string at 316
./mgnv s:316="/test"
./mgnv "%s " s:316
I have done 100s of test writes to my box and all the other configuration has survived 100%. But don't try unaligned word writes (odd addresses) and don't write to any address in the .config if you don't know what's there.
We now need to start deciding what new config we need.
This command will dump your current config. The new busybox has hexdump, so you could dump your config this way and capture via the telnet terminal.
./mgnv -f /hosts/config%03d.bin
I guess I should grab pb's latest and greatest and add this new stuff in before making a .upgrade. But I'd like to try writing a script to replace nbtscan first as this will actually make use of the .config information.
Ian
gadgetmind 08-28-06, 05:07 AM OK, here's what I think our new nbtscan needs to do -
Use
mgnv "%s" s:252
to get the name of the NAS server. If this is loader.bin or a null string then call nbtscan as normal.
We then need to do a name lookup to get the IP.
("ping -c 1 name" and parse the result or do we need a busybox with nslookup built in?)
If this lookup fails, we fall-back on calling nbtscan as normal.
Then either -
1) Call nbtscan -q -b /net -e x.x.x.x with the new IP
2) Create the file /hosts/hosts containing "x.x.x.x name" and mkdir /hosts/name
The second is much faster!
The normal nbtscan command line is -
nbtscan -q -b /net -e 192.168.1.5/24
but with the IP address depending on the IP of the machine (we can just pass our whole command line to nbtscan.bin)
To enable a NAS server you will need to type -
mgnv s:252="name"
to disable, use an empty string. But if the NAS device isn't there, then the subnet will be scanned as normal.
Ian
EmuMannen 08-28-06, 06:07 AM 1)"File Info" - As already posted, txt on lefthand side now a Lighter green making the txt much easier to read - not quite there yet , maybe the yellow txt (as shows up on the right hand side of the dialogue) would be better,as its much easier to read..
2)"Stop and continue boxes" (Also applies to the fimware update Dialogue box) - Now MUCH better with the white txt on Blue (txt at the VERY top of the box is still yellow,maybe look better just white txt like the rest of the dialogue box) - looks real nice - only slight "bug" is the Light green box that appears as you switch from X to check mark - but to me this is no big deal,if the fix is too complex..
3) Subtitle Colours are way off - not of any concern to me,but i know many others reply on subtitles - also already reported.
4)Last thing for me is the Big Red X that appears on the main "Media Type" screen , nothing wrong with this , but I think it would look much better if this was changed back to the "Back and arrow" (as in the menu at the top of the file browser) , that was in the first ver of the gui - This is just a personal prefrence and again no big deal..
1. Have to make a map over all colors used. I can't just alter an individual color in one dialog without affecting all other places where the same index in the palette is used. What I need to do is to make a map of all colors used (what index, color and where they are used) and then try to find an acceptable schema.
2. Black box and now green box? Just wondering what index might be used for drawing that box (that I haven’t seen yet). Probably another index that needs to be mapped out. The rest in accordance with point #1 above.
3. Really need to get this index mapped out. Could someone try subtitles with MG35_color_hunt2 palette (should give us the answer).
4. Have to agree, will revert as soon as possible...
EmuMannen 08-28-06, 06:08 AM At a later date I will try and take some Hi Rez screen grabs..
Really helpful to me. I think I really need to upgrade myself to the custom firmware. Does it contain a new boot-loader or not?
gadgetmind 08-28-06, 06:24 AM Really helpful to me. I think I really need to upgrade myself to the custom firmware. Does it contain a new boot-loader or not?
I haven't looked at it, but ever since I risked trying one without a bootloader, I think all of pb's builds were sans loader and therefore very safe.
I must have now done 50+ reflashes, and probably 25+ recoveries via serial, and everything has gone very well. I'm now thinking that JTAG is simply something that we don't need.
What I'm really gagging for now is the ability to build our own kernels. That's when stuff can really start to happen.
And with setup doing as much as it does, I'm really not so sure that a dvdplayer.bin replacement is such a massively daunting task.
Ian
gadgetmind 08-28-06, 06:27 AM The only high-risk task I have left to do is to try and add flash sector erase to mgnv. But while we have dvdplayer.bin able to do the erase on the rare occasions that it's required, this might be a while off.
So, if anyone else had strong need of the development box, I can spare it. Being able to bang on it while others use my box is useful, but I guess many others are (or will soon be) in the same position.
Ian
tohands 08-28-06, 10:38 AM yeah I tried to install a cross-compiler (scratchbox) on my linux box, having problem with the scratchbox (ERROR: '/scratchbox/sbin/chroot-uid' is not suid ROOT.) I need to read more about that problem, but there is no documentation on the scratchbox website. If I could make that work, it will be a good way to cross compile arm stuff from my box.
gadgetmind 08-28-06, 10:43 AM So... how about it, patching the running dvdplayer process, in memory. Gutsy, but because there is no MMU it might just work. Might even be possible ito patch the in-memory dvdplayer image in the start-up "phase2" script for those who want to try a different scheme for a few days without re-flashing.
It could work! But I won't have time to try it until next weekend.
BTW, has anyone tried mounting a new bin over /bin during phase1? The HD will need mounting somewhere else, then a mount -o bin to overlay bin, but it should work. Or maybe mount the whole HD over /bin - this is just for development!
Ian
gadgetmind 08-28-06, 10:46 AM yeah I tried to install a cross-compiler (scratchbox) on my linux box, having problem with the scratchbox (ERROR: '/scratchbox/sbin/chroot-uid' is not suid ROOT.) I need to read more about that problem, but there is no documentation on the scratchbox website. If I could make that work, it will be a good way to cross compile arm stuff from my box.
I used scratchbox for a while for playing with the Nokia 770 but never really got to grips with it.
What is it you're trying to build? Stuff that uses autoconf can be a struggle. The kernel is pretty easy. Simple applications are also pretty easy. Out of tree kernel modules are no fun at all!
This afternoon, I tried and failed to build Python. Hey, I had to try!
Ian
andy666 08-28-06, 11:42 AM It could work! But I won't have time to try it until next weekend.
BTW, has anyone tried mounting a new bin over /bin during phase1? The HD will need mounting somewhere else, then a mount -o bin to overlay bin, but it should work. Or maybe mount the whole HD over /bin - this is just for development!
Ian
I've been playing with overlaying bin with a ram disk so I can modify stuff in bin.
e.g. in phase1...
cp -a /bin /phase1/bin/
mount -o bind /phase1/bin /bin
The intention being that I can then modify stuff in bin either during phase1/2 or after bootup - in particular I was thinking of having a config file for the colours stored on the local hd (probably in /init/config) and directly modifying dvdplayer.bin before it starts. Should be fairly trivial once I can get a cross compiler working.
For simplicity I was going to use a windows style ini file e.g.
[pallette]
colour000=#00000
colour036=#ff8080
(etc)
That way individual colours can be changed without creating a whole new pallete.
Of course I'm assuming that dvdplayer.bin isn't launched until after the phase1 script has completed.
By the way - like a previous poster I'm not having any success with smbmount.
There's a share on my laptop called Shared (good huh?) that mounts fine through the gui, but I can't seem to mount it with smbmount.
/> mkdir /net/shared
/> chmod 777 /net/shared
/> smbmount //192.168.2.2/Shared /net/shared rw
session request to 192.168.2.2 failed
tree connect failed: ERRDOS - ERRnoaccess (Access denied.)
SMB connection failed
pid 31: failed 256
/>
I've made sure Guest (and indeed Everyone) has read/write (and indeed Full Control) access to both the share and the directories, tried using rw instead of ro, dabbled with -o username=andy,password=password - all to no avail...
tohands 08-28-06, 11:42 AM I'm not sure what I'm trying to build, but more tool I have, better it is.
icabrindus 08-28-06, 01:00 PM Of course I'm assuming that dvdplayer.bin isn't launched until after the phase1 script has completed.
phase1 is executed (if it exists) before calling dvdplayer. Take a look in /etc/sashrc.
You can even skip the rest of the sashrc script by not returning from phase1. In this case, you should probably call dvdplayer in your phase1 script.
I've made sure Guest (and indeed Everyone) has read/write (and indeed Full Control) access to both the share and the directories, tried using rw instead of ro, dabbled with -o username=andy,password=password - all to no avail...
Do you have WinXP on your server?
I had the same issue. Tried fiddling with Local Policies settings on my Win XP server, but couldn't find a solution. I found a reference of XP using by default NTLMv2 instead of NTLM (as previous versions) but didn't find how to change that.
So I backed up and I'm using a local CompactFlash card connected to the IDE of the MG-35.
But if you find a solution, please share it with us :-)
gadgetmind 08-28-06, 01:00 PM directly modifying dvdplayer.bin before it starts. Should be fairly trivial once I can get a cross compiler working.
Dunno if it helps, but on the wiki development page I gave a link to the arm-elf-gcc toolkit. Download the .SH file, run as root, and the toolkit is installed. Having build-essential and autoconf installed first is probably best.
You can then download my mgnv.c and try building it. The build command line is given in the comments at the top of the source.
I've made sure Guest (and indeed Everyone) has read/write (and indeed Full Control) access to both the share and the directories, tried using rw instead of ro, dabbled with -o username=andy,password=password - all to no avail...
I can mount using smbmount without username/password but I did have to get smb.conf right - the correct setup was posted earlier in this thread. Let me know
if you can't find it and I'll quote the relevant bits.
(later)
It's post 925 on page 31
Here - http://www.avsforum.com/avs-vb/showthread.php?p=8026382&&#post8026382
Ian
andy666 08-28-06, 01:55 PM I've tried mounting a ramdisk over /bin in a phase1 script, but it doesn't seem to work.
I created the following script called phase1 in the init folder of the HD...
#!/bin/sh
#
# Copy bin folder to convenient ramdisk
cp -a /bin /phase2/
# Mount the "new writeable" bin folder over the readonly one
mount -o bind /phase2/bin /bin
# Copy a readme file into the bin folder so we can see it's worked
cp /cdrom/init/README /bin/
After booting the mg35 it appears that copying the bin folder has worked, there is now a bin folder in /phase2, but the mount has failed (nothing shows up in the mount list) and hence the README file hasn't been successfully copied. I think this implies that the mount failed, rather than being unmounted somewhere, otherwise README would exist in /phase2/bin.
If I run the script directly - i.e. sh /cdrom/init/phase1 - everything works as expected
gadgetmind 08-28-06, 02:10 PM I've written a trivial program that grabs the top 512kB of RAM into a file. I can provide the utility and a sample file to anyone who fancies trying to extract the bitmap from it. If you're up to it, let me know if you want the C source (trivial!), the executable, the binary (attached just in case), or a hexdump of the binary.
The sample I grabbed was when the player was at the initial HD or network choice screen with standard GUI.
If someone can reverse engineer where things are, then we can probably write a good screen grabber to make GUI work easier.
Ian
gadgetmind 08-28-06, 02:22 PM I think this implies that the mount failed, rather than being unmounted somewhere, otherwise README would exist in /phase2/bin.
I have a vague memory that mount failed when I'd booted but not run dvdplayer.bin because /proc wasn't mounted. You could maybe try redirecting stderr from the mount command into a file in phase2
BTW, sash creates the initial PATH, but I'm not sure if it does this when run as init. Remember that lash now runs sashrc! I'd be happier with /bin/ before each command, but your cp worked so I guess the PATH is OK.
Ian
andy666 08-28-06, 03:19 PM Do redirects work now in the "standard" shell - I tried mount (blah blah) 2>/phase2/phase1.log from the command line and it didn't like it at all! I haven't had chance to upgrade to the very latest (v3 graphics) firmware version yet though - my wife won't let me do it until we've watched the very last ep of Deadwood!
Assuming mount is actually being found in the PATH, or lack of PATH, I'm guessing it's failing because the folder is "busy" - if redirects work I'll try to do a ps before the mount to see what's happening.
icabrindus 08-28-06, 03:41 PM After booting the mg35 it appears that copying the bin folder has worked, there is now a bin folder in /phase2, but the mount has failed (nothing shows up in the mount list) and hence the README file hasn't been successfully copied. I think this implies that the mount failed, rather than being unmounted somewhere, otherwise README would exist in /phase2/bin.
I couldn't even get the list of mounts in phase1, using "/bin/mount" with no params, and redirected to a file. This is strange, since mount was surely able to create the ramdisk...
I also noticed that /phase2/phase2 script also failed to execute on firmware b2, but I didn't have the time to look further.
icabrindus 08-28-06, 03:47 PM Do redirects work now in the "standard" shell - I tried mount (blah blah) 2>/phase2/phase1.log from the command line and it didn't like it at all! I haven't had chance to upgrade to the very latest (v3 graphics) firmware version yet though - my wife won't let me do it until we've watched the very last ep of Deadwood!
To get redirection working from phase1 script, add the commands in a separate script, e.g. second_script, and run it with
lash second_script
The commands in second_script will execute under lash, where redirection works.
EmuMannen 08-28-06, 03:54 PM This afternoon, I tried and failed to build Python. Hey, I had to try!
Nice try, I guess you already visited this page... (http://www.vanille-media.de/site/index.php/projects/python-for-arm-linux/)
gadgetmind 08-28-06, 05:00 PM To get redirection working from phase1 script, add the commands in a separate script, e.g. second_script, and run it with
lash second_script
The commands in second_script will execute under lash, where redirection works.
The sashrc I saw in the latest pb firmware specified /bin/lash in the #! at the start. And any script it invokes can do the same.
Without a #!, I guess /bin/sh will be used, which is currently sash. I've now sussed how to ditch sash and use lash for everything, so we should have redirect everywhere soon.
Note that I've also been active on the BusyBox list. My fix to telnetd should not be required as the bug is in lash. Once lash is fixed (this week?) I can revert the telnetd changes and we should have control-c working again.
Ian
gadgetmind 08-28-06, 05:03 PM Nice try, I guess you already visited this page... (http://www.vanille-media.de/site/index.php/projects/python-for-arm-linux/)
Yes, and I tried a few bits from the other Zaurus stuff, but basically I didn't really know what I was doing. Python is a hairy build at the best of times and I was starting from a slightly hacked uClinux-dist version, which didn't even build with the default options!
Ian
icabrindus 08-29-06, 12:33 AM Without a #!, I guess /bin/sh will be used, which is currently sash. I've now sussed how to ditch sash and use lash for everything, so we should have recirect everywhere soon.
You were right, the script was invoking sash instead of lash.
I finally found how to execute mount in the phase1/phase2 script. It will not work unless you first mount proc to /proc. Gadgetmind already saw this, but I overlooked his post. The misleading thing was that echo worked, but mount and ps didn't.
Also, as a suggestion for the future builds, we should probably call ". /cdrom/phase1" and ". /phase2/phase2" in sashrc script (note the dot followed by space), so we can pass environment variables from phase1 to phase2 script. A good example would be to add something to the PATH.
cooltoyz 08-29-06, 01:29 AM Hi all, I just got the MG-35 today. Able to format the hdd & copy several avi files & vob files onto the hdd. When pluggin to the pc, I can see all those files & able to play them with Media Player. However, when pluggin to the tv, I am getting "No files" when trying to play movie. Please help!
The firmware is 1.4.4. Thanks!
gadgetmind 08-29-06, 03:14 AM It will not work unless you first mount proc to /proc. Gadgetmind already saw this, but I overlooked his post. The misleading thing was that echo worked, but mount and ps didn't.
I wonder how/why the mount works in sashrc? Do some mounts need proc but others don't?
Also, as a suggestion for the future builds, we should probably call ". /cdrom/phase1" and ". /phase2/phase2" in sashrc script (note the dot followed by space), so we can pass environment variables from phase1 to phase2 script. A good example would be to add something to the PATH.
Hmmm, I'm going to have to look up what the dot does.
PATH is interesting. pb's sashrc has setenv near the end. Does this do any good? I'd have thought that the path needed to be set before the various others scripts and programs are run? Also, sash sets a default path, which is how the stock firmware works. But we're now only running sash as init and I'm not sure if it sets the path. This is why my sashrc has export near the top. But pb's doesn't, and it works, so I guess that the "init sash" creates the default PATH that everything inherits. If so, we can strip both export and setenv from sashrc.
Ian
ihateu3 08-29-06, 03:23 AM hey guys, still following your work, GOOD JOB! I also have a question about networking. I have connected my mg-35 through an xbox wireless gate. I am running windows xp pro, and i am able to ftp into the box using flashFXP under anonymous user on port 21, but i am unable too delete or send any files (hdd formatted in ntfs). What am i doing wrong?
many thanx
gadgetmind 08-29-06, 03:29 AM i am able to ftp into the box using flashFXP under anonymous user on port 21, but i am unable too delete or send any files (hdd formatted in ntfs). What am i doing wrong?
Other than being a little impatient, and not having read all 60 pages of this thread, you're doing nothing wrong. :)
The NTFS filing system on the HD is read-only. You can write to it via USB as in this case the Prolific chip lets the PC directly access the HD rather than it going via the MG-35's firmware.
There are two possible solutions.
1) Build a new kernel that has a RW NTFS filing system or the ability to let us insmod fuse and then use NTFS-3G. This is looking like hard work!
2) Build a new kernel with ext2/3 built-in. This is pretty easy once we get the kernel source. If we don't get this source, we're going to have to reverse engineer some of Al Teks code in the kernel.
Another solution is to fat32 format the HD and then use the phase 1/2 stuff to remount the hd as rw.
Has anyone done this already and have the scripts available for upload? I guess many people could handle the 2G file size limit.
Ian
ihateu3 08-29-06, 03:56 AM thanx for the quick reply, i have read all the pages...been reading this thread b4 pbarrette even came along (hoping some1 would hack this box)...its just i am an idiot and get lost sometimes reading your rocket scientist posts :) Sorry i thought that somewhere you guys had gotten ntfs too work.
wish i could help somehow. But i gave in too the seduction of xbox media center. I am still holding on too my mg-35 because it has great potential (and i want too love it) But for now it acts as a permanent external hdd for my xbox to read movies off of...and on good days, i put the mg-35 in the car since the xbox is too big.
With the great strides that you guys have accomplished...i am hoping my mg-35 will make its way back into my living room!
gadgetmind 08-29-06, 04:05 AM thanx for the quick reply, i have read all the pages...been reading this thread b4 pbarrette even came along (hoping some1 would hack this box)...its just i am an idiot and get lost sometimes
You're not the only one! But a few people are diligently snipping out relevant bits and putting them on the wiki.
wish i could help somehow. But i gave in too the seduction of xbox media center.
I've got close to that at times, but it's not as quiet and not as remote control friendly.
Ian
Kudos on the great work sofar guys. I still have trouble playing .avi and .mpg files from the network though.
My unit is a Freecom Network Media Player running the NewGui-3beta-144-eng.upgrade firmware. I can play the files when they're on the internal hdd, but when run from a network share, the .avi files report an error on the audio/video codec, the .mpg file seems to start loading but the unit hangs. Have to power off/on to get it going. Any ideas? :rolleyes:
gadgetmind 08-29-06, 06:31 AM Also, as a suggestion for the future builds, we should probably call ". /cdrom/phase1" and ". /phase2/phase2" in sashrc script (note the dot followed by space), so we can pass environment variables from phase1 to phase2 script. A good example would be to add something to the PATH.
Does this work in lash? Please can someone confirm?
If not, I can try using hush as the shell that runs sashrc and make a new release.
Ian
Kudos on the great work sofar guys. I stille have trouble playing .avi and .mpg files from the network though.
My unit is a Freecom Network Media Player running the NewGui-3beta-144-eng.upgrade firmware. I can play the files when they're on the internal hdd, but when run from a network share, the .avi files report an error on the audio/video codec, the .mpg file seems to start loading but the unit hangs. Have to power off/on to get it going. Any ideas? :rolleyes:It sounds as if you are dropping packets on your network, resulting in the MG-35 getting incomplete and corrupted files.
You might try a different cable first, and if that does not help, a different router/switch. Of course, this assumes your server can serve the files. If you have a second PC on your lan you might copy one of the larger files to it from your server and then back again and compare it to the original. I had one PC here where I could not back it up to a second PC. It turned out to be a network card driver.
Joe L.
It sounds as if you are dropping packets on your network, resulting in the MG-35 getting incomplete and corrupted files.
You might try a different cable first, and if that does not help, a different router/switch. Of course, this assumes your server can serve the files. If you have a second PC on your lan you might copy one of the larger files to it from your server and then back again and compare it to the original. I had one PC here where I could not back it up to a second PC. It turned out to be a network card driver.
Joe L.
I don't think the network is the problem as the unit plays ISO's (DVD) and large MP3 files over the same link without a glitch :) Thanx for the quick reply though
Another question: Can someone tell me how to determine the length of linux.gz in the .update file. I started on building a splitter, but am not sure where linux.gz ends, en cramfs.img begins :(
Thank you for a great job
apart from the mg-35 I also have a mediamvp This gadget is also build on ulinux and it could serve as a slimserver client Would it be possible to do the same thing with the mediagate (slim server client)?
see mvpmc sourceforge net for more information
icabrindus 08-29-06, 07:49 AM I wonder how/why the mount works in sashrc? Do some mounts need proc but others don't?
Thinking a little more, it could be that it works all the time. What I tried was
mount >/phase2/phase1/log
ps >>/phase2/phase1/log
Since I had no output in the log, I presumed mount and ps are not found/not working. But maybe they work, and just need /proc to gather the information to print. In fact it's sure they work since /cdrom and /phase were already mounted.
Hmmm, I'm going to have to look up what the dot does.
It executes the script in the parent's memory space, so the parent "inherits" the effect of the child's command. When you execute it normally(without the dot), if you set the path in the child script, those changes are lost when you return to the parent.
PATH is interesting. pb's sashrc has setenv near the end. Does this do any good? I'd have thought that the path needed to be set before the various others scripts and programs are run? Also, sash sets a default path, which is how the stock firmware works. But we're now only running sash as init and I'm not sure if it sets the path. This is why my sashrc has export near the top. But pb's doesn't, and it works, so I guess that the "init sash" creates the default PATH that everything inherits. If so, we can strip both export and setenv from sashrc.
PATH is already set before running phase1. Also, lash lacks setenv/printenv, so the line in sashrc does nothing (at least in firmware v3). Can we add a form of "set" or "printenv" to lash? We have "export" to set a variable, but we cannot print all of them.
I don't think the network is the problem as the unit plays ISO's (DVD) and large MP3 files over the same link without a glitch :) You didn't include that info in your original post. :( I don't have a clue what might be the cause if those exact same files play from the internal HD.
Of course, the codecs for .ISO and mp3 may be able to handle corrupted/incomplete data streams better than thhose for .avi or .mpg, so it still could be the network as I described.
Joe L.
icabrindus 08-29-06, 08:01 AM Does this work in lash? Please can someone confirm?
If not, I can try using hush as the shell that runs sashrc and make a new release.
Hi, Ian!
I tested and it seems to work, but it's always better to check again. Just create a my_test script :
#!/bin/lash
export MY_TEST=test
Then run the following commands:
./my_test
echo "executed normally: $MY_TEST"
. ./my_test
echo "executed with dot: $MY_TEST"
On the second call, you will see the variable vas preserved. This works on lash, but I remember it failing in sashrc.
gadgetmind 08-29-06, 08:53 AM But maybe they work, and just need /proc to gather the information to print. In fact it's sure they work since /cdrom and /phase were already mounted.
Yup, no proc causes lots of failures.
It executes the script in the parent's memory space, so the parent "inherits" the effect of the child's command. When you execute it normally(without the dot), if you set the path in the child script, those changes are lost when you return to the parent.
Interesting, thanks.
PATH is already set before running phase1. Also, lash lacks setenv/printenv, so the line in sashrc does nothing (at least in firmware v3). Can we add a form of "set" or "printenv" to lash? We have "export" to set a variable, but we cannot print all of them.
OK, so it looks like init is setting our path. This makes things easier.
In lash, export with no arguments prints all variables.
Ian
gadgetmind 08-29-06, 08:57 AM On the second call, you will see the variable vas preserved. This works on lash, but I remember it failing in sashrc.
sashrc used to be run with /bin/sh, which was sash. Good news that lash supports this.
I'm currently putting a new firmware .upgrade together that's very like the NewGuie 3 Beta but with a new BusyBox, lash and telnetd and with sash removed. (But used as init) The sashrc will also have the setenv/export removed and the dots added for the environment stuff.
I'll also include hush and mgnv and I'll remove mg35config. I'll be able to test network operation but not the phase 1/2 stuff and use of a HD.
Tonight, maybe. Lots to do.
Ian
EmuMannen 08-29-06, 09:06 AM Just a reminder, still need someone to run a firmware with the MG35_color_hunt_2.act palette and report back the color of subtitles with that palette (needed to be able to update current color scheme).
Thanks in advance / Rob :)
andy666 08-29-06, 09:09 AM One quick request - if you're building a new busybox can we have sed and grep?
This should make it relatively easy to write a phase2 script that will look for vfat mounts (they are mounted by dvdplayer.bin aren't they? I haven't got access to my mg35 from here) and unmount then remount them readwrite. (thinking about it, this won't work if dvdplayer.bin is run as a background task - with & - as we won't know if it's finished the mounts - but it's worth a try. I don't think it's a good idea hard coding the device names as we can't be sure what device the vfat partition on a multi-partition disk would be.
Should be something like...
mount | grep "vfat" | sed -e 's/stuff/new stuff/' > remount.sh
chmod +x remount.sh && remount.sh
gadgetmind 08-29-06, 09:13 AM Just a reminder, still need someone to run a firmware with the MG35_color_hunt_2.act palette and report back the color of subtitles with that palette (needed to be able to update current color scheme).
I can build some new firmware but am pretty snowed under right now.
Or it's dead easy for me to patch dvdplayer.bin so that someone who's got phase 1/2 mounting something over .bin can easily do the test.
Ian
gadgetmind 08-29-06, 09:18 AM One quick request - if you're building a new busybox can we have sed and grep?
OK, will do, these should be easy enough.
Ian
gadgetmind 08-29-06, 09:53 AM I don't think it's a good idea hard coding the device names as we can't be sure what device the vfat partition on a multi-partition disk would be.
As this stuff is on hard disk, it's barely hard coded, but I guess it's better if we can extract this stuff automatically. But note that /proc will need to be mounted to get the list of mounts.
Also note that sashrc only tries -
mount -t vfat /dev/discs/disc0/part1 /cdrom -o ro,fmask=0000
mount -t ntfs /dev/discs/disc0/part1 /cdrom -o ro,fmask=0000
as hard disk mounts. We can add to this list, but it might be time for some NV stuff.
Should I change sashrc in the new firmware to mount /proc and then umount it before calling /bin/dvdplayer.bin?
Ian
icabrindus 08-29-06, 09:55 AM I'll also include hush and mgnv and I'll remove mg35config. I'll be able to test network operation but not the phase 1/2 stuff and use of a HD.
Also a reminder, please replace /cdrom/init/phase1 with /cdrom/zz_devel/phase1, so that our development is the last in the TV list.
I can test the phase1/phase2 stuff.
gadgetmind 08-29-06, 10:00 AM Also a reminder, please replace /cdrom/init/phase1 with /cdrom/zz_devel/phase1, so that our development is the last in the TV list.
I can test the phase1/phase2 stuff.
Does everyone agree on this? Wasn't there talk of .init or did that still get displayed?
Anyway, I'll build the new firmware tonight, test playing divx and iso from the network and also test the telnet stuff a bit. I'll also test that I can reflash via the network back to earlier firmware.
Should I put a dvdplayer.bin patched with the new palette in with the zip? I guess you can use the phase stuff to test this for subtitle colours?
Ian
icabrindus 08-29-06, 10:38 AM Does everyone agree on this? Wasn't there talk of .init or did that still get displayed?
.init is still displayed, so this zz_devel stuff is a temporary solution until we figure a better one. Somebody reported an invisible Recycler folder, but I couldn't find how to hide it since I don't have a real hdd in my MG35.
Some time in the future we should also try to move the players from / to /bin (as we did for dvdplayer), to try the KiSS players which can handle streaming media.
icabrindus 08-29-06, 10:41 AM Should I change sashrc in the new firmware to mount /proc and then umount it before calling /bin/dvdplayer.bin?
I think we better handle that in phase1 script, since it works that way. Also, keeping sashrc as small as possible for regular users is a good thing.
gadgetmind 08-29-06, 10:44 AM .init is still displayed, so this zz_devel stuff is a temporary solution until we figure a better one. Somebody reported an invisible Recycler folder, but I couldn't find how to hide it since I don't have a real hdd in my MG35.
The final solution is it all goes onto the flash with NV config for the tweaks that people want.
Some time in the future we should also try to move the players from / to /bin (as we did for dvdplayer), to try the KiSS players which can handle streaming media.
Dead easy - we just need to drop in soft links. But I guess there's no hurry.
Anyway. can't the phase 1 stuff just chroot to a HD directory and replace the whole flash with stuff on HD?
Ian
icabrindus 08-29-06, 10:44 AM Just a thought, is it possible to build a loadable module to handle ext2fs partitions?
gadgetmind 08-29-06, 10:46 AM I don't have a real hdd in my MG35.
What do you have in there?
Ian
gadgetmind 08-29-06, 10:48 AM Just a thought, is it possible to build a loadable module to handle ext2fs partitions?
I tried. The kernel doesn't export the required symbols. Dead easy with a kernel rebuild. Funny how we keep coming back to this! :(
Ian
animatt 08-29-06, 11:06 AM I believe icabrindus said he had a small compactflash card in there which is nice since no noise but little bit unsupported because it is smaller than the 6gb min. that seems to serve no purpose(the min.)
gadgetmind 08-29-06, 11:08 AM I believe icabrindus said he had a small compactflash card in there which is nice since no noise but little bit unsupported because it is smaller than the 6gb min. that seems to serve no purpose(the min.)
I tried a small CF in an adaptor but it didn't work - loads of read errors in dmesg output. Maybe a duff card - will try another.
Ian
TheKrell 08-29-06, 11:22 AM Some time in the future we should also try to move the players from / to /bin (as we did for dvdplayer), to try the KiSS players which can handle streaming media. A most excellent idea! My family's use of our Mediagate would really take off if I could replace Al Tech's mpegplayer with an image that actually played DD sound...
icabrindus 08-29-06, 11:25 AM I tried a small CF in an adaptor but it didn't work - loads of read errors in dmesg output. Maybe a duff card - will try another.
It surely works for me... it's an ancient 16MB CF. I didn't check the dmesg for errors, though :)
I didn't know about chroot, this is a really good one! Can you build a busybox with chroot? In fact, a full busybox with everything inside would be great for development. We will load it only from the hdd/net, so it doesn't need to be in the cramfs.
icabrindus 08-29-06, 11:28 AM I believe icabrindus said he had a small compactflash card in there which is nice since no noise but little bit unsupported because it is smaller than the 6gb min. that seems to serve no purpose(the min.)
I think you cannot access a small drive via NDAS and USB. Never tested this thoroughly... I use ftp for transfers.
tohands 08-29-06, 11:47 AM .init is still displayed, so this zz_devel stuff is a temporary solution until we figure a better one. Somebody reported an invisible Recycler folder, but I couldn't find how to hide it since I don't have a real hdd in my MG35.
Some time in the future we should also try to move the players from / to /bin (as we did for dvdplayer), to try the KiSS players which can handle streaming media.
I already tried the same way than the Recycler, but it doesnt work, so I really think Recycler is hardcoded to be hidden (Like the System Information) into the binary. (The folder RECYCLER have the desktop.ini like windows does with the temporated internet file, but I tried to make the same thing on another folder and it doesnt work, also tried to attrib +S the folder)
codenix 08-29-06, 11:59 AM Over at the Yahoo group , Lucas posted some photos of the New Gui firmware - these are only of Ver 1 of the Gui (it has undergone lots of improvement since then) but at least, it will give users some idea of what they wil see if they try out the new Gui firmware..
At a later date I will try and take some Hi Rez screen grabs..
Hi folks. As I've said on the Yahoo group, thanks so much for all that your'e doing to improve the MediaGate. My wife just doesn't understand my newest addiction, which is reading this forum!
I've updated the album (URL shown in Teddystacker's post #1756) with photos of the Version 3 GUI by EmuMannen. Feel free to visit to check it out if you haven't flashed your own MediaGate with the latest ROM.
Lucas.
gadgetmind 08-29-06, 11:59 AM It surely works for me... it's an ancient 16MB CF. I didn't check the dmesg for errors, though :)
Mine is 8MB. Guess I'll have to buy a new one!
I didn't know about chroot, this is a really good one! Can you build a busybox with chroot? In fact, a full busybox with everything inside would be great for development. We will load it only from the hdd/net, so it doesn't need to be in the cramfs.
chroot attached. This is *just* chroot for testing porpoises.
I'm no great chroot expert but I think that you'll need to mount the ramfs dirs again and also never exit from phase 1 (the chroot is only for your current process) and therefore call dvdplayer, telnetd and ftpd yourself. The remount of cdrom that dvdplayer does should be fine as it'll be a new mount in the chroot.
Good luck!
Yes, I can make a big fat BusyBox for use off HD, and the on-flash BusyBox can go on a diet. It's just a matter of deciding what we do/don't need in each one. There are a *lot* of options - hundreds!
Ian
andy666 08-29-06, 12:02 PM I've got to admit I prefer the name init - partly because I've already explained to the Mrs what it is, and to explain why it's now called zz_whatever would take most of an evening! :D
(and init appears last in my folder list anyway as Windows firstuppers folder names by default)
Also, what's the exact command line to mount proc? (back in my SCO Unix days there was no such thing!) Is it defined in fstab (ie we can just mount /proc)? I know I could try it myself but this way the question should be answered by the time I get home from work. :D
icabrindus 08-29-06, 12:30 PM Also, what's the exact command line to mount proc? (back in my SCO Unix days there was no such thing!) Is it defined in fstab (ie we can just mount /proc)? I know I could try it myself but this way the question should be answered by the time I get home from work. :D
Try this:
/bin/mount -t proc proc /proc
teddystacker 08-29-06, 12:41 PM I've updated the album (URL shown in Teddystacker's post #1756) with photos of the Version 3 GUI by EmuMannen. Feel free to visit to check it out if you haven't flashed your own MediaGate with the latest ROM.
Lucas.
Welcome Lucas , and thanks very much for the updated pics ....
tohands 08-29-06, 01:42 PM I was thinking about the .init folder we want to hide, I put a file in the folder RECYCLER since the first time we talk about that, and the file is still there, what about we use RECYCLER instead of .init ? RECYCLER is already hidden from the menu (but I can see it with USB and NDAS and the sash shell (/cdrom/RECYCLER/ (IN CAPS)).
I was thinking about the .init folder we want to hide, I put a file in the folder RECYCLER since the first time we talk about that, and the file is still there, what about we use RECYCLER instead of .init ? RECYCLER is already hidden from the menu (but I can see it with USB and NDAS and the sash shell (/cdrom/RECYCLER/ (IN CAPS)).That will certainly do until we get a real NTFS driver and go to "empty the wastebasket"
Joe L.
icabrindus 08-29-06, 01:56 PM I was thinking about the .init folder we want to hide, I put a file in the folder RECYCLER since the first time we talk about that, and the file is still there, what about we use RECYCLER instead of .init ? RECYCLER is already hidden from the menu (but I can see it with USB and NDAS and the sash shell (/cdrom/RECYCLER/ (IN CAPS)).
"RECYCLER" and "Recycled" strings are both present in dvdplayer, so maybe it filters them out since they are the FAT/NTFS way of storing the Recycle bin. Never thought the caitalization could matter, but it probably does. Any of them it's OK with me. But if you choose "Empty recycle bin" while the MG35 is connected via USB/NDAS, you can lose your files... Can you test this?
tohands 08-29-06, 02:00 PM "RECYCLER" and "Recycled" strings are both present in dvdplayer, so maybe it filters them out. Any of them it's OK with me. But if you choose "Empty recycle bin" while the MG35 is connected via USB/NDAS, you can lose your files...
By what I have on mine, I can't Empty recycle bin on the RECYCLER, I need to go into that and use the
S-1-5-21-1229272821-1123561945-725345543-500
and
S-1-5-21-861567501-1770027372-839522115-500
folders
so I really think (by what I see) that the RECYCLER is safe, if someone can do an Empty Recycle BIN on the RECYCLER, you can delete desktop.ini from the RECYCLER and you will not able to do that again (But mine, by default there is no desktop.ini in the RECYCLER).
The desktop.ini is the key to make a folder able to do an Empty Recycle Bin, you can try it yourself, do a folder anywhere, create desktop.ini, put this in the ini
[.ShellClassInfo]
CLSID={645FF040-5081-101B-9F08-00AA002F954E}
If you want to modify back the desktop.ini after you do that, use MS-DOS with "edit desktop.ini" and remove back those line (or you can just remove the .ini)
tohands 08-29-06, 02:18 PM I also create the Recycled folder myself and its not showing in the menu.
ronmilner 08-29-06, 02:25 PM First I would like to thank all of you for your hard work on the firmware. Somthing I would like to see and I know it would be way off in the future. I would like to see Album cover and DVD cover I know it may not even be possible but if it could progress that far that would be great.
gadgetmind 08-29-06, 02:33 PM As I don't have a HD fitted, I couldn't give a flying fiddlestick what the subdir is called. You guys fight it out between you and I'll build the .upgrade. :)
Or I could just try and run phase 1 from a wide variety of places - gimme the list!
Anyway, new firmware now on Yahoo. Changes are given below. hush seems to be working well, so your scripts can be more fancy. (see /bin/ll for a trivial example!)
Tested with network ISO/divx/reflash but nothing off HD and no phase 1/2
Ian
---------------------
The MG-35 Firmware update procedure intsructions are at the end of
this file.
Note that all .upgrades released in this series will be
"bootloader free" This means that a failure during reflash will
not erase your bootloader so serial recovery is possible.
Edit: August 29th 2006 - NewGui-3a-144-eng.upgrade
Built by Gadgetmind
Same as NewGui-2b-144-eng.upgrade but with the following changes.
lash is now linked from /bin/sh (and rebuilt to cope with this!)
hush has been added to /bin for use in shells
mgnv has been added to /bin - run without arguments for help
telnetd has a fix so it can directly invoke lash (actually needs fixing in lash)
busybox has had sed and grep added
All busybox based executables (busybox, lash, hush, telnetd) now have 4kB stacks
ll is now a script in /bin
A few soft links in /bin slightly changed to add /bin to the path (any difference?)
sashrc has the following changes -
Phase 1 directory is now zz_devel
Phase 1 and 2 are invoked with a dot before them so they can change environment
All path setting removed as init handles it
#! changed to /bin/sh as this is now lash
Invoke of dvdplayer.bin in root removed (edit scar? deliberate?)
gadgetmind 08-29-06, 02:42 PM Anyone got any strong views about where /bin/sh should point? It used to be sash, in my new firmware it's lash (and telnetd and sashrc just refer to /bin/sh) but there might be an argument for it being hush.
Thoughts?
My view is that we leave it as it is. Simple stuff will use lash and scripts that need more bourne grammar use #!/bin/hush
Ian
gadgetmind 08-29-06, 02:46 PM BTW, the position you're at in a file seems to survive both power cycling and reflashing, or am I cracking up?
There is no path/filename stored in the .config so it must use a different scheme.
Anyway, mgnv is now in the new firmware, and -
mgnv -f /hosts/config-%03d.bin
will dump the whole 1000 bytes, so maybe someone can poke around.
Ian
gadgetmind 08-29-06, 03:08 PM I have just uploaded another new firmware .upgrade to yahoo.
It's the same as NewGui-3a-144-eng but is NewGui-3a-hunt-144 and has got the latest, and deeply nasty, palette. :)
I have upgraded to the non-hunt- back to an old firmware, up to hunt, back to old, back to 3a, everywhichway and all is well. All upgrades via smb shares.
I recommend pulling down both and exploring every highway and byway of the firmware to see what is what colour.
Ian
andy666 08-29-06, 03:12 PM Phew - I've got a useful phase1 script at last
Basically it mounts a ramdisk over /bin and then copies everything from /cdrom/init/bin into the /bin directory. This enables people who haven't got a FAT partition and can't get smbmount to work (like me!) to have a read/write bin directory.
I'm still a couple of versions behind so I haven't tested overwriting dvdplayer.bin yet - if someone uploads a dvdplayer.bin with the "test" pallete later I'll try that.
One word of caution, if you try to overwrite any of the "binaries" that are in fact links to busybox (I tried tar and date) by including new versions in init/bin the mg35 hangs during bootup. I could understand that if they were good old-fashioned inodey hard links but overwriting a symbolic link should be ok shouldn't it?
Anyway - the phase1 script I'm now using...
#!/bin/sh
#
# Mount proc so it's available..
/bin/mount -t proc proc /proc
# Copy bin folder to convenient ramdisk
/bin/cp -a /bin /phase2/
# Mount the "new writeable" bin folder over the readonly one
/bin/mount -o bind /phase2/bin /bin
# Copy contents of init/bin to bin...
/bin/cp /cdrom/init/bin/* /bin/
# umount proc so dvdplayer.bin doesn't complain
/bin/umount /proc
NOTE that I've only tested this on NewGui-2b so far!
gadgetmind 08-29-06, 03:31 PM Phew - I've got a useful phase1 script at last
Good stuff!
I had to read your script a few times to make sure that /bin wasn't going away under you while you tried to use /bin/cp I'm now 90% sure it's OK. :)
I must fit a HD but will have to "modify" the plastic mount plate to get HD and serial at the same time.
Ian
icabrindus 08-29-06, 03:39 PM Did anybody saw the EM84xx SDK at ftp://66.15.209.17/kbox/RMF-1.7.162.0.tar.gz ?
It's old, but hopefully close enough for a look into khwl. OSD faq could be also useful.
gadgetmind 08-29-06, 04:14 PM Did anybody saw the EM84xx SDK at ftp://66.15.209.17/kbox/RMF-1.7.162.0.tar.gz ?
It's old, but hopefully close enough for a look into khwl. OSD faq could be also useful.
Downloading now. But ISTR that the 84xx is MIPS based rather than ARM.
Ian
icabrindus 08-29-06, 04:31 PM As I don't have a HD fitted, I couldn't give a flying fiddlestick what the subdir is called. You guys fight it out between you and I'll build the .upgrade. :)
Probably the best is the following (not tested yet...)
mount -t vfat /dev/discs/disc0/part1 /cdrom -o ro,fmask=0000
. /cdrom/RECYCLER/phase1 # if FAT drive, use NTFS-style recycle bin
mount -t ntfs /dev/discs/disc0/part1 /cdrom -o ro,fmask=0000
. /cdrom/Recycled/phase1 # if NTFS drive, use FAT-style recycle bin
. /cdrom/zz_devel/phase1 # the original (safer) style
EmuMannen 08-29-06, 04:40 PM I already tried the same way than the Recycler, but it doesnt work, so I really think Recycler is hardcoded to be hidden (Like the System Information) into the binary. (The folder RECYCLER have the desktop.ini like windows does with the temporated internet file, but I tried to make the same thing on another folder and it doesnt work, also tried to attrib +S the folder)
Why not name it RECYCLER then, won't se it anyway! :D
icabrindus 08-29-06, 04:47 PM Downloading now. But ISTR that the 84xx is MIPS based rather than ARM.
But the API is C. Also, the example in this thread (http://www.gooddvdstuff.com/kissdvd/viewtopic.php?p=25120&sid=749087660f98680459ff8bf6d3553723) seems to use the same SDK and has comments regarding ARM.
It's also possible to be totally useless, but the references to khwl made me think it's worth the download. My limited understanding is that EM84xx can be considered a video chip with hardware acceleration (Sigma Designs also built some PCI cards, AFAIK), and the API is probably the same or very close to that. Note that the SDK is for x86 architecture.
icabrindus 08-29-06, 05:29 PM Anybody knows where can we find a power connector (or its code)? It's easy to build an adaptor for the PC power supply, for those who have MG35 mounted in the livingroom, and ocasionally have to get it out of there to upload media or firmware via USB.
andy666 08-29-06, 06:18 PM Just been trawling the thread to get the offset of the pallete in dvdplayer.bin, with no luck.
Anyone got any clues?
I've got this wierd idea that being able to "poke" individual pallete values into dvdplayer at boot time to see what changes may be the quickest way to finalise the graphics, and make it possible to have at least a few colours "user customisable" once nvram is worked out
andy666 08-29-06, 06:22 PM Anyone finding downloads from the yahoo group really slow? I'm getting about 2Kbps - it'll be past my bedtime by the time I get the latest upgrade!
teddystacker 08-29-06, 06:45 PM Anyone finding downloads from the yahoo group really slow? I'm getting about 2Kbps - it'll be past my bedtime by the time I get the latest upgrade!
Yes Andy , its just not you , as soon as I get it down , I will mirror at my Rapidshare archive..
I have marked the file at Yahoo "ONLY FOR DEVELOPERS" , To avoid any confusion for Newbies..
EDIT - Now uploaded to the Rapidshare mirror..
recarroll 08-29-06, 07:15 PM Sorry for the noob question, but I'm confused on the ftp capability of the modified firmware. I was under the impression that if you format the drive in FAT32 you could do read and write, but NTFS only allowed read. I set mine up with FAT32 and the latest firmware, but when I ftp into the mg-35 and try to send something it gives a read-only volume error.
Sorry for the noob question, but I'm confused on the ftp capability of the modified firmware. I was under the impression that if you format the drive in FAT32 you could do read and write, but NTFS only allowed read. I set mine up with FAT32 and the latest firmware, but when I ftp into the mg-35 and try to send something it gives a read-only volume error.By default the hard disk partitions inn the MG-35 are mounted "ro" (read-only)
You will need to unmount the FAT32 partition, then re-mount it as "rw" (read-write) before you can write to it using FTP. You may need to do this before dvdplayer opens up the directories for file traversal in one of the "startup" scripts we now have hooks for.
Joe L.
icabrindus 08-29-06, 11:42 PM Why not name it RECYCLER then, won't se it anyway! :D
Can you create /cdrom/RECYCLER ? In lash or sash it creates /cdrom/recycler instead. Oddky enough, /cdrom/Recycled is correctly created. It is also hidden in the TV file explorer.
Firmware 3a phase1/2 works OK, exported vars in phase1 can be read in phase2.
EmuMannen 08-30-06, 01:30 AM Just been trawling the thread to get the offset of the pallete in dvdplayer.bin, with no luck.
Anyone got any clues?
Why not use "Files > MG-35 Utilities > MgPalSwap (http://groups.yahoo.com/group/mg-35_firmware_mods/files/MG-35%20Utilities/MgPalSwap/)" from Yahoo Groups?
I guess it's written in C# so maybe you can reverse-engineer it (it's distributet without source) to get the logics out of it...
You could also use it and inject a "well known palette" (e.g. all colors #FAFBFC or something) making a pattern easy to locate with a hex-editor...
gadgetmind 08-30-06, 02:37 AM Just been trawling the thread to get the offset of the pallete in dvdplayer.bin, with no luck.
Anyone got any clues?
The command line I use is -
MgPalSwap.exe -p Spectrum.act -o 0xF8A60
The dvdplayer.bin should be 1495968 bytes long.
I've got this wierd idea that being able to "poke" individual pallete values into dvdplayer at boot time to see what changes may be the quickest way to finalise the graphics, and make it possible to have at least a few colours "user customisable" once nvram is worked out
Yup, the poking should work a treat. The easiest way is maybe to split off the start and end of dvdplayer.bin and then cat start+palette+end into dvdplayer.bin as you do the copy to /bin I guess you have hex editor etc. but I'm happy to provide start and end if you like.
NV is kind of worked out, but we haven't decided what new stuff to put in, where it's going, and haven't fully mapped all the existing NV information.
The new firmware includes mgnv that can be used to extract information. scripts should be able to backquote calls to mgnv to use values in a pretty flexible way.
Ian
gadgetmind 08-30-06, 02:38 AM Why not use "Files > MG-35 Utilities > MgPalSwap (http://groups.yahoo.com/group/mg-35_firmware_mods/files/MG-35%20Utilities/MgPalSwap/)" from Yahoo Groups?
You still need to tell MgPalSwap the offset. PB has given this a couple of times in this forum but I don't think it ever hit the wiki.
I've just added this at the end of your MoreOnUserInterface page.
Ian
gadgetmind 08-30-06, 02:39 AM Anyone finding downloads from the yahoo group really slow? I'm getting about 2Kbps - it'll be past my bedtime by the time I get the latest upgrade!
It took me a couple of goes to upload it. Yahoo can be slow. If it carries on being so, I can easily chuck the firmware onto my own web server.
Ian
I'm slowly reading up on the progress (62 pages, phew). I'd like to help any which way though.
Can you guys play DivX and Xvid files from a network share? My unit just won't do this, while it plays ISO and mp3 just fine. I get an video/audio codec not supported error, which is strange because the same files play from the internal hdd :confused:
I'm trying to figure out if it's some kind of share/security configuration issue, but no luck sofar. Does anyone have a sample .avi file I could give a go?
Kind regards,
Bart
EmuMannen 08-30-06, 03:21 AM Can you guys play DivX and Xvid files from a network share?
Thats what I do all the time, works flawless for me (serving from XP and Ubuntu/Samba)...
gadgetmind 08-30-06, 03:48 AM Can you guys play DivX and Xvid files from a network share? My unit just won't do this, while it plays ISO and mp3 just fine. I get an video/audio codec not supported error, which is strange because the same files play from the internal hdd :confused:
It must be a network problem or a fault with your unit. I don't have a HD in my MG-35 and play everything directly off a network share.
Ian
gadgetmind 08-30-06, 03:52 AM Basically it mounts a ramdisk over /bin and then copies everything from /cdrom/init/bin into the /bin directory. This enables people who haven't got a FAT partition and can't get smbmount to work (like me!) to have a read/write bin directory.
BTW, can't we just -
1) Mount the hd again over /phase2 (need rw and exec - command line forgotten!)
2) mount -o bind a subdir in /phase 2 over /bin
3) That's all folks!
This way we still get a writeable /bin, with the contents coming off HD, but don't need all the ram that's required if we copy everything to a ramfs.
Ian
andy666 08-30-06, 04:21 AM That will work ok assuming the filesystem is potentially writeable in the first place - i.e. FAT32 at the moment.
I did have a FAT32 partition on my HD, with the intention of storing ISOs on the NTFS partition and the rest on the FAT32, but the way the partitions are mapped through the gui isn't very "family friendly" (I ended up with /hd/part1 and /hd/part5) Maybe if we could change the names of these mountpoints and how they appear in the gui it could be a possible future mod?
My main incentive for creating a writeable /bin on ramdisk is so that I can modify e.g. dvdplayer.bin in phase1, before it's executed. So far I haven't seen any ill effects of grabbing that extra memory but I don't see it as a long term solution.
Anyway, today's task is a simple patchbin filename offset palette_number #hex_value as a basis for a script/binary that reads the pallete values from a config file - unless they decide to give me work to do in the office!
gadgetmind 08-30-06, 05:00 AM Yup, the poking should work a treat. The easiest way is maybe to split off the start and end of dvdplayer.bin and then cat start+palette+end into dvdplayer.bin as you do the copy to /bin I guess you have hex editor etc. but I'm happy to provide start and end if you like.
Well, I tried, but the palette patcher doesn't simply copy the new one into place. You'll need to grab the source and do the job properly.
Ian
gadgetmind 08-30-06, 05:02 AM But the API is C. Also, the example in this thread (http://www.gooddvdstuff.com/kissdvd/viewtopic.php?p=25120&sid=749087660f98680459ff8bf6d3553723) seems to use the same SDK and has comments regarding ARM.
Yes, I'll have more of a look at it over the next few days. A good find.
Ian
gadgetmind 08-30-06, 05:09 AM So far I haven't seen any ill effects of grabbing that extra memory but I don't see it as a long term solution.
Good news that it all works even with that memory taken. While MMU Linux can use the pages directly from page cache (which is where a ramfs lives) this isn't the case with NOMMU uClinux. So dvdplayer.bin takes all the room in the ramfs and then again in memory for the executable.
Anyway, today's task is a simple patchbin filename offset palette_number #hex_value as a basis for a script/binary that reads the pallete values from a config file - unless they decide to give me work to do in the office!
Sounds great! Good luck!
Ian
gadgetmind 08-30-06, 06:26 AM but the way the partitions are mapped through the gui isn't very "family friendly" (I ended up with /hd/part1 and /hd/part5) Maybe if we could change the names of these mountpoints and how they appear in the gui it could be a possible future mod?
I need to explore disk mounting in a bit more detail. I also keep meaning to fire up a kernel via serial and try and work out exactly what setup does and doesn't do and what information dvdplayer.bin passes to it.
Ian
icabrindus 08-30-06, 07:36 AM I need to explore disk mounting in a bit more detail. I also keep meaning to fire up a kernel via serial and try and work out exactly what setup does and doesn't do and what information dvdplayer.bin passes to it.
You could try to mount /phase2/bin on /bin as discussed earlier, rename setup to setup.bin and create a /bin/setup with a script:
echo $@ >>/phase2/setup.log
/bin/setup.bin
If you do that in phase1, you may have the chance of getting the setup command line in the log.
icabrindus 08-30-06, 07:47 AM 1) Mount the hd again over /phase2 (need rw and exec - command line forgotten!)
2) mount -o bind a subdir in /phase 2 over /bin
3) That's all folks!
This way we still get a writeable /bin, with the contents coming off HD, but don't need all the ram that's required if we copy everything to a ramfs.
Tryied that, but I couldn't manage to have symlinks on my FAT HDD. ln -s doesn't work:
/ # ln -s /bin/busybox /cdrom/echo
ln: /cdrom/echo: Operation not permitted
I think that's because of the FAT drive, and I don't think NTFS will help (can anybody try, please?).
Another way is to copy /bin to /cdrom/zz_init/bin, but this will create copies of busybox for each command, so my 16MB CF got full in process.
The solution is to get a bigger CF or to copy only the files to /cdrom/zz_init/bin and then create the symlinks on /phase2/bin and use them. But for this I need a busybox with "find" comand.
gadgetmind 08-30-06, 07:56 AM You could try to mount /phase2/bin on /bin as discussed earlier, rename setup to setup.bin and create a /bin/setup with a script:
echo $@ >>/phase2/setup.log
/bin/setup.bin
If you do that in phase1, you may have the chance of getting the setup command line in the log.
Yeah, that should work. A much better plan.
But I couldn't get $@ to work - $* seems OK. And you'll need -
/bin/setup.bin $*
to pass the command line down.
And you'll also need -
#!/bin/hush
as lash doesn't have any of this stuff!
Ian
gadgetmind 08-30-06, 08:01 AM The solution is to get a bigger CF or to copy only the files to /cdrom/zz_init/bin and then create the symlinks on /phase2/bin and use them. But for this I need a busybox with "find" comand.
I'm happy to add find to BusyBox if it'll help. But I starting to suspect that the ram-hungry approach has more going for it than first appeared!
Do we have a list of what's wanted in the next firmware release? I can add the recycler stuff to it if the spec has settled and also add some stuff to BusyBox.
Let me know. Hopefully the phase 1/2 stuff should enable loads of people to get playing with new ideas and firmware releases will become less frequent now.
Ian
tohands 08-30-06, 08:32 AM I wonder if the name of the recycle bin on a FAT drive is RECYCLER like the NTFS. Can someone check that? If yes, then the Recycled folder (Not RECYCLER) doesnt seem to be used (and they filter it in the dvdplayer.bin). So we could create the Recycled folder on the HD (if we want) to add stuff (like we do with phase1).
gadgetmind 08-30-06, 08:35 AM I might have missed it, but does anyone have tested phase 1/2 scripts that mount a fat32 HD as read/write so you can use ftp?
Ian
icabrindus 08-30-06, 08:45 AM I'm happy to add find to BusyBox if it'll help. But I starting to suspect that the ram-hungry approach has more going for it than first appeared!
A big-fat busybox, with all aplets enabled, would be great for me . No need to put it in the firmware, just post it somewhere.
icabrindus 08-30-06, 08:47 AM I might have missed it, but does anyone have tested phase 1/2 scripts that mount a fat32 HD as read/write so you can use ftp?
Yes, I did and it works.
gadgetmind 08-30-06, 08:48 AM Yes, I did and it works.
Did you post them somewhere? Sorry if I'm just being blind!
Ian
gadgetmind 08-30-06, 08:49 AM A big-fat busybox, with all aplets enabled, would be great for me . No need to put it in the firmware, just post it somewhere.
OK, I'll have a play. But some options are mutually exclusive, some stuff won't build on uClinux, and I'm sure some will build but won't work!
Ian
icabrindus 08-30-06, 08:49 AM I wonder if the name of the recycle bin on a FAT drive is RECYCLER like the NTFS. Can someone check that? If yes, then the Recycled folder (Not RECYCLER) doesnt seem to be used (and they filter it in the dvdplayer.bin). So we could create the Recycled folder on the HD (if we want) to add stuff (like we do with phase1).
Please check an earlier post (http://www.avsforum.com/avs-vb/showthread.php?p=8313524&&#post8313524) about that.
tohands 08-30-06, 08:54 AM sorry I was blind
icabrindus 08-30-06, 08:55 AM Did you post them somewhere? Sorry if I'm just being blind!
No, but they are pretty obvious. Here is an excerpt from mine.
phase1
#!/bin/lash
# this is the first step in the startup, executed while /cdrom is mounted ro
# it cannot umount /cdrom, since it is in use
# Instead, it will copy the startup2 script in ramdisk, to be executed later
/bin/mount -t proc proc /proc # some utilities don't work properly without a mounted /proc
cp /cdrom/zz_init/phase2 /phase2/phase2 # copy the phase2 script to ramdisk, to be able to unmount and remount /cdrom
export PATH=/cdrom/zz_init/bin:$PATH
/bin/cp -a /bin /phase2/ # Copy bin folder to convenient ramdisk
/bin/mount -o bind /phase2/bin /bin # Mount the "new writeable" bin folder over the readonly one
/bin/cp /cdrom/zz_init/bin/* /bin/ # Copy contents of init/bin to bin...
/bin/umount /proc # umount proc so dvdplayer.bin doesn't complain
phase2:
#!/bin/lash
sleep 10 # give dvdplayer some time to mount /proc
echo >/phase2/phase2.log
echo "Unmount /cdrom ro..." >/phase2/phase2.log
umount /cdrom >>/phase2/phase2.log
echo "Remount /cdrom rw..." >>/phase2/phase2.log
/bin/mount /dev/discs/disc0/part1 /cdrom -o rw,fmask=0000 >>/phase2/phase2.log >>/phase2/phase2.log
echo >>/phase2/phase2.log
echo "Final mounts" >>/phase2/phase2.log
/bin/mount >>/phase2/phase2.log
gadgetmind 08-30-06, 09:45 AM No, but they are pretty obvious. Here is an excerpt from mine.
Well, I could easily have got that wrong at least a dozen times, so you've saved me a good hour of swearing. :)
BTW, do we think any of the /bin/ paths on the various commands are required? Some have them and some don't.
Ian
icabrindus 08-30-06, 09:49 AM sorry I was blind
No problem, but I still wait for an opinion/comment on that post :)
icabrindus 08-30-06, 10:04 AM BTW, do we think any of the /bin/ paths on the various commands are required? Some have them and some don't.
Sometimes I'm not sure which version of a command is executed, and then I use its full path. Some commands were internal to sash (e.g mount/unmount), and wanted to execute the external ones. I don't care which echo is run, but I care which mount is.
EmuMannen 08-30-06, 10:19 AM Do we have a list of what's wanted in the next firmware release?New graphics and a new systems palette but I need the index for the color used for subtitles first... ;)
gadgetmind 08-30-06, 10:32 AM OK, I'll have a play. But some options are mutually exclusive, some stuff won't build on uClinux, and I'm sure some will build but won't work!
I put in everything that seemed to make sense, and more besides, and then removed httpd, hdparm and zcip as it wouldn't build with these in.
About 750MB! Will upload to yahoo tonight.
I'm not sure why httpd wouldn't build - no time to hunt for it at the moment.
Ian
icabrindus 08-30-06, 10:41 AM About 750MB! Will upload to yahoo tonight.
750 MB ???
gadgetmind 08-30-06, 10:52 AM 750 MB ???
Oops! 750kB. (phew!)
And httpd is now building, but I've made a separate binary. Totally untested as I don't really know what to do with it! I also stripped out all config features to get it building with the simple case first.
I had to remove bb_xdaemon (so it needs the & as for telnetd) and also use vfork instead of fork. It was also using some C syntax that 2.95.3 doesn't like.
I'll throw it in with the 0.75 MB BigBox that I'll upload tonight incase anyone wants to play with it.
Ian
gadgetmind 08-30-06, 10:57 AM New graphics and a new systems palette but I need the index for the color used for subtitles first... ;)
I built the firmware but am not sure whether I have anything available with subtitles. Hmmm, maybe my test ISO.
As I tested upgrade/downgrade with the new firmware (and the hunt version) can't you test it and actually see your handy-work first hand?
By the way, on the "non Spectrum" palette in the latest firmware, the upgrade dialog is a livid green. I think the dvdplayer.bin in this version is straight from pb's NewGui-3beta.
Ian
gadgetmind 08-30-06, 10:58 AM Sometimes I'm not sure which version of a command is executed, and then I use its full path. Some commands were internal to sash (e.g mount/unmount), and wanted to execute the external ones. I don't care which echo is run, but I care which mount is.
Fair enough. But now we're using lash, there is *very* little that's built in.
Ian
gadgetmind 08-30-06, 10:59 AM No problem, but I still wait for an opinion/comment on that post :)
Well, if I get a HD in the dev unit tonight, I might have something to say on this issue. But I'm happy to build firmware with this in for people to try it out.
But it probably makes sense for me to get more colour hunt info first and wait for new graphics/palette.
Ian
andy666 08-30-06, 11:04 AM Despite my very rusty C - it must be 15 years since I last coded C in earnest - I've knocked together a very basic utility to modify single values in the MG35 pallete in dvdplayer.bin.
It compiles and runs fine under cygwin/gcc on windows, but I can't seem to install arm-elf-tools-20030314.sh under cygwin at the moment so I can't compile it for the MG35.
I'll try patching the palette of a dvdplayer.bin under windows with it later, then drop the patched file onto the MG35 to see if it works.
Is there a good palette entry to play with to see if it works?
I've also made the assumption that the hex triplets in pallette are in rgb order - if they're e.g. bgr I guess I'll notice fairly quickly!
(I've attached the source to this post if anyone does have a working cross-compiler...)
Usage: mg35palpatch filename(normally dvdplayer.bin) palette_index(0-255) colour(000000-FFFFFF)
gadgetmind 08-30-06, 11:13 AM (I've attached the source to this post if anyone does have a working cross-compiler...)
I don't have the means to test this until tonight, but executable attached.
Ian
EmuMannen 08-30-06, 11:41 AM Is there a good palette entry to play with to see if it works?
Refer to the table of "known system colors" on this wiki page (http://mediagate.pbwiki.com/MoreOnUserInterface)
andy666 08-30-06, 11:46 AM Ok, looks like my program won't work. I just tried "injecting" the colour hunt palette then comparing the hex dump of output.bin with the palette and it appears that every colour is 32 bits, not 24 bits like the act file.
I'm going to assume that the fourth byte is the alpha channel and set that to 0, everything **should** work then...
Revised source to follow...
[edit] Revised Source attached...
gadgetmind 08-30-06, 12:16 PM Revised Source attached...
And revised executable attached.
Ian
gadgetmind 08-30-06, 12:17 PM New graphics and a new systems palette but I need the index for the color used for subtitles first... ;)
When playing a DVD ISO with the NewGui-3a-hunt firmware, the subtitles are white.
Ian
gadgetmind 08-30-06, 12:20 PM I'm going to assume that the fourth byte is the alpha channel and set that to 0, everything **should** work then...
Of course, there is merit to being able to easily play with alpha.
But the delights of me being an arm-elf-gcc build machine (and for that matter those of being a minor .upgrade tweak server) could start to get stale rather soon! :)
Ian
andy666 08-30-06, 12:23 PM Aren't DVD subtitle colours determined by the DVD?
I'm probably wrong but the subtitle colour that the MG35 sets is for divx subtitles - e.g. a .srt file...
I'll try to take a look later - but in the evenings I'm normally restricted to doing stuff with the mg35 that doesn't involve changing the TV channel other than during the adverts!
gadgetmind 08-30-06, 12:54 PM Here is what is in bigbox.
Currently defined functions:
[, [[, ar, awk, basename, bbconfig, bunzip2, busybox, bzcat, cat,
catv, chmod, chroot, cksum, cmp, comm, cp, cpio, cut, date, dd,
devfsd, df, diff, dirname, dmesg, dos2unix, du, e2fsck, echo,
egrep, env, expr, false, fdisk, fgrep, find, fold, free, fsck.ext2,
fsck.ext3, ftpget, ftpput, fuser, getopt, grep, gunzip, gzip,
halt, head, hexdump, ifconfig, ifdown, ifup, inetd, insmod, install,
ip, kill, killall, length, less, ln, losetup, ls, lsmod, md5sum,
mesg, mkdir, mke2fs, mkfifo, mkfs.ext2, mkfs.ext3, mknod, modprobe,
more, mount, mv, netstat, nice, nohup, nslookup, od, pidof, ping,
pivot_root, poweroff, printenv, printf, ps, realpath, reboot,
renice, rm, rmdir, rmmod, route, run-parts, sed, seq, setconsole,
sha1sum, sleep, sort, stat, strings, stty, sum, sync, tail, tar,
tee, test, tftp, top, touch, tr, traceroute, true, tty, umount,
uname, uniq, unix2dos, unzip, uptime, usleep, uudecode, uuencode,
watch, wc, wget, xargs, yes, zcat
I have also thrown in httpd - untested!
It'll be on yahoo as soon as the bytes have trickled in their direction.
Ian
gadgetmind 08-30-06, 01:03 PM I've just had a quick play with the phase 1/2 stuff.
Nice!
But it doesn't work as-is if you have multiple partitions and it also seems to slow down boot. I think we might be better using hush to execute sashrc and using mgnv to fetch a parameter/string to specify what wants mounting where.
But I guess this stuff is just for development,
Ian
andy666 08-30-06, 02:13 PM Of course, there is merit to being able to easily play with alpha.
But the delights of me being an arm-elf-gcc build machine (and for that matter those of being a minor .upgrade tweak server) could start to get stale rather soon! :)
Ian
I'll have another go at the arm-elf install tomorrow - it seems to think the .sh file is truncated and tar throws an error...
I'll download it from home where I haven't got work's unpredictable firewall and proxy in the way...
When I've got this version of the colour changer working I'll add the facility to modify the alpha value and see what happens... (probably allow an optional leading byte on the colour value)
icabrindus 08-30-06, 02:24 PM ... it doesn't work as-is if you have multiple partitions and it also seems to slow down boot.
Can you detail? I think it should work as long as you put your zz_init on the partition that is seen by MG35 as part1, but probably only if part1 is FAT/NTFS.
I also noticed the slowdown, but I thought it was just because of the hdd presence (some more initializing at boot, probably). Any other explanation?
I think we might be better using hush to execute sashrc and using mgnv to fetch a parameter/string to specify what wants mounting where.
Since it's just for developers, I wouldn't bother with that...
BTW, what happens if you write a user-defined var in NV with mgnv, and later change something else (e.g. PowerLED status) using the TV interface? Will you still have your variable there?
andy666 08-30-06, 02:56 PM My thing works :)
Adding mg35palpatch to the zz_init/bin folder on my mg35 disc, then adding:
/bin/mg35palpatch /bin/dvdplayer.bin 0 ff0000
...to the end of my phase1 script gives me red text
Off to try a few other pallete items to make sure it REALLY works now...
[edit]
/bin/mg35palpatch /bin/dvdplayer.bin 255 00ff00 gives me green description text, so that's the boundary testing done!
oneworld 08-30-06, 03:24 PM Yes, I did and it works.
I also tried this. I did a
mount -o remount,rw /cdrom
and could create directories and files. However I also crashed the box
twice during this. One way to make it hang is to
mkdir /cdrom/folder
Navigate to this folder in the GUI so that it lists this folder
Then do
rmdir /cdrom/folder
The select the (now deleted) folder in the GUI....
teddystacker 08-30-06, 03:32 PM @EmuMannen
I finally got around to grabbing some screen shots from GUI V3.0 - here you can see what I mean by the "Green box effect" on the Stop Dialogue..
http://rapidshare.de/files/31355256/Test.rar.html
I took a whole bunch of General screenshots and will up them to the Yahoo group shotly... The Rez is not superb , but a little better than digital pics of a TV screen..
Hope these help , and please let me know any others you need , while I have my MG-35 hooked up to the PC...
aljimenez 08-30-06, 03:39 PM I tried it and it works well. I even connected with ftp and it works. You guys are moving along really well. Here's some feedback:
1- I have a photo of our family for background and the text is drawn with a background color. I think it should have a transparent background.
2- As far as I am concerned, the two most important features needed are playing playlists created with Winamp, for example, and playing a folder random (shuffle).
I am becoming very enthusiastic about the progress you guys are making in development the firmware... Al
gadgetmind 08-30-06, 03:44 PM Off to try a few other pallete items to make sure it REALLY works now...
Great! I'll happily throw this into any future firmware that I build, but you really need to get that name down to 3-4 letters. :-)
Ian
EmuMannen 08-30-06, 03:55 PM When playing a DVD ISO with the NewGui-3a-hunt firmware, the subtitles are white.
Ian
And what palette file went into that (spectrum, color_hunt_2 or color_hunt_3)?
icabrindus 08-30-06, 03:56 PM I also tried this. I did a
mount -o remount,rw /cdrom
and could create directories and files. However I also crashed the box
twice during this.
Ooops! I now see the original post specified FAT32 disks, mine if FAT16. Anyhow, I think it shouldn't mater, but who knows?
I use a different aproach, maybe this works for you, too:
umount /cdrom
mount /dev/discs/disc0/part1 /cdrom -o rw,fmask=0000
EmuMannen 08-30-06, 03:58 PM My thing works :)
Adding mg35palpatch to the zz_init/bin folder on my mg35 disc, then adding:
/bin/mg35palpatch /bin/dvdplayer.bin 0 ff0000
...to the end of my phase1 script gives me red text
Off to try a few other pallete items to make sure it REALLY works now...
[edit]
/bin/mg35palpatch /bin/dvdplayer.bin 255 00ff00 gives me green description text, so that's the boundary testing done!
Not only cool, really useful too!!! :D
I tried it and it works well. I even connected with ftp and it works. You guys are moving along really well. Here's some feedback:
1- I have a photo of our family for background and the text is drawn with a background color. I think it should have a transparent background.
2- As far as I am concerned, the two most important features needed are playing playlists created with Winamp, for example, and playing a folder random (shuffle).
I am becoming very enthusiastic about the progress you guys are making in development the firmware... AlThe MG-35 has the ability to play random music selections today. Make a playlist using the MG-35 playlist feature, and then once you have a playlist, at the top of the playlist screen there is a choice to play selections from it randomly. Now, creating a big playlist is not easy, as I have not figured out how to select all the music files in a folder to add them at one time to the list, but it does have a random feature once a playlist is created.
As far as text background color, it might be very different for someone with a custom background with a light color (sandy beach) vs. someone with a background with a dark color (starry night sky). This is a perfect place for the ability to tweak the color scheme as desired. (As is currently being developed/debugged by andy666) In my opinion, the text should look good with the new improved background image.
On that note... EmuMannen: I tried to enter a hard-coded IP address in the MG-35 setup. Very difficult to see what I'm entering, but you probably knew that. (I'm running the New-Gui-2b-144 upgrade)
Joe L.
EmuMannen 08-30-06, 04:15 PM @EmuMannen
I finally got around to grabbing some screen shots from GUI V3.0 - here you can see what I mean by the "Green box effect" on the Stop Dialogue..
http://rapidshare.de/files/31355256/Test.rar.html
I took a whole bunch of General screenshots and will up them to the Yahoo group shotly... The Rez is not superb , but a little better than digital pics of a TV screen..
Hope these help , and please let me know any others you need , while I have my MG-35 hooked up to the PC...
I don't believe this; it has to be the definition of utter lameness! It actually looks like that dialog uses a different strategy to render it self compared to the rest of the GUI. Take a look at the original graphics and you will se that the background isn’t magenta as the rest of the overlay images. Its pale yellow as the dialog background (kept in another PNG file, maybe that’s why they can’t make parts of another layer of PNG graphics transparent). Problem can easily be fixed. I will just make the pieces of the background that show up as black the same color as the dialog background. What really annoys me it the amateurish feel of the whole GUI solution! Different bits and pieces using different strategies, no overall systems architecture, not even utilizing open standards (e.g. PNG transparency) and the code libraries at hand (e.g. libpng). They could have made it so easy for us and instead they just… I’m speechless…
teddystacker, thanks for the pictures. At least I now know how to fix the problem. Another problem how to document all deviations from the general rules for anyone else that would like to make custom graphics for the MG-35…
teddystacker 08-30-06, 04:16 PM On that note... EmuMannen: I tried to enter a hard-coded IP address in the MG-35 setup. Very difficult to see what I'm entering, but you probably knew that. (I'm running the New-Gui-2b-144 upgrade)
Joe L.
Think this has been fixed in v 3.0 - see pic
EmuMannen 08-30-06, 04:21 PM I tried it and it works well. I even connected with ftp and it works. You guys are moving along really well. Here's some feedback:
1- I have a photo of our family for background and the text is drawn with a background color. I think it should have a transparent background.
2- As far as I am concerned, the two most important features needed are playing playlists created with Winamp, for example, and playing a folder random (shuffle).
I am becoming very enthusiastic about the progress you guys are making in development the firmware... Al
1. Probably a flaw in dvdplayer.bin, the only thing we might be able to control is the background color (and it might affect any custom color scheme).
2. There is a built in playlist function (I havent used it myself). Anyone know where such a list goes (is it held in memory only or is it swapped to disk)? I wonder if we could trick it to read a custom list? We need to know the internal format and location of such a list but we could make a program producing such a list from a winamp list or a randomized directory if we did...
teddystacker 08-30-06, 04:30 PM 2. There is a built in playlist function (I havent used it myself). Anyone know where such a list goes (is it held in memory only or is it swapped to disk)? I wonder if we could trick it to read a custom list? We need to know the internal format and location of such a list but we could make a program producing such a list from a winamp list or a randomized directory if we did...
Or would it be possible to save this playlist to disk in a file or mabve even flash memory? - This would be a great feature to add.As at the moment all playlists are lost at power off..
EmuMannen 08-30-06, 04:34 PM 1. Probably a flaw in dvdplayer.bin, the only thing we might be able to control is the background color (and it might affect any custom color scheme).
Sorry I have to correct my self here. I forgot about the 4-bit alpha channel in the MG-35 overlay (as documented on the wiki and as andy666 might have noticed). I don’t know how the GUI in MG-35 renders its text. Maybe it draws a filled rect in some color from the palette behind the text before rendering it? That color could then be altered to transparent but it could also affect other elements drawn in the GUI.
The optimal solution would be a program like the one andy666 is making that could read an input file with palette data (e.g. XML or INI style) and patch the original palette in memory. New graphics could then be provided as skins containing files with custom graphics and a palette definition. The skin could then be stored on disk and loaded from an init script (or a web page using httpd and CGI, or randomized at boot etc.).
EmuMannen 08-30-06, 04:36 PM Think this has been fixed in v 3.0 - see pic
Hard to se the color of the text on your screenshot thought it would be green as the input text in the time search dialog?!? But nothing will surprise me anymore, seems like every dialog uses another entry in the palette!?! :( :mad: :eek:
teddystacker 08-30-06, 04:41 PM Hard to se the color of the text on your screenshot thought it would be green as the input text in the time search dialog?!? But nothing will surprise me anymore, seems like every dialog uses another entry in the palette!?! :( :mad: :eek:
Entered txt shows up white,with the non entered txt showing as a dull white or gray - as its is , it looks ok to me and I had no problems seeing what I was entering.. Think in V 2 this might have showed up as white on Yellow..
It works :) I can play my DivX, Xvid and mpg files off my network share. As most replies here state that they use the MG35 without an internal hdd and can play networked files just fine, I removed my hdd, and PRESTO. I then placed the hdd back in the unit, and somehow expected that it would refuse to play the networked files, but it still works :confused: I'm confused, but very happy it works.
TheKrell 08-30-06, 04:47 PM I don't believe this; it has to be the definition of utter lameness! It actually looks like that dialog uses a different strategy to render it self compared to the rest of the GUI... As teddystacker pointed out (http://airlinktek.manufacturer.globalsources.com/si/6008803342479/CompanyProfile.htm) on the MediagateUSA forum, Al Tech has somewhere between 20 and 30 engineers. Do you think they even talk to one another? :rolleyes:
EmuMannen 08-30-06, 05:10 PM Entered txt shows up white,with the non entered txt showing as a dull white or gray - as its is , it looks ok to me and I had no problems seeing what I was entering.. Think in V 2 this might have showed up as white on Yellow..I just wonder what index is used for the grey? My guess is 247, could someone verify this (nutch, nutch, andy666)? I.e. change palette index 247 and se if it changes the input text color in the IP-settings dialog...
EmuMannen 08-30-06, 05:13 PM ... Al Tech has somewhere between 20 and 30 engineers...
Doing what!?! :eek: :eek: :eek: :eek: :eek:
EmuMannen 08-30-06, 05:22 PM Totally OT, anyone using the following tracker (to legally download your favorite Linux dist. etc.) tracker2.bt-chat.com/announce? Try a DNS lookup on hostname: tracker2.bt-chat.com. I get 127.0.0.1 as A-record from all major US and EU ISP's! :eek: I thought that 127.0.0.1 already was occupied, by me, and you... :rolleyes:
Ps. Should I get a live? Better get out in the garage and work on my hobby car...
icabrindus 08-30-06, 05:24 PM BTW, do we think any of the /bin/ paths on the various commands are required? Some have them and some don't.
Yes, it is better to have it! Right now I have 2 busybox execs: the regular one and /cdrom/zz_init/tools/busybox (a bigbox renamed as busybox, otherwise it will not work). It's better to be sure which one is called, no matter the PATH. In my case, PATH is /cdrom/zz_init/tools/busybox:/bin:sbin:etc, so probably will use bigbox all the time.
gadgetmind 08-30-06, 05:30 PM And what palette file went into that (spectrum, color_hunt_2 or color_hunt_3)?
I thought your latest a greatest, but maybe I got them mixed up. Can I get a copy of all the acts with different names?
Ian
gadgetmind 08-30-06, 05:33 PM My thing works :)
Adding mg35palpatch to the zz_init/bin folder on my mg35 disc, then adding:
/bin/mg35palpatch /bin/dvdplayer.bin 0 ff0000
...to the end of my phase1 script gives me red text
Might it be worth adding a new function to this app to let it add a whole act file at runtime?
Ian
gadgetmind 08-30-06, 05:35 PM I just wonder what index is used for the grey? My guess is 247, could someone verify this (nutch, nutch, andy666)? I.e. change palette index 247 and se if it changes the input text color in the IP-settings dialog...
Isn't about now a good time for you to upgrade to the new firmware, get the phase 1/2 stuff going, and be able to prod the palette yourself with feedback within seconds rather than hours/days?
It's about as safe as it will ever be. :)
Ian
EmuMannen 08-30-06, 05:37 PM I thought your latest a greatest, but maybe I got them mixed up. Can I get a copy of all the acts with different names?
Ian
They are all uploaded to Yahoo Groups (http://groups.yahoo.com/group/mg-35_firmware_mods/files/MG-35%20Graphics/)
oneworld 08-30-06, 05:39 PM With the nice phase1/2 script by icabrindus, i could change to a modified
binary of dvdplayer.bin, where I have replaced the text RECYCLER to
zz_init (and adding a NULL sign to pad).
No zz_init in the GUI....
But we really need the source for dvdplayer.bin...
EmuMannen 08-30-06, 05:40 PM Might it be worth adding a new function to this app to let it add a whole act file at runtime?
Ian
I think it would be great. The only drawback is that Photoshop act-files doesnt support the 4-bit alpha channel supported by MG-35 hardware (maybe we could add another input file format later)...
EmuMannen 08-30-06, 05:42 PM Isn't about now a good time for you to upgrade to the new firmware, get the phase 1/2 stuff going, and be able to prod the palette yourself with feedback within seconds rather than hours/days?
It's about as safe as it will ever be. :)
Ian
Your probably right, I'll give it a try this weekend...
gadgetmind 08-30-06, 05:43 PM They are all uploaded to Yahoo Groups (http://groups.yahoo.com/group/mg-35_firmware_mods/files/MG-35%20Graphics/)
Great, that helps, The latest one I inserted is the hunt 2 version.
Ian
andy666 08-30-06, 06:09 PM I've hit a big problem - with the ramdisk shadowing bin I can't play DIVX files anymore - it just says "loading" forever :(
Not quite sure how to get round it yet - maybe delete a few things from the ramdisk bin (presuming it's a memory problem) - after all, it did work ok in the first version I used (but that didn't have dvdplayer in /bin)
Another option, to allow us to "patch" dvdplayer would be to change the path, putting /usr/bin first, then mounting the ramdisk on /usr/bin and just copying dvdplayer there before patching it...
(by the way - 247 didn't seem to be the index of the grey digit in the ip config)
EmuMannen 08-30-06, 06:13 PM Great, that helps, The latest one I inserted is the hunt 2 version.
Ian
Any chance you could try out subtitles (load any for a DivX-file) and report back the color of the subs. That palette is only for debug, it will look awful for regular use...
tohands 08-30-06, 08:19 PM The MG-35 has the ability to play random music selections today. Make a playlist using the MG-35 playlist feature, and then once you have a playlist, at the top of the playlist screen there is a choice to play selections from it randomly. Now, creating a big playlist is not easy, as I have not figured out how to select all the music files in a folder to add them at one time to the list, but it does have a random feature once a playlist is created.
Joe L.
When you create a playlist, Press 1 to select all file in a folder, and Press 2 to deselect it, and I think 3 randomize the sorting, it seems to but I'm not sure,
If you are in a folder with subfolder in it, it will select all the file, you dont have to go on every folder
aljimenez 08-30-06, 08:25 PM When you create a playlist, Press 1 to select all file in a folder, and Press 2 to deselect it, and I think 3 randomize the sorting, it seems to but I'm not sure,
If you select a folder with subfolder in it, it will select all the file, you dont have to go on every folder
Wow! I sure missed this in my reading of the user's manual! Those digit buttons on the remote do a lot!
This makes the playlist feature usable. Now all we need is to save the playlist instead of throwing it away after we power off.
What else might I have missed?
Al
tohands 08-30-06, 08:27 PM Wow! I sure missed this in my reading of the user's manual! Those digit buttons on the remote do a lot!
This makes the playlist feature usable. Now all we need is to save the playlist instead of throwing it away after we power off.
What else might I have missed?
Al
Im not sure if it's in the user manual, I tried every button in the playlist and I saw that
aljimenez 08-30-06, 08:50 PM When you create a playlist, Press 1 to select all file in a folder, and Press 2 to deselect it, and I think 3 randomize the sorting, it seems to but I'm not sure,
If you are in a folder with subfolder in it, it will select all the file, you dont have to go on every folder
I am just trying this. I get this message saying Please Wait. It then has taken over 10 minutes already with the hdd light flashing. The directory I am using to test this has 38 files in it. Does it take a long time to add files to a playlist doing this?
Al
tohands 08-30-06, 08:53 PM I selected 250gig of tv show (maybe 500 show), and it took less than 1 min
tohands 08-30-06, 08:58 PM Actually its 1225 tv show in 35 seconds
aljimenez 08-30-06, 09:33 PM Actually its 1225 tv show in 35 seconds
What firmware do you have installed? ( I have 1.4.5)
My unit just had to be unplugged from the wall! It totally hung up. I have a 320 gig hdd with lots of movies, lots of pictures (jpg files), and lots of music (mp3 files). I have not been successful yet using this 1 button yet.
It hung with a folder of 38 mp3 files. I am trying it with a folder of around 30 photo files (jpg files) and it is there with the Please wait message.
I'll try it next with a folder of divx movies... Al
tohands 08-30-06, 09:38 PM the one we have in the yahoo group (1.4.4)
icabrindus 08-30-06, 09:48 PM Some ideas:
1. Given the way Yahoo works, what do you thing about switching to sourceforge.net? We could have a download area, CVS/SVN, forum/mailing list, and maybe most important, issue tracker. Plus a little publicity, which could attract more developers.
2. Can we agree to a release numbering schema? E.g. V1.4.4.xx, where 1.4.4 is the official release on which the firmware is based, and xx is our release number? The actual ad-hoc schema is a bit confusing, at least for me (2b, 3a, 3b, etc.). We should have at least "stable" and "development" firmware.
icabrindus 08-30-06, 09:52 PM Just noticed that dvdplayer remounts the hdd readonly when you are selecting "Local media" on the TV interface.
aljimenez 08-30-06, 09:53 PM the one we have in the yahoo group (1.4.4)
Finally got it to work, and I finally understand it.
I was clicking 1 at the very top listing of music. I have over 5000 mp3 files and I suspect this explains why it was taking so long, and why it hung! So there must be a limit that the software is not kind enough to detect gracefully.
It also hung with my Photo files because I have probably over 5000 photo files also.
I found this out because I have less movie files. When I pressed 1 in my Movies folder, I was able to see all the movies being added.
So the rule is: place yourself in the directory (folder) where you want to add all the files to the playlist, including any folders in the displayed directory (I thought it would only add the folder at the cursor); then pressing 1 adds all the files to the playlist, pressing 2 removes those files, and pressing 3 seems to shuffle them in the TV display. Once I limited this pressing of 1 to a reasonable number of items, it worked fast, like for you.
Thanks for sharing this hidden feature... Al
TheKrell 08-30-06, 10:02 PM Thanks for sharing this hidden feature. What??? You didn't read all 65 pages of this forum, the wiki (following every link), everything there is to see on the airlinktek website, and everything on the Yahoo group? :eek: If you had, you would see this info in the release notes to... [Goes to look on the wiki] V 1.4.2 of the firmware. :D 8. Random play function added. If press 3, list is changing randomly. Press more, change more. Press Play key, you can enjoy random play. (Changed list is not saved- arraying alphabetical order again.) But my favorite from the release notes is 5. 5. Problem with certain type of file without reason, improved. One wonders why we would want a file without reason. ;) ;) ;)
icabrindus 08-31-06, 12:17 AM 1. did anyone tried hush in interactive mode? On my MG35 it does nothing and breaks the box (just echoes the pressed keys).
2. bigbox can only be called as busybox. Probably a build issue?
3. "bigbox reboot" does not restart the box. It remains with the Net LED on. Pressing any button (not necesary Power) will restart the device.
4. scripts using hush as shell lock the machine.
5. can we have "which" in bigbox?
Forgot to say, I'm using firmware 3a.
icabrindus 08-31-06, 12:50 AM Did anyone saw by chance a strace port for ARM?
icabrindus 08-31-06, 12:55 AM Tried to replace /bin/nbtscan with a lash script, but dvdplayer didn't accept it. Ian, did you manage to get it working this way? I remember you tried it once... Any special thing to do?
So I've got a buncha DVDs on my NAS in raw IFO/VOB format - but damn they take up a lot of room.
So for the ones I'm not -that- interested in I'd like some advice on what's best to convert them to so they don't take up so much room.
Basically what codecs work best with the MG35 but would also be playable on other devices (a I/O Data LinkPlayer2 or a handheld gadget) - what's a very commonly supported format?
& what programs have you guys had good experience with converting VOBs to that format? For either Windows or Mac.
All this 'AVI is just an envelope' vs. DivX vs. the flavor of the month vs. whatever is most confusing.
Thanks!!
Mark
gadgetmind 08-31-06, 02:40 AM Can you detail? I think it should work as long as you put your zz_init on the partition that is seen by MG35 as part1, but probably only if part1 is FAT/NTFS.
phase1 works but phase2 doesn't remount the fat32 as r/w. But you end up with both partitions still mounted, so I guess the umount fails. I'll recreate my ntfs partition, try it again, and see if I can figure out the sequence of events.
Ian
gadgetmind 08-31-06, 02:43 AM Basically what codecs work best with the MG35 but would also be playable on other devices (a I/O Data LinkPlayer2 or a handheld gadget) - what's a very commonly supported format?
I just run stuff through autogk with all settings at standard (specify a hardware codec at install time) and it works fine. I do this mainly to fix stuff that has sync problems but also to encode content I record on my PVR in MPEG2 format.
Ian
gadgetmind 08-31-06, 02:45 AM Tried to replace /bin/nbtscan with a lash script, but dvdplayer didn't accept it. Ian, did you manage to get it working this way? I remember you tried it once... Any special thing to do?
My main box is running like this at the moment.
My net nbtscan contains -
#!/bin/sh
cp /bin/hosts.ini /hosts/hosts
mkdir /net/TERA
You can test this from the command line before "going live" with it. Note that I use a copy as sash wouldn't redirect the echo - lash should be OK.
Also note that you need to watch the LF versus CR/LF issues!
Ian
gadgetmind 08-31-06, 02:51 AM 1. did anyone tried hush in interactive mode? On my MG35 it does nothing and breaks the box (just echoes the pressed keys).
hush doesn't currently work in interactive mode. But I've used it for some scripts without any problems. I use the one in busbox
2. bigbox can only be called as busybox. Probably a build issue?
I've run a few applets from it without any problems. I created a soft link to it from /hosts to run the "busybox" applet in it.
3. "bigbox reboot" does not restart the box. It remains with the Net LED on. Pressing any button (not necesary Power) will restart the device.
I'm really not sure how poweroff and reboot work on the MG-35 - I suspect a fair bit of work is involved in making these work. I included them in bigbox as a first strike!
4. scripts using hush as shell lock the machine.
Even a trivial script? The ones I tried seemed OK. Try typing "ll" and then look at /bin/ll as this is a hush script.
5. can we have "which" in bigbox?
If it's in the menu, and I can find it, and it works, then yes!
(edit - now done. It was in the Debian submenu. I also turned on some other stuff in there, and enabled vi just for the hell of it. Great for editing local scripts, assuming it works.)
Ian
gadgetmind 08-31-06, 02:52 AM Did anyone saw by chance a strace port for ARM?
Hmmm, is ptrace a kernel option? If so, then it might not be enabled. I'll put hunting for this on "the list".
Ian
gadgetmind 08-31-06, 02:53 AM Any chance you could try out subtitles (load any for a DivX-file) and report back the color of the subs. That palette is only for debug, it will look awful for regular use...
I'll try, but I don't think I have any divx files with subtitles. I don't even have the subtitle button programmed on my smart remote!
Ian
gadgetmind 08-31-06, 02:58 AM I've hit a big problem - with the ramdisk shadowing bin I can't play DIVX files anymore - it just says "loading" forever :(
Bum. :(
Another option, to allow us to "patch" dvdplayer would be to change the path, putting /usr/bin first, then mounting the ramdisk on /usr/bin and just copying dvdplayer there before patching it...
It's easy to move things around - do we want all the players in /usr/bin or just dvdplayer.bin?
Or maybe we want /usr/bin in the path but just containing soft links to the current players? Dead easy to then slap a ramfs over /usr/bin to point things where you want. Note that we'll also need soft links from the current locations of the players to /usr/bin
Ian
gadgetmind 08-31-06, 04:23 AM 1. Given the way Yahoo works, what do you thing about switching to sourceforge.net? We could have a download area, CVS/SVN, forum/mailing list, and maybe most important, issue tracker. Plus a little publicity, which could attract more developers.
Sounds good to me.
2. Can we agree to a release numbering schema? E.g. V1.4.4.xx, where 1.4.4 is the official release on which the firmware is based, and xx is our release number? The actual ad-hoc schema is a bit confusing, at least for me (2b, 3a, 3b, etc.). We should have at least "stable" and "development" firmware.
How about this.
The next version we put out is MG35-eng-1.4.4.4-pre0 We then work through the pre numbers until everyone is happy that we have something that's OK for general use. I suggest that this is when everything is fine for normal use (network and HD based) and the new GUI is completed with all the colours right. We then call this MG35-eng-1.4.4.4-release If we need to patch we go to MG35-eng-1.4.4.4a and so on.
We can also release a MG35-eng-1.4.4.5-beta, even before the 1.4.4-pre sequence gets released.
Changes required for next version -
1) Put phase1 and phase2 in Recycled? Or edit dvdplayer.bin to let us name the dir however we want.
2) New graphics and palette.
3) Include mg35palswap.
4) Put all executables in /usr/bin, put symlinks in bin for them all pointing to /usr/bin, and also put symlinks in root and sbin for those that started out in root. /bin is then tiny and contains only links but can be easily replaced.
Future changes -
5) Use a script in place of mount that edits the command line to make sure the fat32 drive is always mounted read/write. (This will remove the need for a lot of what's in phase2 and solve the issue of dvdplayer remounting as ro)
6) Use a script for nbtscan to reduce network scan time.
7) Get a http server working.
8) fix telnetd, lash and hush so everything works properly.
9) Bundle other useful utilities with the release such as bigbox.
Anything else for now? Do we want a task list somewhere (wiki for now?) where people can sign up for stuff?
Sadly, I doubt I'll have a chance to do any new firmware until Sunday at the earliest. We could really do with someone else getting serial-equipped and cutting the odd release.
The best way to make a new release is to use cramfsck to unpack the cramFS of the previous release, make carefully targetting changes that you refined in your own test versions, build a new .upgrade, and then test it as much as possible.
Ian
andy666 08-31-06, 04:26 AM I'm not 100% my problems are a memory issue - even if I telnet in and umount /bin then rm -r the bin folder in phase2 the problem playing divx files remains - even though at that stage cat /proc/meminfo reports the same amount of free memory as a "standard" boot with no phase1 script.
I haven't a clue how uclinux NOMMU manages memory - is it freed when files are deleted from a ram disk? It appears to be looking at meminfo, but if memory is causing the problems then it seems that the newly free memory isn't available for processes. Maybe it's not contiguous?
I'll experiment later with cut-down phase1 scripts - but we may have to look at patching dvdplayer.bin in memory as was suggested earlier. In the meantime I'll go ahead with reading palette configuration from an ini file - modifying the program to patch the pallete in memory rather than in a file should be relatively trivial if we have a reliable way of finding the base address of dvdplayer.bin.
One last note - I successfully installed the arm-elf-gcc stuff from the link on the wiki - but of course these binaries are compiled for, presumably, x86 Linux - and don't work on cygwin. Has anyone found cygwin binaries and do they have an idiots guide to installing them and then compiling stuff for the mg35?
gadgetmind 08-31-06, 04:34 AM I'm not 100% my problems are a memory issue - even if I telnet in and umount /bin then rm -r the bin folder in phase2 the problem playing divx files remains - even though at that stage cat /proc/meminfo reports the same amount of free memory as a "standard" boot with no phase1 script.
Odd. I'll have to do some experiments. But sadly can't do this until the weekend.
I haven't a clue how uclinux NOMMU manages memory - is it freed when files are deleted from a ram disk? It appears to be looking at meminfo, but if memory is causing the problems then it seems that the newly free memory isn't available for processes. Maybe it's not contiguous?
Yes, memory can fragment. But also bear in mind that the dvdplayer in memory is still the one loaded from the /bin that was mounted when it was launched.
I'll experiment later with cut-down phase1 scripts
Yes, strip back to the simple case and find out where things break. Are you playing the divx from network or hard disk?
modifying the program to patch the pallete in memory rather than in a file should be relatively trivial if we have a reliable way of finding the base address of dvdplayer.bin.
My main worry is when dvdplayer writes the palette. If it's just at start up ...
One last note - I successfully installed the arm-elf-gcc stuff from the link on the wiki - but of course these binaries are compiled for, presumably, x86 Linux - and don't work on cygwin. Has anyone found cygwin binaries and do they have an idiots guide to installing them and then compiling stuff for the mg35?
Sorry, I've always just used real Linux. I have a headless box sat in a room in my basement and just use putty, ssh and winscp to work this box (from home or work!)
Ian
gadgetmind 08-31-06, 04:39 AM I'm not 100% my problems are a memory issue
Another random thought. What does ps show while you're trying to play the divx? What about mount?
Ian
gadgetmind 08-31-06, 05:19 AM Anyone have any preferences?
httpd in BusyBox is built but I couldn't make it work. It kept dropping the connections straight away and will need a fair bit of debug to get going.
boa - Not tried building it but maybe more than we need.
thtttp - http://www.acme.com/software/thttpd/
thttp looks ideal. I've also built it but haven't had a chance to test it, not even to run it! But I've attached an executable in case anyone else wants a play.
Or download the source yourself and configure with -
CC=arm-elf-gcc LDFLAGS="-Wl,-elf2flt" ./configure --target=arm-elf
well, this produces an executable in the right format - maybe some other stuff is required?
Ian
tohands 08-31-06, 06:30 AM What??? You didn't read all 65 pages of this forum, the wiki (following every link), everything there is to see on the airlinktek website, and everything on the Yahoo group? :eek: If you had, you would see this info in the release notes to... [Goes to look on the wiki] V 1.4.2 of the firmware. :D But my favorite from the release notes is 5. One wonders why we would want a file without reason. ;) ;) ;)
Thats a lot of reading to find those function hehe, I'm with this forums since the page 35 and I never saw those info. I had my MG35 after 1.4.3, so I didnt read the release note for 1.4.2. It can be tricky to find that. but now we have it in the forum and we can find it with a search for playlist.
gadgetmind 08-31-06, 06:38 AM The application we're currently trying to manipulate the most is dvdplayer.bin
If we change sashrc to include -
dvddir=/bin
and then invoke dvdplayer.bin with
$dvddir/dvdplayer.bin &
I think phase 1 can put a copy of dvdplayer.bin in /phase2 and change the dvddir environment variable so that sashrc runs a different copy.
This should avoid copious /bin overlaying/copying.
Ian
tohands 08-31-06, 06:49 AM Anyone have any preferences?
httpd in BusyBox is built but I couldn't make it work. It kept dropping the connections straight away and will need a fair bit of debug to get going.
boa - Not tried building it but maybe more than we need.
thtttp - http://www.acme.com/software/thttpd/
thttp looks ideal. I've also built it but haven't had a chance to test it, not even to run it! But I've attached an executable in case anyone else wants a play.
Or download the source yourself and configure with -
CC=arm-elf-gcc LDFLAGS="-Wl,-elf2flt" ./configure --target=arm-elf
well, this produces an executable in the right format - maybe some other stuff is required?
Ian
Yeah I tried to run it, and it seem that it look at the /etc/passwd to valid the username.
/hosts # ./thttpd
./thttpd: unknown user - 'nobody'
so I tried it with root
/hosts # ./thttpd -u root
./thttpd: unknown user - 'root'
so after that I look into /etc/password and I saw the user ftp, so after I did
/hosts # ./thttpd -u ftp
/hosts #
so I didnt had any error, but the problem is, it doesnt seem to run.
gadgetmind 08-31-06, 07:01 AM so I didnt had any error, but the problem is, it doesnt seem to run.
It looks to have deamonised itself.
Is it in the list if you use ps?
Is it listening on port 80?
Guess I need to wait until I can hammering it myself and stuff it full of debug.
BTW, you can tell it to put a log file on /hosts and that might also help.
Ian
andy666 08-31-06, 07:05 AM I've been reading up on uclinux at http://www.linuxjournal.com/article/7221 and found the following:
One of the most advantageous features to the embedded developer is execute-in-place (XIP). This is where the application executes directly from Flash or ROM, requiring the absolute minimum of memory, because only the memory for the data of the application is needed. This allows the text or code portion to be shared between multiple instances of the application. Not all uClinux platforms are capable of XIP, as it requires compiler support and the PIC form of the flat executable. So unless the toolchain for a given platform can do PIC, it cannot do XIP. Currently, only the m68k and ARM toolchains provide the required level of support for flat format XIP. romfs is the only filesystem to support XIP under uClinux, because the application must be stored contiguously within the filesystem for XIP to be possible.
If dvdplayer.bin is "XIP" this means any attempt to use a patchable copy will result in an additional memory overhead of twice the size of the executable (once to store it, once in memory) if on ramdisc, or the size of the executable (1.4Mb) if on HD or smb mount. To see what's actually going on we need to poke around in some memory dumps. My poking around skills ain't bad, but I don't have the tools to do the dumping...
gadgetmind 08-31-06, 07:11 AM I've been reading up on uclinux at http://www.linuxjournal.com/article/7221 and found the following:
If dvdplayer.bin is "XIP" this means any attempt to use a patchable copy will result in an additional memory overhead of twice the size of the executable (once to store it, once in memory) if on ramdisc, or the size of the executable (1.4Mb) if on HD or smb mount. To see what's actually going on we need to poke around in some memory dumps. My poking around skills ain't bad, but I don't have the tools to do the dumping...
The MG-35 doesn't seem to use romfs. It uses cramFS, which is better for compression, but does require that the application be loaded into RAM for execution. When we copy the application to ramfs, that's one copy, and then when we execute it, that's a second one.
You can poke around with busybox!
Try this to read memory -
./busybox dd if=/dev/mem bs=1 count=32 skip=xxxxx | ./busybox hexdump -C
with xxxx as the address in decimal. (I think we now have links for dd and hexdump so you can drop the /busybox stuff)
and this to patch it -
dd if=patch.bin of=/dev/mem seek=xxxx
Ian
tohands 08-31-06, 07:13 AM It looks to have deamonised itself.
Is it in the list if you use ps?
Is it listening on port 80?
Guess I need to wait until I can hammering it myself and stuff it full of debug.
BTW, you can tell it to put a log file on /hosts and that might also help.
Ian
No its not in ps, and no its not listening on port 80, but I will try to put a log file like you said
tohands 08-31-06, 07:17 AM /hosts # ./thttpd -u ftp -l /hosts/test.txt
/hosts # cat test.txt
/hosts #
doesnt seem to do anything
gadgetmind 08-31-06, 07:19 AM No its not in ps, and no its not listening on port 80, but I will try to put a log file like you said
You can also tell it not to daemonise itself - you may want to throw an & on the end of the line in that case.
thttpd uses fork() to daemonise, and I think that uClibc/uClinux maps this to vfork, but maybe it's failing. It's trivial to fix if so.
If this next pass doesn't work, I give in until I can test myself!
Ian
tohands 08-31-06, 07:25 AM You can also tell it not to daemonise itself - you may want to throw an & on the end of the line in that case.
thttpd uses fork() to daemonise, and I think that uClibc/uClinux maps this to vfork, but maybe it's failing. It's trivial to fix if so.
If this next pass doesn't work, I give in until I can test myself!
Ian
Yeah I already tried with the & at the end but its the same exact thing, so maybe it doesnt like to be run by ftp user, but I'm not able to make it run on another user. Maybe I need to add the root user in the passwd and try it again.
gadgetmind 08-31-06, 07:32 AM Yeah I already tried with the & at the end but its the same exact thing, so maybe it doesnt like to be run by ftp user, but I'm not able to make it run on another user. Maybe I need to add the root user in the passwd and try it again.
Did you try with -D ?
Anyway, thanks for trying, but I think I need to get access to a machine to work out what's going wrong. And tonight is my Wedding Anniversary, and I've been warned in advance that neither <grunt> nor "Shhhh!" will be considered to be reasonable responses to my wife trying to converse with me, so programming is right out!
Ian
tohands 08-31-06, 07:33 AM Did you try with -D ?
Anyway, thanks for trying, but I think I need to get access to a machine to work out what's going wrong. And tonight is my Wedding Anniversary, and I've been warned in advance that neither <grunt> nor "Shhhh!" will be considered to be reasonable responses to my wife trying to converse with me, so programming is right out!
Ian
Haha
tohands 08-31-06, 07:34 AM It work with the -D, whats next ?
/hosts # cat test.txt
192.168.1.100 - - [01/Jan/1970:00:58:49 +0000] "GET / HTTP/1.1" 500 0 "" "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6"
tohands 08-31-06, 07:34 AM 84 0 SW pure-ftpd (IDLE)
96 ftp SW ./thttpd -u ftp -l /hosts/test.txt -D
97 0 RW ps -ef
icabrindus 08-31-06, 07:40 AM Yes, memory can fragment. But also bear in mind that the dvdplayer in memory is still the one loaded from the /bin that was mounted when it was launched.
True, but it is located above the /phase2 ramdisk. So it still can be a fragmentation issue.
[/QUOTE]
gadgetmind 08-31-06, 08:01 AM It work with the -D, whats next ?
/hosts # cat test.txt
192.168.1.100 - - [01/Jan/1970:00:58:49 +0000] "GET / HTTP/1.1" 500 0 "" "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6"
Coo, so it looks like it responded to a request from your browser, which suggests that the fork does need attention, but the -D work-around is fine for now.
However, it's flagged an internal server error. Do you have an index.html that's world readable in the dir with thttpd? I guess any other file is find as long as you type this on the end of the IP in your browser.
What did your browser display?
Ian
tohands 08-31-06, 08:04 AM Coo, so it looks like it responded to a request from your browser, which suggests that the fork does need attention, but the -D work-around is fine for now.
However, it's flagged an internal server error. Do you have an index.html that's world readable in the dir with thttpd? I guess any other file is find as long as you type this on the end of the IP in your browser.
What did your browser display?
Ian
Let me create an index.html and tried that
PS: I wish I had VIM editor or some editor in the busybox
tohands 08-31-06, 08:07 AM Ok I put the index.html at the same place that the binary, and it work, I see my index.html without problem
gadgetmind 08-31-06, 08:08 AM Here is the index.html file from the thttpd directory
<HTML>
<HEAD><TITLE>thttpd is running</TITLE></HEAD>
<BODY BGCOLOR="#99cc99" TEXT="#000000" LINK="#2020ff" VLINK="#4040cc">
<H3>thttpd is running</H3>
<P>
Looks like you got it working. Congrats.
<P>
Here's a link to the <A HREF="http://www.acme.com/software/thttpd/">thttpd web pages</A>.
</BODY>
</HTML>
gadgetmind 08-31-06, 08:09 AM Let me create an index.html and tried that
PS: I wish I had VIM editor or some editor in the busybox
I built a new bigbox this morning and uploaded it to Yahoo. It has vi built in.
Ian
gadgetmind 08-31-06, 08:11 AM Ok I put the index.html at the same place that the binary, and it work, I see my index.html without problem
Woohoo, I think that counts as having a web server!
I'll stick that binary in whatever I build next. I suggest we just tolerate having to use -D until I get up the energy to debug why the daemonise is failing.
BTW, the unofficial FAQ here is worth reading - http://halplant.com:88/server/thttpd_FAQ.html
Ian
tohands 08-31-06, 08:12 AM I built a new bigbox this morning and uploaded it to Yahoo. It has vi built in.
Ian
Yeah thanks, I really like VI.
EmuMannen 08-31-06, 08:18 AM About httpd, what I remember (but I might be wrong) is that the busybox version of httpd was quite limited regarding CGI (but I remember that I used it to execute shell-scripts so it wasn't useless). Maybe try cross-compile some other compact httpds and use them insted of the one in busybox? Why not try thttpd (http://www.acme.com/software/thttpd/) or mathopd (http://www.mathopd.org/)...
tohands 08-31-06, 08:19 AM Just to let you know, im a web programmer (got one diploma in software engineering, and one diploma in web programming), so if you need help creating the web stuff to modify the config on the MG35, let me know what you need.
gadgetmind 08-31-06, 08:20 AM BTW, it's worth reading the permissions section of the thttpd help page. It's really fussy. I guess our content needs to either be unpacked from an archive or chmod needs to be used on it all afterwards. (chmod is in the busybox with the 3a firmware)
And webby people around? Some CGI scripts to show system information and to read/write some carefully defined NV parameters would be great!
Ian
icabrindus 08-31-06, 08:21 AM My main box is running like this at the moment.
My net nbtscan contains -
#!/bin/sh
cp /bin/hosts.ini /hosts/hosts
mkdir /net/TERA
Here is what I do in phase1:
mv /bin/nbtscan /bin/nbtscan.bin
cp /cdrom/zz_init/tools/nbtscan.sh /bin/nb
and this is /cdrom/zz_init/tools/nbtscan.sh
#!/bin/lash
cp /bin/nbtscan /phase2 # just a flag file
echo >>/phase2/nbtscan.log
echo >>/phase2/nbtscan.log "nbtscan start..."
echo >>/phase2/nbtscan.log "Parameters: $1 $2 $3 "
/bin/nbtscan.bin $1 $2 $3
echo >>/phase2/nbtscan.log "nbtscan end"
Can you see any error? I didn't find the /phase2/nbtscan.log or /phase2/nbtscan and I cannot see the network server.
I'll try your script.
tohands 08-31-06, 08:21 AM About httpd, what I remember (but I might be wrong) is that the busybox version of httpd was quite limited regarding CGI (but I remember that I used it to execute shell-scripts so it wasn't useless). Maybe try cross-compile some other compact httpds and use them insted of the one in busybox? Why not try thttpd (http://www.acme.com/software/thttpd/) or mathopd (http://www.mathopd.org/)...
Humm, we tried thttpd and it work, do we need something else ?
gadgetmind 08-31-06, 08:23 AM Just to let you know, im a web programmer (got one diploma in software engineering, and one diploma in web programming), so if you need help creating the web stuff to modify the config on the MG35, let me know what you need.
I don't need help creating the web stuff, I simply need someone else to do it in its entirety. :)
I kind of imagined that we've have some scripts (using hush) that called mgnv to fetch strings/values from NV ram. And the same scripts could push parameters typed by the user into mgnv (after sanity checking!)
The first thing I'd like to be able to get/set is the max 64-byte string at offset 316.
mgnv "%s" s:316 will print this.
mgnv s:316="new string" will set it.
Ian
icabrindus 08-31-06, 08:27 AM One last note - I successfully installed the arm-elf-gcc stuff from the link on the wiki - but of course these binaries are compiled for, presumably, x86 Linux - and don't work on cygwin. Has anyone found cygwin binaries and do they have an idiots guide to installing them and then compiling stuff for the mg35?
Can you write a small how-to to put in the wiki?
tohands 08-31-06, 08:27 AM I don't need help creating the web stuff, I simply need someone else to do it in its entirety. :)
Ian
Yeah well thats what I mean :P
gadgetmind 08-31-06, 08:28 AM Can you see any error? I didn't find the /phase2/nbtscan.log or /phase2/nbtscan and I cannot see the network server.
I'll try your script.
You're using lash and this doesn't do very much. Try hush, but someone else found this didn't run their scripts. It certainly runs the ll script I put in /bin
You can test all of this without using the GUI. If you type the nbtscan command line and then check what's in /hosts/hosts and /net you'll know what went wrong.
I also seem to recall that nbtscan was called with five or more parameters.
Ian
gadgetmind 08-31-06, 08:40 AM More on nbtscan.
I've looked more closely and I guess you're testing this by typing -
nb somethingorother
Is the something or other the right nbtscan command line? (Example nbtscan -q -b /net -e 192.168.1.5/24) Which is five parameters!
I might also check the execute bit. These don't seem to matter in a cramFS but might when in a ramfs.
Ian
gadgetmind 08-31-06, 09:33 AM More on thttpd.
Fixing the forking so it auto-daemonises will be messy. Let's just use -D
This "living without fork" document uses thttpd as an example and just shows the code being skipped - this is what -D does but at compile time.
http://docs.blackfin.uclinux.org/doku.php?id=living_without_forks
Also it needs somewhere to log, either syslog or a log file. Dunno why - might be deliberate or might be a bug.
However -
./thttpd -D -u ftp -l /dev/null &
seems to work!
Ian
tohands 08-31-06, 09:41 AM cgi stuff is hard to run, I tried several way right now but it failed, always have something like 403 Forbidden
The requested URL '/cgi-bin/test.cgi' resolves to a file which is marked executable but is not a CGI file; retrieving it is forbidden.
I ran the thttpd like this
./thttpd -D -u ftp -l /dev/null -c /hosts/cgi-bin/*.cgi &
my folder cgi-bin mod is changed to 755, and the test.cgi too. I need to read more about how to run cgi stuff on that thttpd, cause on my debian box, it work like a charm.
andy666 08-31-06, 09:51 AM Can you write a small how-to to put in the wiki?
Alhough it installed without complaining it didn't actually work - because the binaries were incompatible with cygwin - so it would be a "how-not-to" :(
gadgetmind 08-31-06, 09:54 AM cgi stuff is hard to run, I tried several way right now but it failed, always have something like 403 Forbidden
The requested URL '/cgi-bin/test.cgi' resolves to a file which is marked executable but is not a CGI file; retrieving it is forbidden.
I suspect this is a path issue.
The check code says -
/* Is it world-executable and in the CGI area? */
if ( hc->hs->cgi_pattern != (char*) 0 &&
( hc->sb.st_mode & S_IXOTH ) &&
match( hc->hs->cgi_pattern, hc->expnfilename ) )
return cgi( hc );
/* It's not CGI. If it's executable or there's pathinfo, someone's
** trying to either serve or run a non-CGI file as CGI. Either case
** is prohibited.
I suspect tha path is failing.
Hmmm, maybe you need single quotes around your cgi path to stop the shell trying to expand the *.cgi ?
Ian
icabrindus 08-31-06, 09:58 AM More on nbtscan.
I've looked more closely and I guess you're testing this by typing -
nb somethingorother
I might also check the execute bit. These don't seem to matter in a cramFS but might when in a ramfs.
I just wanted to "wrap" the original nbtscan into a script to log its parameters. While it doesn't make much sense for nbtscan, it does for other programs (especially smbmount, since I couldn't figure out the command line to make it connect to my XP server).
The script runs as expected in a telnet session, and the execute bit is already in place. I think I just have to dig a litle more.
Another solution is to write a small native app to do the logging, that's what I intend to do if the script doesn't work in the end... Or use strace, if someone figures out if/how it can work on our machine... So there are plenty of ways to go :)
tohands 08-31-06, 10:08 AM I read that I can use a single file instead of a wildcard, so I tried that way
./thttpd -D -u ftp -l /dev/null -c '/hosts/cgi-bin/test.cgi' &
same error.
also tried without quote
Sylvain R.
I'm curious,
Can the firmware be installed from the network if someone doesn't have a local hd inside the MG-35?
Thanks.
gadgetmind 08-31-06, 11:15 AM I read that I can use a single file instead of a wildcard, so I tried that way
./thttpd -D -u ftp -l /dev/null -c '/hosts/cgi-bin/test.cgi' &
same error.
also tried without quote
Sylvain R.
Try creating cgi-bin as a subdirectory where you have index.html and using something like -
./thttpd -D -u ftp -l /hosts/log -c cgi-bin/printenv
Ian
tohands 08-31-06, 11:49 AM not working, I tried to make a folder and used the -d to tell where the www folder is, same thing with cgi, chmod 777, 755, but no luck yet.
Sylvain
gadgetmind 08-31-06, 11:51 AM not working, I tried to make a folder and used the -d to tell where the www folder is, same thing with cgi, chmod 777, 755, but no luck yet.
Sylvain
I suspect some breakage within thttpd to do with forking to launch cgi on uClinux. I'll stuff in a load of debug at the weekend and see what I can do.
(edit - you will need -nor on the command line to stop it trying to chroot. But I just gave that a quick go and it doesn't help. I still get internal errors.)
Ian
teddystacker 08-31-06, 11:54 AM I'm curious,
Can the firmware be installed from the network if someone doesn't have a local hd inside the MG-35?
Thanks.
Yes
EmuMannen 08-31-06, 02:12 PM Humm, we tried thttpd and it work, do we need something else ?Sorry, thought you where playing with httpd in busybox... mathopd might be worth a try if thttpd isn't delivering though...
gadgetmind 08-31-06, 02:16 PM Sorry, thought you where playing with httpd in busybox... mathopd might be worth a try if thttpd isn't delivering though...
I just wish one of these sodding things would work without such a big struggle.
uClinux is the main problem. :(
Ian
tohands 08-31-06, 11:17 PM ok so the last thing I tried was to create a config
# chroot/nochroot
# Sets whether thttpd will chroot after starting.
# Default: nochroot
nochroot
# user: userid
# Specified which user to switch after intialiazation when started as root.
# Default: www-data
user=ftp
# urlpat: pattern
# urlpat is commented out
# dir: directory
# Specifies a directory to chdir() to after thttpd starts.
# This directory will most likely be the directory you will be serving your
# clients from.
dir=/hosts/www
# cgipat: pattern
# Specifies which URL may contain executable CGI files.
# Default: None
cgipat=cgi-bin/*.cgi
#cgipat=/hosts/www/cgi-bin/*.cgi
same 403 error
gadgetmind 09-01-06, 03:02 AM The 403 looks like a real error. I have gone beyond this but hit another wall (so there's no huge advantage in me debugging your exact case at the moment)
With fork() for the cgi stuff, I get a 500 error.
With these replaced with vfork(), thhtpd seems to be trying to run the cgi application, but everything stalls.
Heavy debug required. :(
If I get cgi going, some of this debug can remain to let us sort your 403.
Ian
Why is it so important to get a webserver running?I don't quite understand 'the roadmap' :) I've read the entire thread but I don't understand why all this effort goes into trying to run binaries (at least it seems like that tot me) on the box. Or is this all forework needed to understand the workings of dvdplayer.bin so that it can be replaced/altered? NOFI, just trying to understand. I have no experience in this embedded systems stuff :)
gadgetmind 09-01-06, 04:08 AM Why is it so important to get a webserver running?I don't quite understand 'the roadmap' :) I've read the entire thread but I don't understand why all this effort goes into trying to run binaries (at least it seems like that tot me) on the box. Or is this all forework needed to understand the workings of dvdplayer.bin so that it can be replaced/altered? NOFI, just trying to understand. I have no experience in this embedded systems stuff :)
I'm not sure that we currently have a roadmap. Maybe we need one!
Currently we're at the "divergent" stage. We need to enable as many people as possible to play with as many ideas as possible. Some of these ideas can go into firmware releases that benefit "end users" and I'm sure many won't.
My thinking behind the web server is that we're going to be adding new configuration options long before dvdplayer.bin is history. We'll need some way to configure there other than the GUI.
Anyway, I like web interfaces on embedded gear. :)
Yesterday I proposed that we start a task lisk. If we stick this on the wiki, people can add to it and make comments.
I'd much rather be doing stuff that people regards as useful.
Ian
|
|