(Topic ID: 135203)

SPIKE Linux Details


By mmetzger

4 years ago



Topic Stats

  • 13 posts
  • 10 Pinsiders participating
  • Latest reply 3 years ago by GreatBug
  • Topic is favorited by 8 Pinsiders

You

Linked Games

No games have been linked to this topic.

    10
    #1 4 years ago

    Got a chance to play around with a SPIKE based game recently and wanted to pass along some details in case they're of any use. Basically, I made an image of the SD card and mounted said image on a Linux system to see what was there. Forgive me if these have been posted before, I hadn't found it in a quick search. Please note this assumes you have knowledge of Linux but I'll be happy to answer whatever I can.

    NOTE: I am posting this simply out of interest for how these devices work and what can be done with them.

    SD Card partition layout:

    Disk Downloads/spike-orig.img: 3904 MB, 3904897024 bytes
    100 heads, 35 sectors/track, 2179 cylinders, total 7626752 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00018e69

    Device Boot Start End Blocks Id System
    Downloads/spike-orig.img1 * 35 6999 3482+ 1 FAT12
    Downloads/spike-orig.img2 7000 13999 3500 da Non-FS data
    Downloads/spike-orig.img3 14000 262499 124250 83 Linux
    Downloads/spike-orig.img4 264192 7329791 3532800 5 Extended
    Downloads/spike-orig.img5 266240 397311 65536 83 Linux
    Downloads/spike-orig.img6 399360 6690815 3145728 83 Linux
    Downloads/spike-orig.img7 6692864 6823935 65536 83 Linux

    So basically what happens when you put this card in a normal Windows / Mac system is you only see the first partition of about 4MB in size even though the card is about 4GB. I haven't verified it, but the file on said partition is called BOOT.BIN. Most ARM based systems will boot off either SD/MicroSD or eMMC if equipped.

    The interesting parts are the Linux partitions (3, 5, 6, 7.) They are attached as follows:

    Partition 3 - Root partition (/) - 114M in size, of which about 27M in use.
    Partition 5 - Data partition (/data) - 58M, 1.4M in use
    Partition 6 - Games partition (/games) - 2.9GB, use varies based on game. This is where the actual game code (i.e., the .SPK you'd pull from Stern's website) resides.
    Partition 7 - Dump partition (/dump) - 54M, 1.3M in use

    Partition 2 I haven't looked specifically into yet, but I think this is where the kernel resides. The "update" script appears to copy some data there.

    The fstab looks as follows:

    # file systems to mount at boot
    rootfs / auto defaults 1 1
    /dev/mmcblk0p5 /data ext3 rw,sync,relatime,exec,data=
    ordered 0 2
    /dev/mmcblk0p6 /games ext3 ro,relatime,errors=continue
    ,exec 0 2
    /dev/mmcblk0p7 /dump ext3 rw,relatime,errors=continue
    ,exec 0 2
    proc /proc proc defaults 0 0
    devpts /dev/pts devpts mode=0620,gid=5 0 0
    usbfs /proc/bus/usb usbfs defaults 0 0
    tmpfs /var/volatile tmpfs defaults 0 0
    tmpfs /dev/shm tmpfs mode=0777 0 0

    Kernel version: 2.6.30

    Interesting kernel modules: amp, backlight, dmd, i2s, at91gpio, USB gadget drivers.

    NOTE: Gadget drivers typically allow a system to act as another device over USB (ethernet, mass storage, serial port.) These may simply be a component of the base Linux system for the ATMEL ARM chip being used. But it would be particularly interesting to plug into an OTG port (I've only seen the topside of the SPIKE MPU - are there any mini/micro USB ports on the bottom?)

    System shell is busybox based

    Hostname is "pinball"

    System starts in run level 2, has 3 startup scripts:

    S20syslog (from what I have gathered so far, nothing is actually logged to the SD card. Good for life of SD card, not great for exploration. Easily modified.)

    S95game (This is a particularly interesting script - it basically runs the game code and sets up everything of interest)

    S99rmnologin (Simply removes the /etc/nologin file if present - this is a busy box script I believe)

    For the S95game script, there's a lot here - I may go into more depth if interest. Some interesting pieces / theories:

    /usr/local/bin/dprint - Looks like this will print a message to the display / DMD. This appears to be correct based on the "update" script referenced below.

    There's a section on updating the "network bridge" - the Linux geek in me wants this to be Ethernet / etc, but I think this is actually the inter-module communication network between the MPU and the playfield area. It specifically mentions updating some of the AVR fuses (note: these have nothing to do with normal fuses) if needed. This could be related to the ATTINY4313 on the MPU near the ARM chip.

    Logging is setup to go to a volatile memory area.

    Once that's all setup, it basically runs /games/game (there's some monitoring / etc in there.) Note that as part of the game code, there is an update script that runs. It appears to check for the presence of the USB sticks and runs through the updates. It appears that linux kernel updates can be included along with game code updates.

    All the binaries I've checked are compiled for 32bit ARM - I tried a quick chroot to see more details, but the architecture didn't match (this is expected - running on a normal Intel system.) I haven't had time yet to load this image on an ARM board and see if I can get more details.

    As for what to do with this - right now, nothing. I'm mostly just exploring to see what's here. Given I don't have my own SPIKE based system to mess with, I'm not sure where this will go.

    Some early thoughts:

    - I get the feeling the OS is based off either an ATMEL reference distribution and / or some previous stuff Stern has used for development. I found an old bashrc file that referenced Transformers and Batman last updated in 2011. The aliases seem to indicate a development environment.

    - From a hardware perspective, the card I had access to was a class 4 4GB card. If this is normal, it doesn't surprise me they had to update things to handle SD card weirdness (class 4 cards of this size are around $5 in single quantities. Class 10 cards are about $7.)

    - If I had a system, I would likely make a copy of the image onto a larger card, perhaps make my own partition in the extra area, and setup logging to go there. Run a game or two and then see what came out on the logs. A few diagnostic commands wouldn't hurt either. The biggest trick is making sure the partition dismounts ok.

    - Which brings up an interesting hardware point - when watching the machine, it appears to have caps that keep some power to the system for quite a while afterwards. Given some of the partitions are mounted RW, this could provide time to shutdown cleanly before offing the card.

    - The game update code looks pretty interesting.

    - Finally, I discovered the game updates do not include the OS itself. Kernel updates appear to be an option for updates but the actual OS isn't part of this. Basically, if (when) the SD cards crap out, they'll have to send out a whole new one to make things work. Just post an image file with basic instructions - people use Win32DiskImager to image Raspberry Pi's all the time. It'd be pretty simple to do the same on here.

    Questions / Suggestions?

    #2 4 years ago

    Gosh all that sounds neat but I have no clue what it means lol. Id like to learn about all this kinda stuff tho

    #3 4 years ago

    This was awesome. Thanks for the great write up. Does the actual game code appear to be a compiled binary? We you able to see any images or sound files?

    #4 4 years ago

    Thanks for sharing your research!

    #5 4 years ago

    do you see anything like
    10 SYS 2062


    thanks for your time on this.

    #6 4 years ago

    Thanks for the info!! While it is all Japanese to me, it would be great if someone could figure out how to display my whoa-nellie mini-dmd images on a full size dmd. Stern says it would require a code re-write, I doubt they will ever do it.

    #7 4 years ago
    Quoted from z28dan:

    Thanks for the info!! While it is all Japanese to me, it would be great if someone could figure out how to display my whoa-nellie mini-dmd images on a full size dmd. Stern says it would require a code re-write, I doubt they will ever do it.

    This doesn't make much sense to me. There's an output signal that drives the tiny screen, and it's the same resolution as a DMD, seems like you should be able to intercept that signal and use it to drive a regular DMD with a minimal interface board. Would only be one brightness level, but it shouldn't take much.

    #8 4 years ago

    Thx for the info.... For those of us with background, it's not greek...

    In the future, lots of options can be added. It's about time we got here (computer based board)..

    #9 4 years ago

    I don't know anything about an interface board. The mini display looked like it was the same proportions and had the same ribbon cable. I powered up a stern 5volt dmd and installed the ribbon cable. I only got the 3 top lines and they were jumbled?
    I would love to use a full dmd incased in an old melon crate as a topper. That little display is too hard to see when checking scores against your opponent or when changing settings.

    #10 4 years ago

    This actually made me snort laughing while reading. Thanks. It's been a bad week and this tear down made me smile.

    #11 4 years ago
    Quoted from bigd1979:

    Gosh all that sounds neat but I have no clue what it means lol. Id like to learn about all this kinda stuff tho

    Pick up a Raspberry Pi - pretty much anything described here applies on those systems. If you break it, you're only out $35-$40 (though you'd have to do something pretty nutty to really break it.)

    Quoted from markmon:

    This was awesome. Thanks for the great write up. Does the actual game code appear to be a compiled binary? We you able to see any images or sound files?

    Can't believe I didn't mention this. It looks like there's a binary itself that is executable, simply named "game" in the /games/<GAMENAME>/ directory. There's also a symbolic link of /games/game that points to the actual game executable. The executable is about 5MB, and there's another file called image.bin which is about 1GB. My guess is this contains all the actual DMD / audio / etc data. I haven't done a binwalk / etc on it yet as I don't have the ARM tools enabled on this VM. I'll try to load it on an ARM system and see what happens. There's also a .hex file included - I'm guessing this is code for some of the embedded micro controllers, possibly throughout the system. The "game" file is not a stripped binary so it *might* be possible to debug it a bit without hitting ARM assembly. Add this to the todo list...

    Quoted from BrianZ:

    Thx for the info.... For those of us with background, it's not greek...
    In the future, lots of options can be added. It's about time we got here (computer based board)..

    The drivers aren't there (yet) but a USB Wifi / Ethernet NIC would be interesting here. I will applaud Stern for not just tossing in networking functionality haphazardly (requires thought re: network / computer security - something that hasn't been needed before.)

    #12 4 years ago
    Quoted from mmetzger:

    The drivers aren't there (yet) but a USB Wifi / Ethernet NIC would be interesting here. I will applaud Stern for not just tossing in networking functionality haphazardly (requires thought re: network / computer security - something that hasn't been needed before.)

    Agreed. But at least the potnential is there. Later, they could enable online tournaments, highscore postings to your favorite web site, ability to play soundtracks while playing the game. Ability for the game to grab it's own future updates.
    Will be intersting what the future holds..

    1 year later
    #13 3 years ago

    Were you able to determine the cat5/rs485 pinout?

    Promoted items from the Pinside Marketplace
    $ 49.95
    $ 5,799.00
    Pinball Machine
    Classic Game Rooms
    $ 60.00
    Playfield - Toys/Add-ons
    Docquest Pinball Mods
    $ 48.00
    Cabinet - Other
    ModFather Pinball Mods
    $ 45.99
    Eproms
    Matt's Basement Arcade
    £ 58.00
    Playfield - Decals
    Sillyoldelf Mods
    £ 45.00
    Lighting - Led
    PinballToys
    $ 10.00
    Cabinet - Sound/Speakers
    Gweem's Mods
    From: $ 99.99
    Cabinet - Other
    Lighted Pinball Mods
    From: $ 99.99
    Cabinet - Other
    Lighted Pinball Mods
    $ 40.00
    Cabinet - Toppers
    Rock Custom Pinball
    $ 5,799.00
    Pinball Machine
    Operation Pinball
    $ 79.99
    Cabinet - Armor And Blades
    PinGraffix Pinside Shop
    $ 1,099.00
    Flipper Parts
    Mircoplayfields
    $ 224.99
    $ 48.00
    Cabinet - Other
    ModFather Pinball Mods
    From: $ 42.00
    Cabinet - Shooter Rods
    ModFather Pinball Mods
    $ 9.95
    Playfield - Plastics
    ULEKstore
    From: $ 41.00
    $ 7,999.00
    Pinball Machine
    Little Shop Of Games
    $ 229.99
    Lighting - Led
    PinballBulbs
    $ 4.49
    Electronics
    Yorktown Parts and Equip
    $ 9.50
    Tools
    PinShield
    $ 69.99
    Playfield - Toys/Add-ons
    Lighted Pinball Mods

    Hey there! Got a moment?

    Great to see you're enjoying Pinside! Did you know Pinside is able to run thanks to donations from our visitors? Please donate to Pinside, support the site and get anext to your username to show for it! Donate to Pinside