Better Dreamcast Linux?

Discussion in 'Sega Dreamcast Development and Research' started by TerdFerguson, Sep 19, 2017.

  1. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    I'm just kicking this idea around. Making this for semi-serious hypothetical discussion. Might've even made a thread like this before

    The last easily accessible CDI image of Dreamcast Linux is from around 2001. A crapload of Dreamcast developments have been made since then. SD card support, Dreampi, KOS is not in an infantile state, etc

    I think it would be pretty fantastic to see a better Dreamcast Linux made for 2017. Primarily with a writable filesystem using an SD card with added support for the G2 modem and the mouse. I know people will say an SD card over the serial bus doesn't have adequate bandwidth, but the CD filesystem can be used for core files that are used most frequently and shouldn't need writing to(like runtime libraries). I've run Redhat on an SD card on a full PC, speed wasn't great, but it certainly wasn't awful

    It'd be fascinating and fun to dick around with that. Compiling sources, installing packages with dpkg, getting a desktop environment like LXDE to work and seeing how far you can deck it out with visual stuff before it becomes slow\unstable\unusable

    But that raises some questions, which is why i'm posting this.

    Are there any practical uses, developmental or otherwise, for a "complete"\improved Dreamcast Linux release? Could a retail unit become KOS devbox worthy this way? (KOSbox?) Is GPU\SPU acceleration possible(From what I understand, just the CPU\RAM is all Linux is using on DC)? What would 3D gaming performance be like? Is the hardware adequate enough for an HTML5 web browser?

    I know there is FreeBSD, but IMO Linux is more approachable and has more sources\applications\docs already

    I think this would be a fairly interesting hypothetical discussion is all. Curious what others think. And maybe it'll plant a seed for someone with the aptitude to give a LinuxDC with writable filesystem a whirl

    Thoughts?
     
    pool7 and frogz2007 like this.
  2. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,031
    Likes Received:
    889
    DreamShell/(KalistiOS) is basically that. It's a unix-like OS, although not Linux per se.

    The DC is a very low power computer, so I doubt one would get better performances using a custom linux build than DreamShell.
     
    Last edited: Sep 19, 2017
  3. rso

    rso Gone. See y'all elsewhere, maybe.

    Joined:
    Mar 26, 2010
    Messages:
    2,190
    Likes Received:
    447
    Don't forget that the kernel has put on a bit of weight during the last sixteen years. You used to be able to fit a whole system including userspace on a floppy, and now the kernel I'm currently running is 5.7 megs (that's compressed, with only the stuff relevant for my machine compiled in, and no userland whatsoever). Once that lardass of a kernel has uncompressed itself all over your RAM, I bet there isn't gonna be a lot left over.
     
  4. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,031
    Likes Received:
    889
    You'd probably be able to make a lightweight kernel by removing a ton of protocols/hardware the Dreamcast doesn't need or support.
    Just removing modern CPU support (SSE, HTT, etc.) and replacing it for the kinda-crude SH4 would probably save a ton of space.
    See this: https://tiny.wiki.kernel.org/
     
    Last edited: Sep 19, 2017
  5. rso

    rso Gone. See y'all elsewhere, maybe.

    Joined:
    Mar 26, 2010
    Messages:
    2,190
    Likes Received:
    447
    With serious tradeoffs, maybe. For a sensible set of features, how about we take a look at TinyCore: their kernel's smaller than mine, but still 3.7 megs (again, compressed). You probably won't get very much below that. (Unless you can live without any kind of networking, that's a pretty large pile of code.)

    I suggest you look into NetBSD instead. They may even still produce up-to-date packages for you to use, out of habit ("of course it runs NetBSD") edit: they do
     
  6. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,031
    Likes Received:
    889
    I'm not saying one should try to make linux run on the DC. I think a better time investment would be to helping SWAT add features to DreamShell.

    You're comparing apples to oranges with TinyCore though. Even TinyCore does support modern x86_64 i3/5/7 CPUs (+amd) with complex and extensives opcodes (SSE/HTT/etc) and modern RAM, different types of them with different speeds and timing, and all kind of filesystems and interfaces like serial/usb/parallel/bluetooth/thunderwirebirdfire.

    For a fixed hardware setup, like the DC. It should be possible to make a very tiny linux kernel. It'd only support ONE old CPU, ONE type of RAM, ONE filesystem, etc. But it should be possible to make it very small.

    Haha freaking NetBSD!
     
  7. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    another thing to note is the current LinuxDC build has the filesystem mounted to RAM, and it can still load up xFree86 with decent performance, I think it can even play doom(pretty sure its on the CD, just needed some CFG stuff i didn't setup). if the filesystem was mounted to a combo of CD and SD you have a vastly greater amount of memory to work with

    As for BSD, i tried for a few hours one day when i had a BBA to get the NFS up and running, but it was too complicated on the serverside to get a Linux<-->BSD NFS up and running, and i'm fairly familiar with Linux though not an expert. The main problem for both is no writable filesystem, so its more or less a novelty without one

    Hypothetically speaking, I'd assume if someone can write drivers for the G2 modem and a writable block device driver for SD cards over serial bus, pruning the kernel would be a breeze
     
  8. rso

    rso Gone. See y'all elsewhere, maybe.

    Joined:
    Mar 26, 2010
    Messages:
    2,190
    Likes Received:
    447
    G2 bus, modem and BBA, as well as HDD drivers good enough for ya? NetBSD already has those. No SD though afaict on short notice**.
    Any good reason why it absolutely, positively has to be Linux?

    ** edit: you might not want that anyways since that's be the same port that the serial console is tied to, too. I imagine that would interfere with the SD card.
     
    Last edited: Sep 19, 2017
    -=FamilyGuy=- likes this.
  9. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    hmm i wasn't aware it had modem too, did they get a mouse driver yet? in the OP i said mouse driver, but the current Linux release has one

    just general approachability. Both for casual Linux users and people who've never used it before. AFAIK there's extensively more application source code, apt repositories, documentation, etc. along with it being easier to get help on whether it be from google or specifics on linux-questions or something. if you can compile Linux applications using BSD then that's my novice naivety showing. but essentially its just easier to navigate and get going IMO

    Again hypothetically speaking, AFAIK if there was a modem driver I suppose you could just use PuTTY on the Dreamcast's LAN address to access the remote console. Most people who have a modem connection are using Dreampi, PC<-->DC, or Netopia router, all which assign LAN IPs to the Dreamcast. Serial cables are a bitch to build or rare\expensive anyway, though i did manage to get two for a good price

    the problem with HDD is you need to either A.) solder a 40-pin IDE cable to piggyback the GD-ROM or B.) get one of those cheap IDE boards from china, but that requires a BIOS modded console (difficult or expensive for most people) and i've heard its almost impossible to order one from the website without paying someone to do it who speaks the language. I think an SD adapter is like $20~ (i have Helder's internal SD board)

    So generally for using Linux and SD filesystem its just for approachability, ease of use, less expensive, more sources, more documentation etc
     
  10. rso

    rso Gone. See y'all elsewhere, maybe.

    Joined:
    Mar 26, 2010
    Messages:
    2,190
    Likes Received:
    447
    > did they get a mouse driver yet?
    https://www.netbsd.org/ports/dreamcast/faq.html

    > more application source code, apt repositories
    nbsd has its ports tree (a mostly automated system to compile whatever packages you might want). works fine, just might take a while for bigger packages. and in any case, i bet you'd be hard pressed to find a lot of sh4 apt repos.

    > if there was a modem driver I suppose you could just use PuTTY on the Dreamcast's LAN address to access the remote console
    you could, but the system would still be throwing output toward the serial port. i'm sure you can turn that off (point it elsewhere), just don't ask me how.

    > "approachability"
    > unix-like os on a long dead console
    riiight :p


    btw, i just noticed the linux kernel still has all the necessary bits for dc support in it (wouldn't have guessed, because the xbox parts didn't even carry over into the 3.x series iirc) so how about test compiling a kernel to see what works?
    oh and i assume you know about linux-dc? they got some drivers too, but appear to be focussed on 2.6.
     
    Last edited: Sep 19, 2017
  11. megavolt85

    megavolt85 Peppy Member

    Joined:
    Jan 8, 2015
    Messages:
    311
    Likes Received:
    454
    Kernel is small part. Need port many lib's

    why SD? may be HDD?

    PC read SD card over fasted SDIO interface, dreamcast use for read slow soft SPI
     
    rso and -=FamilyGuy=- like this.
  12. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    Yes, but files necessary for writing, like dpkg config & package list files (etc, a lot more) can be symbol linked to the serial SD device. that way you can install packages. that's just one example. but without a writable filesystem you can't get beyond "apt-get"

    bulk of the kernel can remain on CD, but use SD for essential user writing like files for dpkg configs

    HDD + BIOS mod is expensive or difficult, you still require keyboard + mouse + VGA + Dreampi\Other

    I know the existing sources for Dreamcast have glibc ported, I'd assume a few others. but they're old
    http://web.archive.org/web/20061015204905/http://www.linuxdevices.com/articles/AT7466555948.html
    (files still hosted!)


    we are on an obscure retro gaming forum in a long dead console's development sub-forum so lol

    I don't see why the old drivers won't still work. Would the driver operations for the hardware change that drastically? I thought part of updating the kernel effectively was not breaking all of the legacy code?

    What i find most interesting though is what I mentioned before about GPU\SPU acceleration and actually using this hypothetical Linux release to see how far the hardware can be taken in different aspects. Fancy desktop enviroment, 3D rendering, HTML5, maybe even Dreameye apps. Once you have a well crafted kernel and a reliable writable filesystem the possibilities are very interesting

    edit: I assume most of the KOS libraries for Dreamcast hardware would still work for LinuxDC applications when linux is running on the target hardware, correct? Applications compiled by the Dreamcast should also be able to be distributed via repository
     
    Last edited: Sep 19, 2017
    Anthony817 likes this.
  13. Flash

    Flash Dauntless Member

    Joined:
    Oct 18, 2011
    Messages:
    739
    Likes Received:
    67
    I think best DC linux will be linux from scratch, based on embedded versions designed for low RAM environment. But TBH there's no real reason for using linux on weak consoles such as DC/PS2/Wii when you can buy ARM-based SBC or computer stick for the price of a good steak. If you want to run some software on those consoles better to do it just by going homebrew SDK/native app route.
     
    TerdFerguson likes this.
  14. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,031
    Likes Received:
    889
    Just to chime in again. If you want to use the DC as a general purpose computer, it's really not a good choice of hardware today. Linux or not.

    Now if you have a specific purpose/program and you want to only run a single task at the time, it can be a good choice (e.g. a game, an emulator, a browser, a speasheet program, etc.). But instead of loading a complete modern OS like linux or netBSD, DreamShell should do the trick. If your really only need to run a single program in a lightweight environment, KallistiOS should give your program the same functionalities as an OS, but only include what's really needed for it.

    KallistiOS is still in active, abeit slow, development by Lawrence Sebald, aka BlueCrab, here: https://github.com/ljsebald/KallistiOS.
    He did a very great job modernising it in the last few years. Time spent trying to get a modern Linux working on the DC would be better spent adding functionalities/drivers to KallistiOS or DreamShell.
     
    rso likes this.
  15. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    I agree

    for me, i'd just have fun messing around with it, seeing how much\how far it can go before the hardware is maxed out. like trying to get various desktop environments to work, 3D stuff, etc etc

    just tossing ideas around in a hypothetical manner, not a demand nor request
     
    Anthony817 likes this.
  16. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,031
    Likes Received:
    889
    If you wanna spend the time porting the right librairies, you could probably make some (very) minimalist desktop environment work on KallistiOS/DreamShell. Something like X with TWM. Even if you try to go the linux route you might have to port those, so nothing would be lost.
     
  17. TerdFerguson

    TerdFerguson ls ~/

    Joined:
    Apr 27, 2015
    Messages:
    664
    Likes Received:
    353
    It looks like LXDE is already available for SH4
    https://packages.debian.org/search?arch=sh4&keywords=lxde

    Actually that's one of the main reasons i made the OP. If you can write to the dpkg\apt configs & pkg lists, you'd be able to install that on Dreamcast already, provided you also have more than 6mb~ of RAMFS space, which we don't. A LOT of other stuff is available too for SH4 in a few repos

    In my opinion, might get flamed for it, but I think Dreamshell is as much of an OS as Planetweb with a LUA and (i think) python processor. It's great for what it's for, playing games. But I don't see it ever being in the same county as a Linux distro, and the effort to bring it to par would be exponentially greater than cross compiling a custom linux kernel with essential runtime libraries and "build essential" libraries + serial block device drivers, which there is massive amounts of documentation for doing

    edit: more SH4 DE's
    https://packages.debian.org/search?arch=sh4&keywords=xfce4
    https://packages.debian.org/search?arch=sh4&keywords=gnome
     
  18. rso

    rso Gone. See y'all elsewhere, maybe.

    Joined:
    Mar 26, 2010
    Messages:
    2,190
    Likes Received:
    447
    Before you jump in right at the deep end: Have you succeeded in paring down a Debian install (doesn't matter what platform, but PC or some ARM SBC would be the easy choices) to run in less than, say, 32 megs of RAM (just leave the rest unused) before? If not, I suggest you try that first - see how far you get with just a base system, and then with a DE.
     
  19. -=FamilyGuy=-

    -=FamilyGuy=- Site Supporter 2049

    Joined:
    Mar 3, 2007
    Messages:
    3,031
    Likes Received:
    889
    That!

    Get a Raspberry Pi or a beagleboard and make your own minimalistic Linux build on it. Then do it again but smaller. You'll learn precious skills doing that that would be transferable to the DC project if you end up doing it for real.

    You can't magically install everything because you have Linux. Porting is a complex tedious task, each program/lib and its dependencies have to be ported for it to be available.
     
    Last edited: Sep 20, 2017
  20. Anthony817

    Anthony817 Familiar Face

    Joined:
    May 12, 2010
    Messages:
    1,078
    Likes Received:
    534
    While that is very true, the purpose of messing with something like this incites the tinkerer in all of us.

    I recently got an Intel Compute Stick clone, to do a lot of the same stuff people do on a Pi, but with a lot more power. Still, that is not to say I wouldn't want to tinker with stuff on a Pi or Dreamcast too. I love doing a lot of stuff like that on my modded Xbox too. The whole point is to have fun, and get a system to do something completely different than it was designed for.

    But, I will have to agree with you that Dreamshell is where it is going to be at as far as future developments go. Dreamshell might not have all the same functionality you would want or expect from a DC Linux build, but it is actually getting pretty advanced, and SWAT and Megavolt have really given it a lot of great new features.

    Pretty much any DC app just about can be run from inside of it, and you can even have nice auto launching desktop icons of apps or games, just like a PC.
     
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page