Project Description

The Steam Deck is a portable gaming handheld built around platform technology similar to the one found in AMD mobile laptops. Vendor Valve ships a custom Linux distribution with downstream patches on this device, but booting into other distributions is possible. Connecting the Steam Deck to a dock can turn it into a compact workstation.

While a lot of patches have been upstreamed or rewritten for upstream, some upstream-only issues persist. Archlinux users work around this by just using Valve's downstream versions which is not the route I would like to take.

I already had a chance to explore these issues last year and got a lot of help from cool developers such as tiwai. But I did not get as far as I would have liked. I want to revisit these issues and learn more about kernel work. As a kernel newbie I am looking forward to learning more.

I appreciate help, pointers, tips and tricks from experienced maintainers. Kernel newbies such as myself are also very welcome to join, too. Some open issues already contain commands that you can use to collect information and help you learn, so make sure to take a look at the existing Bugzilla reports.

Goal for this Hackweek

  • retest known issues with the latest Tumbleweed snapshot
  • figure out how to collect useful information and research around drivers
  • revive these open issues and hopefully come closer to finding a solution
  • learn a bunch about the kernel, drivers and debugging (probably mostly ALSA ASoC, DRM, x86_64 ACPI)
  • try patching the Tumbleweed kernel and see what happens
  • write a small blog post about how it went including some photos

Resources

  • Currently open issues: https://bugzilla.opensuse.org/buglist.cgi?quicksearch=steam+deck
  • Valve hosts their source code as src.tar.gz containing bare git repos: https://steamdeck-packages.steamos.cloud/archlinux-mirror/sources/jupiter-main/

Looking for hackers with the skills:

steam steamdeck kernel drivers

This project is part of:

Hack Week 22

