(_____(_____________(#)~~~~~~

  • 5 Posts
  • 159 Comments
Joined 3 years ago
cake
Cake day: April 11th, 2022

help-circle

  • COW filesystems like BTRFS/ZFS with btrbk/sanoid are great for this. Only the initial copy may take a while, but after that it only takes the delta between the source and the destination to synchronize. On my main Server I have the OS on a single drive with BTRFS and all the actual data lives on a 4 disk zpool in raidz2. I have cron jobs set up to do hourly snapshots on both and I keep about a week worth of history. The BTRFS one gets synced to an external drive every 24 hours, while the zpool gets synced to another external 4 disk zpool on a weekly basis.





  • Interesting feature, I had no idea. I just verified this with gcc and indeed the return register is always set to 0 before returning unless otherwise specified.

    spoiler
    int main(void)
    {
        int foo = 10;
    }
    

    produces:

    push   %rbp
    mov    %rsp,%rbp
    movl   $0xa,-0x4(%rbp) # Move 10 to stack variable
    mov    $0x0,%eax       # Return 0
    pop    %rbp
    ret
    
    int main(void)
    {
        int foo = 10;
        return foo;
    }
    

    produces:

    push   %rbp
    mov    %rsp,%rbp
    movl   $0xa,-0x4(%rbp) # Move 10 to stack variable
    mov    -0x4(%rbp),%eax # Return foo
    pop    %rbp
    ret
    







  • I don’t know about the Pinephone Pro since I don’t have one (I was talking about the Pinebook Pro which I do have and since the Pinephone Pro is basically just a Pinebook Pro that fits in your pocket most things apply to both) but I would only recommend Pine64 stuff in general if you’re into hacking and tinkering with hardware. Any smartphone that is supported by a Linux distro like postmarketOS or Armbian will probably work fine.


  • Yeah touch screens are one of the worst input methods that exist. Whenever I use them they never work reliably and there is also some noticeable input lag that makes everything feel more sluggish than it is. They’re tolerable with a stylus but still inferior in every way compared to physical buttons. Using a touch screen for any serious stuff sounds like purgatory to me lol. My parents are still using their “dumb” phones for basically the reasons you described.

    I have a Pinebook Pro which has the same processor as the Pinephone Pro but slightly higher clocked and with a docking station it’s a pretty usable machine (aside from some buggy proprietary drivers that require a custom Kernel). Most FOSS games just work on it without issue but 3D games are a bit problematic since the libre graphics driver is the product of reverse engineering. I got OpenMW to compile and run on it once but it was barely playable due to lacking OpenGL features. Minetest runs a lot better but had random slow downs in large open areas when I tried it.

    Unless chip makers start publishing low level documentation none of these machines will ever work 100%. I do have hope that China will change this sometime in the future.


  • I agree. On top of that manufacturers can decide when a device is “obsolete” since most smartphone’s bootloaders are locked and even if they aren’t flashing a different OS on them may be impossible due to a lack of drivers because all the information of how they work on a low level is proprietary. It just pisses me off when I see these pocket computers that are sometimes more capable than most office PCs getting thrown out simply because some capitalists decided “this is now obsolete, go buy the new thing” even though there is nothing wrong with the hardware.

    Also I think all current mobile operating systems are terrible. Their UIs suck and they’re massively bloated. Not only are most “Apps” just nodejs/wasm bundled with the chromium browser, but every “App” is also running inside a container/sandbox (which is hilarious, because chromium is already running tabs in a sandbox afaik). Even if you have an App that isn’t just a webpage inside chromium it will still be anything but native. The whole “App” architecture is so abstract and inefficient it’s offensive.

    The only “smartphone” I’d be OK with using would be one where I can boot my own custom Linux Kernel, install all the software that I’m already used to and copy over all my configs and shell scripts to achieve the same workflow I have on all my other machines.




  • Your CPU has big registers, so why not use them!

    #include <x86intrin.h>
    #include <stdio.h>
    
    static int increment_one(int input)
    {
        int __attribute__((aligned(32))) result[8]; 
        __m256i v = _mm256_set_epi32(0, 0, 0, 0, 0, 0, 1, input);
        v = (__m256i)_mm256_hadd_ps((__m256)v, (__m256)v);
        _mm256_store_si256((__m256i *)result, v);
        return *result;
    }
    
    int main(void)
    {
        int input = 19;
        printf("Input: %d, Incremented output: %d\n", input, increment_one(input));
        return 0;
    }