Coder Social home page Coder Social logo

sdcard's Introduction

WARNING!

This repository is Archive project for building MiyooCFW image file! Updated & current method for making OS under https://github.com/MiyooCFW/buildroot

SD Card Setup

Repository with some binaries and scripts to assemble a Custom FirmWare image for "Miyoo" devices (Bittboys, PocketGo V1, Powkiddy V90, Q90, Q20 mini, SUP M3 and XYC Q8).

TL;DR: to generate a minimal image, run ./generate_image_file.sh on a linux system (some standard packages are required on the host; x86_64 only).

The output will be a cfw-dev-<DATE>.img file which can be written onto a micro sd card.

By default, it is aimed at Powkiddy V90 or Q90. You can change which handheld it should be running on by editing boot/console.cfg (or console.cfg on the BOOT partition) and changing the value of the variable there to the name of one of the subdirectories in boot/variants (case matters).

When booted for the first time, the boot splash logo may be upside-down or even not appearing at all; in any case please wait about 30 seconds (maybe more if your sd card is big) or until you see the screen turn off, and then turn the handheld off. The subsequent boots should be "normal".

Description of various parts of what is here

There are essentially four "ingredients" that go into the image: u-boot (the bootloader), the kernel plus modules and support programs, root filesystem, and apps/emulators/ports,...

All of these can (in principle) be compiled from source. This repo has only binary images, not sources.

Structure

Main partition/file structure.

boot:
|   boot.scr
|   console.cfg
|   version.cfg
|   firstboot
|   suniv-f1c500s-miyoo.dtb
|   
├── misc
|   ├── backup
|   |       boot.cmd
|   |       boot.scr
|   |       generate_image_file.sh
|   |       gen_boot_scr.sh
|   |       inittab
|   |       main
|   |       README.md
|   |       suniv-f1c500s-miyoo.dtb
|   |       
|   ├── bin
|   |       busybox
|   |       fatlabel
|   |       fatresize_hc
|   |       fsck.fat
|   |       mkfs.fat
|   |       README.md
|   |       
|   └── u-boot-bins
|           u-boot-bittboy2x.bin
|           u-boot-bittboy3.5.bin
|           u-boot-bittboy3.bin
|           u-boot-v90_q90_pocketgo.bin
|           
├── configs
|      manifest
|
└── logo
       boot-logo
    

main:
|   options.cfg
|
├── apps
├── emus
├── games
├── gmenu2x
└── roms

U-Boot

The main repository for the source code is [here][uboot].

The u-boot binaries differ from handheld to handheld (because they all initalise the screen, which is different); the binaries are here in boot/misc/u-boot-bins.

This is the code that runs the first thing after boot, and is responsible for the "Miyoo CFW" splash image. It reads boot.scr file from the first partition on the micro SD card and executes instructions in it. For reproducing this file from source, have a look at the README in boot/misc/backup.

Currently this file reads console.cfg, loads the correct kernel from variants/$CONSOLE_VARIANT and hands over to it.

Linux kernel

In the current arrangements, all the kernel-related files are in boot/variants/$CONSOLE_VARIANT subdirectories; these (can) also differ between the handheld variants. The main ones are zImage (which is the main "kernel") and then some drivers named *.ko. Any special module loading logic on boot can be in modules.custom.sh script.

There are two more userspace programs that talk to the kernel & modules, namely [daemon][daemon] and [miyooctl][miyooctl]. These are called/loaded from normalboot.custom.sh script. miyooctl lets the drivers know which "version" of hardware should they expect; daemon monitors for some keypad shortcuts. These can be cross-compiled from the sources linked above, using the proper toolchain.

The custom 4.14.0 linux kernel sources are in [this repository][kernel]. In the current form (2021-04-06) they compile into a kernel that works at least on Bittboy v3.5 and Powkiddy V90; this is the one supplied in boot/variants/{v90_q90,bittboy3.5}. All the other variants supplied here contain the kernel and modules taken from CFW 1.3.3 release.

Root filesystem

This is what becomes the / directory when linux runs. This can be in principle compiled from [these sources][buildroot], but at the moment (2021-04-06) the buildroot configuration does not match the archived binary supplied here (as rootfs.tar.xz) which is essentially the root filesystem used on CFW 1.3.3. (I.e. if you compile rootfs from the buildroot and replace the one here, many apps/emus will stop working; this is musl-vs-uclibc issue.).

The really custom bits in rootfs.tar.xz that need carrying over if you compile your own are etc/inittab, etc/main and having /boot and /mnt directories.

However one very useful thing that can be squeezed from the current buildroot is a toolchain. Just run make sdk in the buildroot.

Main partition

These are apps/emulators/ports/games that run on the device. The required one being [gmenu2x][gmenunx]. Here supplied in the main directory. All binaries, taken directly from CFW 1.3.3 release.

For recompiling you need to track down their source yourself (other than [gmenu2x][gmenunx]). There are a couple of free homebrew roms included here, to be able to test the image. Please see the credits below!

We have also options.cfg which make different modules/binaries toggle-able, by changing value to "1":
MODULES_CUSTOM=0 - enable loading custom modules script.
FAT_CHECK=0 - disable FSCK checks (you can run them still manually from apps section with fsck tool)
BOOT_LOGO=0 - disable startup logo screen with this option, without necessity of removing it.
FLIP=0 - flips the displayed image when using default fb driver (only when modules.custom.sh is off).
TVMODE=0 - enable PAL for TV output, otherwise use NTSC.

Default values if none is provided or if lacking options.cfg:

MODULES_CUSTOM=1
FAT_CHECK=1
BOOT_LOGO=1
FLIP=0
TVMODE=0

Included Games/ROMs/credits

sdcard's People

Contributors

apaczer avatar flabbergast avatar nfriedly avatar salvacam avatar tiopex avatar triforcex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

sdcard's Issues

เย้รจ

pm grant by4a.setedit22 android.permission.WRITE_SECURE_SETTINGS

Building u-boot from source breaks things

I'd like to vote for the revert of 388ae6e, and a redo of it:

  • Adds .idea folder, which is IDE files that should be gitignored
  • Sets default device to bitboy, which is NOT what the wiki says
  • Breaks builds for v90_q90, even after setting platform back in /boot/console.cfg and in the generate script. gmenu2 segfaults according to my logs.

We should revert this ASAP and redo it cleaner.

How to do I add gba games

I tried creating a GBA folder and added all my gmaes there, but it is unable to run the game am I am missing the requried bios? If so how do I add bios.

Thanks in advanced

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.