Activity

  • almost 2 years ago: okurz liked this project.
  • almost 2 years ago: nkrapp liked this project.
  • almost 2 years ago: tjyrinki_suse liked this project.
  • almost 2 years ago: dfaggioli liked this project.
  • almost 2 years ago: dgedon liked this project.
  • almost 2 years ago: robert.richardson liked this project.
  • almost 2 years ago: tschmitz started this project.
  • almost 2 years ago: tschmitz added keyword "steam" to this project.
  • almost 2 years ago: tschmitz added keyword "steamdeck" to this project.
  • almost 2 years ago: tschmitz added keyword "kernel" to this project.
  • almost 2 years ago: tschmitz added keyword "drivers" to this project.
  • almost 2 years ago: tschmitz originated this project.

  • Comments

    • tschmitz
      almost 2 years ago by tschmitz | Reply

      bugzilla#1202570 I cannot say much about since I do not understand all existing power states. Suspension works fine.

    • tschmitz
      almost 2 years ago by tschmitz | Reply

      bugzilla#1202566 I cannot replicate on the kernel package from the main repo.

    Similar Projects

    Improve UML page fault handler by ptesarik

    Description

    Improve UML handling of segmentation faults in kernel mode. Although such page faults are generally caused by a kernel bug, it is annoying if they cause an infinite loop, or panic the kernel. More importantly, a robust implementation allows to write KUnit tests for various guard pages, preventing potential kernel self-protection regressions.

    Goals

    Convert the UML page fault handler to use oops_* helpers, go through a few review rounds and finally get my patch series merged in 6.14.

    Resources

    Wrong initial attempt: https://lore.kernel.org/lkml/20231215121431.680-1-petrtesarik@huaweicloud.com/T/


    Officially Become a Kernel Hacker! by m.crivellari

    Description

    My studies as well my spare time are dedicated to the Linux Kernel. Currently I'm focusing on interrupts on x86_64, but my interests are not restricted to one specific topic, for now.

    I also "played" a little bit with kernel modules (ie lantern, a toy packet analyzer) and I've added a new syscall in order read from a task A, the memory of a task B.

    Maybe this will be a good chance to...

    Goals

    • create my first kernel patch

    Resources

    Achivements


    Modernize ocfs2 by goldwynr

    Ocfs2 has gone into a stage of neglect and disrepair. Modernize the code to generate enough interest.

    Goals: * Change the mount sequence to use fscontext * Move from using bufferhead to bio/folios * Use iomap * Run it through xfstests


    Kill DMA and DMA32 memory zones by ptesarik

    Description

    Provide a better allocator for DMA-capable buffers, making the DMA and DMA32 zones obsolete.

    Goals

    Make a PoC kernel which can boot a x86 VM and a Raspberry Pi (because early RPi4 boards have some of the weirdest DMA constraints).

    Resources

    • LPC2024 talk:
    • video:


    early stage kdump support by mbrugger

    Project Description

    When we experience a early boot crash, we are not able to analyze the kernel dump, as user-space wasn't able to load the crash system. The idea is to make the crash system compiled into the host kernel (think of initramfs) so that we can create a kernel dump really early in the boot process.

    Goal for the Hackweeks

    1. Investigate if this is possible and the implications it would have (done in HW21)
    2. Hack up a PoC (done in HW22 and HW23)
    3. Prepare RFC series (giving it's only one week, we are entering wishful thinking territory here).

    update HW23

    • I was able to include the crash kernel into the kernel Image.
    • I'll need to find a way to load that from init/main.c:start_kernel() probably after kcsan_init()
    • I workaround for a smoke test was to hack kexec_file_load() systemcall which has two problems:
      1. My initramfs in the porduction kernel does not have a new enough kexec version, that's not a blocker but where the week ended
      2. As the crash kernel is part of init.data it will be already stale once I can call kexec_file_load() from user-space.

    The solution is probably to rewrite the POC so that the invocation can be done from init.text (that's my theory) but I'm not sure if I can reuse the kexec infrastructure in the kernel from there, which I rely on heavily.

    update HW24

    • Day1
      • rebased on v6.12 with no problems others then me breaking the config
      • setting up a new compilation and qemu/virtme env
      • getting desperate as nothing works that used to work
    • Day 2
      • getting to call the invocation of loading the early kernel from __init after kcsan_init()
    • Day 3

      • fix problem of memdup not being able to alloc so much memory... use 64K page sizes for now
      • code refactoring
      • I'm now able to load the crash kernel
      • When using virtme I can boot into the crash kernel, also it doesn't boot completely (major milestone!), crash in elfcorehdr_read_notes()
    • Day 4

      • crash systems crashes (no pun intended) in copy_old_mempage() link; will need to understand elfcorehdr...
      • call path vmcore_init() -> parse_crash_elf_headers() -> elfcorehdr_read() -> read_from_oldmem() -> copy_oldmem_page() -> copy_to_iter()
    • Day 5

      • hacking arch/arm64/kernel/crash_dump.c:copy_old_mempage() to see if crash system really starts. It does.
      • fun fact: retested with more reserved memory and with UEFI FW, host kernel crashes in init but directly starts the crash kernel, so it works (somehow) \o/
    • TODOs

      • fix elfcorehdr so that we actually can make use of all this...
      • test where in the boot __init() chain we can/should call kexec_early_dump()


    Create DRM drivers for VESA and EFI framebuffers by tdz

    Description

    We already have simpledrm for firmware framebuffers. But the driver is originally for ARM boards, not PCs. It is already overloaded with code to support both use cases. At the same time it is missing possible features for VESA and EFI, such as palette modes or EDID support. We should have DRM drivers for VESA and EFI interfaces. The infrastructure exists already and initial drivers can be forked from simpledrm.

    Goals

    • Initially, a bare driver for VESA or EFI should be created. It can take functionality from simpledrm.
    • Then we can begin to add additional features. The boot loader can provide EDID data. With VGA hardware, VESA can support paletted modes or color management. Example code exists in vesafb.


    Create a DRM driver for VGA video cards by tdz

    Yes, those VGA video cards. The goal of this project is to implement a DRM graphics driver for such devices. While actual hardware is hard to obtain or even run today, qemu emulates VGA output.

    VGA has a number of limitations, which make this project interesting.

    • There are only 640x480 pixels (or less) on the screen. That resolution is also a soft lower limit imposed by DRM. It's mostly a problem for desktop environments though.
    • Desktop environments assume 16 million colors, but there are only 16 colors with VGA. VGA's 256 color palette is not available at 640x480. We can choose those 16 colors freely. The interesting part is how to choose them. We have to build a palette for the displayed frame and map each color to one of the palette's 16 entries. This is called dithering, and VGA's limitations are a good opportunity to learn about dithering algorithms.
    • VGA has an interesting memory layout. Most graphics devices use linear framebuffers, which store the pixels byte by byte. VGA uses 4 bitplanes instead. Plane 0 holds all bits 0 of all pixels. Plane 1 holds all bits 1 of all pixels, and so on.

    The driver will probably not be useful to many people. But, if finished, it can serve as test environment for low-level hardware. There's some interest in supporting old Amiga and Atari framebuffers in DRM. Those systems have similar limitations as VGA, but are harder to obtain and test with. With qemu, the VGA driver could fill this gap.

    Apart from the Wikipedia entry, good resources on VGA are at osdev.net and FreeVGA