Thursday, June 25, 2009

Dual boot installer released

Get it from the google code project download section here.

The README file explains it all. You can flash dual boot in your A320 both from Windows and Linux. Note that the installer will give you the ability to select from original firmware on internal flash or linux on miniSD. The later means the dual boot code will look for a zImage kernel file in the first partition of the miniSD and launch it. That's all.

IMPORTANT: I'm almost 100% sure the ILI9331 variant works fine, but could not test it since the newer A320 (paid by your generous donations) hasn't arrived yet. Postal service sucks big time here. If you have any troubles, please let me know.

Some notes for rootfs developers:
  • The flashed U-Boot environment can't be changed. It just loads a zImage from miniSD and that's all.
  • If you want to pass special command line parameters to the kernel, you must embed them in the zImage (see CONFIG_CMDLINE). That means you need to recompile the kernel.
  • If you want an initramfs, you'll also have to embed it into the kernel (see CONFIG_INITRAMFS_SOURCE).
I guess that U-Boot environment could be read from miniSD, but I don't see the point at the moment and didn't bother to implement. Will do if the need arises.

This is how the installer works: the instructions let you boot a zImage. It's just the kernel with three particularities:
  • The console font size is set to 8x16 (instead of the tiny one).
  • The NAND flash support is enabled and forced to 2K page size (required to properly write the SPL area which is the first eraseblock).
  • There is an embedded initramfs which contains libc, busybox, mtd-tools, dialog, and a script that executes on startup, shows a disclaimer and does the job.
Using Linux to do the actual flashing has the advantage of having a single installer. The instructions for Windows and Linux differ because they use different tools to boot the kernel with embedded initramfs, but once the kernel is running the flashing (or any other task that I might perform) is independent of the PC operating system.

UPDATE 1: yes, the logo is shown even if you are booting into the original firmware. I though it was nice to show it as sort of saying "this A320 is modded to boot linux". However, it can be easily changed if enough people prefer it not shown.

UPDATE 2: please please please read the keyboard related section of this document. It explains the current key map and special key combinations in linux, in particular how to reboot the machine. I've noticed that the immediate reboot key combination (POWER+START+SELECT) is a bit inconvenient if you are rebootint into the original firmware, because you must be quick releasing SELECT or you boot again into linux. This wasn't a problem when boot selection was being done by U-Boot because it takes a little time to load, but now selection is done right in the SPL, in fact the SELECT key state reading is the first thing done. I'll be glad to hear your comments and suggestions on this issue.

UPDATE 3: some clarification: the dual-boot installer lets you boot linux withou having to use a PC. But you had to have linux installed already in your miniSD as described in the QuickStart guide in the wiki section of the google code project page. I guess it's been a bit confusing that I've released a kernel image at the same time than the dual boot installer. You still need to install the root filesystem in a second ext2/ext3 partition.

UPDATE 4: yes, formatting and installing the root filesystem from windows is not yet solved, but it is not difficult and someone (maybe me) will do it soon. All we need is to place the rootfs file in the FAT partition and embed a initramfs into the zImage that will first mount the FAT partition and then the rootfs file as a loopback device.

74 comments:

  1. Awesome ...downloading now

    ReplyDelete
  2. Thanks, downloading now. This is a very awesome thing.

    ReplyDelete
  3. Is it normal to see the Dingux screen every time i boot the dingoo although im not pressing select and that it ends up booting Dingoo's original firmware?

    ReplyDelete
  4. is there a way to fix problems with it being a read only filesystem?

    ReplyDelete
  5. The installation worked fine on mine (ILI9331), and it boots up properly into the existing firmware.

    But when I hold SELECT it stays on the Dingux logo screen for, well, as long as I've left it. Seems to be stuck.

    Have an 8GB micro SD in a mini SD adapter (which works fine with the regular firmware, I can access files etc). It has a 64MB VFAT partition (#1) with the latest 9331 zImage, and the rest of the card is an EXT3 partition with the rootfs extracted.

    ReplyDelete
  6. I was going to say that you had to put the zImage kernel on the vfat partition but it looks like you did that...is it the hex code type b vfat partition that you would have made in fdisk?

    ReplyDelete
  7. If I launch the regular firmware and look at the miniSD in the browser I can see the zImage file there.

    ReplyDelete
  8. Awesome awesome work, just got it up and running, worked perfectly. I thought I initially had a problem booting but it seems the zImage just wasn't being written to the FAT partition correctly, sorted that out and it works great! Anyone having problems are you renaming the zImage to just "zImage", I'm using a kernel I built so it's already called that but that might be a problem if you get the one off google-code.

    ReplyDelete
  9. Wow... okay. That's what I thought I'd done (renamed to zImage), but I just copied it on again and renamed it and this time it actually boots. Maybe I had a stray space character left in the filename? *shrug*

    So, problem solved I guess.

    ReplyDelete
  10. So far, I've gotten the dualboot working, and I can get the zImage to boot. But then the screen starts blinking, and I get an error:

    "Kernel Panic - not syncing: No init found. Try passing init= option to kernel."

    I grabbed the basic rootfs from the google code site, the card is set up as 64M fat32, the rest as Ext3, it's set as readable, and so forth.

    What do I do from here?

    ReplyDelete
  11. @quoadomatic

    The rootfs I provided is just a proof-of-concept and not much can be done. There's people working in getting an optimized and useful rootfs.

    Anyway, to make it rw execute "mount -o remount,rw /".

    @Ganzonet

    Yes. In principle I worked hard to get the LCD working right from the SPL because otherwise the LCD remained dark for some time until the kernel framebuffer driver kicked in, which was a bit confusing.

    Actually it is not required that the splash screen/logo appears if you are booting the original firmware, but I though it would be nice to show it too as sort of saying "this A320 is flashed to boot linux too".

    @Twyst

    Follow carefully the instructions in the QuickStart guide you can get at the wiki section of the google code project page.

    ReplyDelete
  12. Booboo: I've done that. Got a rootFS extracted and all - used that exact command as listed. Ah well, I guess I'll wait for a more "complete/userfriendly" layout - I'll be ready ASAP, since I've got the dual-boot code.

    One thing that would be nice, is make the kernel look at a fat32 partition. I realize a lot of the permissions, etc that linux wants won't work, but it'd make setup a lot simpler.

    ReplyDelete
  13. Perfect,
    Works very well on ILI9325.
    Flashing very simple and very fast.

    Booboo congratulations for all your efforts. You have promised and you did it.

    Very nice job, thanx a lot !!!

    ReplyDelete
  14. Works fine here with ILI9331. Good work!

    Is there a way to modify the boot loader to boot into Linux by default?

    The lingoox.org site is giving 404 errors now, maybe it's possible to make it redirect to this site?

    @Marta: The Linux usbtool uses libusb, which is available on Mac as well. So it might be easy to port.

    ReplyDelete
  15. Maybe you could add a confirm prompt of some kind before rebooting?

    Say if you press Power + Start + Select then it would ask you to press Power (or A or whatever) to restart?

    ReplyDelete
  16. im using windows and when i type boot 0 it just sits there i get download stage one program and execute and nothing happens.

    do i need to put anything on my dingoo before i do this

    thanks

    ReplyDelete
  17. read/write ext2 partitions on windows with http://www.fs-driver.org/

    ReplyDelete
  18. is that in responce to my question?

    ReplyDelete
  19. To all the people who are having problems with the installation, there is a known issue when trying to launch a linux image on the dingoo. When you put your dingoo off, then press B and reset, sometimes it seems the hardware isn't initialized correctly to launch the image.

    To solve this, you have to boot on the original firmware, then press B and reset while it's running, then do the installation steps as usual. The original firmware seems to do something more on the hardware than the boot instructions, this little trick will initialize what is needed in order to run the linux image.

    By the way, Great job for this release booboo. Menus are clear, warning is included, everything is here; nice work.

    ReplyDelete
  20. Works fine here (Display: ILI9331). Thanks!

    ReplyDelete
  21. I already had boot working via usbtool, but after a flash of the dualboot installer, booting to linux just hangs at the dingux splashscreen - any suggestions?

    ReplyDelete
  22. nevermind... I was missing zImage from the fat partition. :)

    ReplyDelete
  23. same here,
    "Kernel Panic - not syncing: No init found. Try passing init= option to kernel."

    Can anyone shed a light on where the problem may be?
    Rootfs? (I did follow the guide...)

    ReplyDelete
  24. @ myself... it's a rootfs issue, reformatted the ext3 and unpacked again, now complaining about can't log to /dev/tty5

    ReplyDelete
  25. mine still freezes at stage 2

    ReplyDelete
  26. @ wendy, I have the same issue on my windows box, usb-boot.exe stay's hanging at stage 1 or stage 2 (depends), used my Ubuntu box to do the flashing and it worked nicely.
    (noob - like me)tip: When unpacking the dual_boot_installer_20090625.zip file on my ubuntu the perms where defaulted to RW for my user only, so to let the sudo commands work you need to do something like
    $ chmod a+rwx *
    in the directory where you unpacked the zip file.

    ReplyDelete
  27. i dont have unbuntu on my system

    ReplyDelete
  28. @Wendy

    Did you install the USB boot driver (Usb_Boot_Driver.inf)? It's in the zip-file.

    ReplyDelete
  29. @Wendy

    After you reset while pressing B, Windows will ask you for a driver. Point Windows to the .inf file that you extracted from the zip-file. If Windows doesn't ask you for a driver, you could also try right-clicking the .inf file and selecting 'Install' from the menu.

    ReplyDelete
  30. i suppose there isn't an "uninstall" procedure...
    Is it possible to restore orginal NAND & Stuff?

    ReplyDelete
  31. ok got so far now buy all i get is a white screen on the dingoo

    ReplyDelete
  32. ok got it installed now but all i get is the dingux splash screen

    ReplyDelete
  33. @Wendy

    You must install not only the zImage but also a rootfs, for which you have to create a second partition, format it as ext2/ext3, unpack the rootfs package, etc. You can follow the steps in the QuickStart guide (googlel code).

    Note that you'll just get a console login prompt and nothing else. Someone has to develop a menu system and such. I don't think it will take very long. I'd like to do it but I think it's more productive if I focus on the kernel.

    ReplyDelete
  34. can i do this under windows enviroment

    ReplyDelete
  35. thanks for all your hard work, booboo! now i just need to get off my ass and order an 8gb microsd with an adapter.

    ReplyDelete
  36. I think i have some issue here, but with the original firmware, i followed the instructions, i followed the ones that appeared on the dingoo, and dual boot was installed. But, whenever i load the original firmware, this one goes slower than before, i cant tell if the games too, but the menu is just not at the same speed as before, theres a delay every time i browse the main menu, going from interesting games to the last icon (system setup) takes longer and gets stucked for really short time in the icons in between (randomly).

    Really, help me out.

    ReplyDelete
  37. same issue here.
    a couple of hours ago I was asking for a "uninstall" in order to return to original NAND... i hope LINGUX installation is reversable...
    TIA

    ReplyDelete
  38. I don't have the menu "hang" but things are indeed "moving" slower in the menu (Dingoo custom FW 1.03TD-2).
    AVI files who worked before don't play smoothly anymore.
    However - very weird - in the mega drive emulator i have no "tearing" on the screen any more when playing Sonic (1) - but still at acceptable speed (aldo i have here also the impression it's a tad slower)...
    I don't get it.... Does the dualboot screen init changes some stuff in the screen driver or so that this happen???

    ReplyDelete
  39. Oh yeah, you are right, the Genesis emulator has less graphical glitches, how come?

    ReplyDelete
  40. Hi there

    I'm still struggling with partitioning the sd card in windows - Anyone here do it ?
    Wendy did you come right? Seems we have the same issue

    ReplyDelete
  41. AFAIK there are no free tools to partition and create ext2/3 partitions under windows. You can however try the http://gparted.sourceforge.net/livecd.php and boot this, If it recognizes your SDcard reader then you can partition your SD card with this . Remove all partitions from the card, create first an FAT32 (dous not need to be big 50mb is more then enough) and then create a ext3 partition as second one....
    With http://www.fs-driver.org/ you can then access ext2/3 partitions on windows.
    If you install Ubuntu then you need to add the "gparted" tool to your installation (not by default installed) screen shots for Ubuntu are found in th guide linked on http://dingoo-scene.blogspot.com/

    ReplyDelete
  42. warning, if you're not very sure about that partitioning stuff, remove/disconnect your harddisk(s) and leave only your dvd drive connected, and boot the "livecd" then from your dvd drive. If you choose the wrong disk in gparted then you lose all your data

    ReplyDelete
  43. I try genesis emulator with few games and it has less graphical glitches but run slowly. Now some games run perfectly and other more slowly. I think the dual-boot do this. very strange...

    ReplyDelete
  44. Polossatik

    Thanks for you advise. I used gparted and i think it worked i got three partitions 1 primary 64mb fat32, one extended and within one logical 1.8gb ext3

    however it does not show up in windows using fs-driver ... it seems to be stopped. Does one "format" ext3 partitions, assign drive letter or what ?

    Advise appreciated!

    thanks

    ReplyDelete
  45. I think you can't see the EXT3 partition from SD. i tried this (fs-driver) and i can see Hard Drive EXT3 only.

    ReplyDelete
  46. yep, sorry, also just tested and it does not shows ext3 on SD... so you need to use a Linux or so.
    On the other side, the current state is not very interesting or usable for "end users", mainly "for fun" or poeple who know Linix very well and can make stuff for this. so maybe someone makes that FAT32 magic so that ext3 partitions are not needed anymore.

    ReplyDelete
  47. okay i know absolutely nothing about linux

    gonna use the "ubuntu live cd"

    can someone give me pointers to the commands i should use to copy the contents of "rootfs-20090518.tar.bz2" from the root of my d: to the ext3 partition on the sd card?

    i know this is a big ask ... thank you

    ReplyDelete
  48. i tell you how i've done, i went to applications-accesories-terminal and type:
    sudo nautilus
    write the password
    and nautilus(explorer) opens
    then locate the ext3 partition of your card and just drag the content in there
    good luck, i have not had it

    ReplyDelete
  49. Thanks Max .. (rolls up sleeves and starts burning the cd)

    ReplyDelete
  50. Well, someone could help me? I've done two partition on my miniSD, the first (fat32) is 3,5Gb and it have only zIMAGE file, the second (ext3) is 300MB and under linux ubuntu I've extracted the file rootfs.tar.bz2 in the partition (i've lotsa folder now (tipical linux folders, bin, etc) but my dingoo still hang in a blank screen after the go 0x80600000 0 command... why? have I to copy the rootfs file in ext3 WITHOUT extract it?

    ReplyDelete
  51. This might be a stupid question, but since the graphical errors are fixed for the Genesis, is the Y/B problem fixed for whatever reason?

    ReplyDelete
  52. I finally get it working!!
    for those with the freeze problem when booting dingux, after you've done de two partitions and put into the second (ext3) the contents of the rootfs file (all the folders typical linux extructure) MAKE SURE to:
    1-get from here: http://code.google.com/p/dingoo-linux/downloads/list the file zImage-20090625-ILI9325/or/ILI9331
    2-once donwloaded rename it to zimage
    3-the copy zimage to the first partition (fat32), i've used ubuntu to do that, and make sure theres nothing else into that partition, only that file, also check that th size of the file once copied is 1016, because i've already copied it but it had been misscopied cause the size was 0kb

    Good luck!

    now i'd like to know what can i do from the command line of the dingux because i can't write anything, in which directory of the ext3 partition must i copied, for example, scummvm?

    Thanks again!! this is great!

    ReplyDelete
  53. I've done like Max but I have no luck.

    When I digit boot 0 my dingoo will hang always in a blank screen... it's normal?

    ReplyDelete
  54. I compiled "usbtool" for Mac OS X:
    http://www.treewalker.org/dingux/

    I successfully booted Linux from my MacBook using this. However, I already had an SD card prepared with an ext3 file system using my Linux desktop; it might be a bit of a challenge to create the ext3 root fs using only a Mac.

    ReplyDelete
  55. When linux boots up for the first time, all the txt is backwards. I can navigate and 'click' yes through the setup menus but it's all reversed. When my dingoo reboots and I hold select, it freezes at the dingux splash screen, but again its all backwards. What did I do wrong?

    ReplyDelete
  56. Right ... Max and others helping me (thank)

    I booted linux last night (ubuntu cd) and managed to get the two partitions created. Furthermore, i managed (in ubuntu) to copy the zlimage to the fat32 partition. okay so far ..

    Then I move onto the ext3 partition I have read access to it, but cannot copy anything on to it. looking at permission only "root" has read and write, so I changed the password of root account, loggedout (ubuntu user seems to always log in automatically) and tried to log in as root. I told me root could not login through the login screen (????).I then opened up a terminal and tried to login as root. said somthing about sh, so i typied sh. Then it complained about utmf or something (sorry cannot remember).

    At the end of the day just want to copy files to the ext3, and need to login as root (can someone give me a pointer on how to do this please - Please remember I am booting ubuntu from the cd image, not on my hdd

    Thanks

    ReplyDelete
  57. Thanks mth. Truth is, I already dusted off my Ubuntu netbook and Windows notebook to do it. :P

    ReplyDelete
  58. @Booboo

    Thanks for all your hard work!

    Anyway, I have a small question about programming for Dingux: Is interprocess communication possible? I try to do ::socket(PF_LOCAL, SOCK_STREAM, 0), but this action fails.

    ReplyDelete
  59. Can boot fully into linux now, but all txt is reversed/mirrored still.

    ReplyDelete
  60. Have you got the x760+ yet booboo?

    ReplyDelete
  61. @master: Yes the kernel released has no networking support.
    I have compiled one, that you can get here:
    http://cyberic.free.fr/Dingoo/zImage

    It is for the ILI9325 dingoos only.

    I was able to start xwindow, xeyes, mplayer and so on...

    I don't know where to post the news, there are so many forums about dingux...

    ReplyDelete
  62. Silly question, but is it possible to acces the dingoo when booted in Linux besides using the serial interface?

    ReplyDelete
  63. @Eric.

    Thanks! I'll try that image.

    Currently, I'm having a bit of a problem: my Dingoo freezes at the Dingux logo screen when I try to boot into Linux (still with original Booboo firmware). It worked before.

    ReplyDelete
  64. >my Dingoo freezes
    It seems to be okay if I first right-click on the FAT drive in Windows and select 'Eject'. After the sound that the eja..uhm..ejecting is finished, rebooting into Linux works :)

    ReplyDelete
  65. @Eric

    With your zImage, I'm able to run Qt Embedded examples now. Input does not seem to work yet but I didn't spent much time configuring the Qt build (except for using mipsel toolchain).

    ReplyDelete
  66. @master: please contact me cyberic99, on gmail, I have some apps ready (xmms, madplay, xserver etc...)...

    We have to agree on a common and compatible package structure.

    cyberic

    ReplyDelete
  67. Is there any way to install this without a MiniSD card? or is there no handy way to fiddle with the partition tables of the Dingoo? I'm primarily interested as there doesn't seem to be a native C64 emulator.

    ReplyDelete
  68. Hi
    i try here.

    I have a problem with my start button on my dingo A320 ILI9331.

    Anyone can help me for build a new dualboot installer with another command to confirm the flash of the nand for install dualboot

    Thans a lot in advance...

    ReplyDelete