12 votes

What programming/technical projects have you been working on?

This is a recurring post to discuss programming or other technical projects that we've been working on. Tell us about one of your recent projects, either at work or personal projects. What's interesting about it? Are you having trouble with anything?

12 comments

  1. [4]
    Elheffe
    Link
    I am over here struggling with getting my automations working on my home assistant instance and these guys are creating new languages, operating systems, and servers... I am very sus.

    I am over here struggling with getting my automations working on my home assistant instance and these guys are creating new languages, operating systems, and servers... I am very sus.

    10 votes
    1. [3]
      acdw
      Link Parent
      Oh it's a server in awk, for like a very protocol. Matrix it is not 🤣 Home automation, though... Honestly that sounds vv complicated and I'd get frustrated and quit easily!

      Oh it's a server in awk, for like a very protocol. Matrix it is not 🤣

      Home automation, though... Honestly that sounds vv complicated and I'd get frustrated and quit easily!

      3 votes
      1. [2]
        Elheffe
        Link Parent
        I just re-read what I wrote and wanted to be sure I clarify- I am very sus in that I am the odd man out in this group. :D Any coding is mysterious and magic to me. Home Assistant is an awesome...

        I just re-read what I wrote and wanted to be sure I clarify- I am very sus in that I am the odd man out in this group. :D Any coding is mysterious and magic to me. Home Assistant is an awesome system that has great people doing amazing stuff, AND documenting their work! So it is easy for me to copy paste and change a few variables to make my junk work. Which, I still haven't gotten entirely working. Cheers though- you and the rest of the posters here impress me to no end!

        3 votes
        1. acdw
          Link Parent
          Just so you know -- from what I can tell (I'm not a professional coder or anything, just a hobbyist who hangs out online with tech types), that's about 96% of coding ;)

          So it is easy for me to copy paste and change a few variables to make my junk work. Which, I still haven't gotten entirely working.

          Just so you know -- from what I can tell (I'm not a professional coder or anything, just a hobbyist who hangs out online with tech types), that's about 96% of coding ;)

          3 votes
  2. [3]
    ducc
    (edited )
    Link
    I'm still working on my hobby OS, duckOS. Since the last time I posted, I've been working on a window manager / compositor for it called pond along with some graphics libraries to go along with it...

    I'm still working on my hobby OS, duckOS. Since the last time I posted, I've been working on a window manager / compositor for it called pond along with some graphics libraries to go along with it to allow for image and font loading and such.

    I've added a filesystem mounted at /sock called SocketFS in which programs can open a pipe in. Each subsequent program that opens the pipe is treated as a client to the program that created it, so any data they write to it only goes to the server. Conversely, the server can choose which client(s) to write data to. I added a few utility functions to the standard C library to make dealing with this system a bit easier. This way, I can exchange small packets between the window server and the client applications.

    I also added a shared memory system which allows programs to create shared memory regions and give other PIDs read or write access to it through functions called shmcreate (create a new shared memory region and get a unique ID for it), shmallow (allow a PID certain permissions in a shared memory region), shmattach (attach to a shared memory region the process has permission for using its unique ID), and shmdetach (detach from a shared memory region and delete it if no other processes are attached). I use this system to share the framebuffer for each window between the window server and clients. Clients can then write to the framebuffer as they see fit and notify the window manager which areas of the window should be redrawn. I also use shared memory to load fonts in BDF format with the window manager and share them with the clients when they ask for it.

    I also added basic pseudoterminal functionality to the kernel, so PTYs can be opened just like on any other UNIX system by opening /dev/ptmx or by calling posix_openpt() with PTYs in /dev/pts. Because of this, I've finally gotten to the point where I have a very basic terminal application running under pond, although it's pretty buggy at the moment. Here's a screenshot.

    Additionally, I've optimized the multitasking / context switching system in the kernel, although there's still some work to do as it uses a round-robin based approach meaning that each running process has the same priority. Because of this, things can get pretty laggy once you have an application open that's hogging a bunch of CPU time.

    9 votes
    1. [2]
      jgb
      Link Parent
      This looks like a fun project! I had a go at building but hit this error: In file included from /home/jgb/src/duckOS/cmake-build/gcc-9.3.0-build/i686-pc-duckos/libstdc++-v3/include/csignal:42,...

      This looks like a fun project! I had a go at building but hit this error:

      In file included from /home/jgb/src/duckOS/cmake-build/gcc-9.3.0-build/i686-pc-duckos/libstdc++-v3/include/csignal:42,
                       from /home/jgb/src/duckOS/cmake-build/gcc-9.3.0/libstdc++-v3/include/precompiled/stdc++.h:43:
      /home/jgb/src/duckOS/cmake-build/root/usr/include/signal.h:29:10: fatal error: kernel/tasking/Signal.h: No such file or directory
         29 | #include <kernel/tasking/Signal.h>
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~
      compilation terminated.
      make[3]: *** [Makefile:1867: i686-pc-duckos/bits/stdc++.h.gch/O2g.gch] Error 1
      make[3]: *** Waiting for unfinished jobs....
      In file included from /home/jgb/src/duckOS/cmake-build/gcc-9.3.0-build/i686-pc-duckos/libstdc++-v3/include/csignal:42,
                       from /home/jgb/src/duckOS/cmake-build/gcc-9.3.0/libstdc++-v3/include/precompiled/stdc++.h:43:
      /home/jgb/src/duckOS/cmake-build/root/usr/include/signal.h:29:10: fatal error: kernel/tasking/Signal.h: No such file or directory
         29 | #include <kernel/tasking/Signal.h>
            |          ^~~~~~~~~~~~~~~~~~~~~~~~~
      compilation terminated.
      

      Probably just a silly mistake on my part but do you have any ideas how to fix this?

      5 votes
      1. ducc
        (edited )
        Link Parent
        Ah, I think I need to fix the build scripts. Thanks for letting me know. I think you may be able to get around it by copying kernel/tasking/Signal.h to cmake-build/root/usr/include/kernel/Signal.h...

        Ah, I think I need to fix the build scripts. Thanks for letting me know. I think you may be able to get around it by copying kernel/tasking/Signal.h to cmake-build/root/usr/include/kernel/Signal.h in the meantime, but there may be other issues I haven't caught yet since I haven't tried building it from scratch in a while.

        Edit: If you just want to test it, I've uploaded an image you can use here. Just put it in the cmake-build folder and run make qemu-image, or load it up in your virtual machine software of choice.

        5 votes
  3. jgb
    Link
    I've designed and implemented a new configuration language called JACL. It's super alpha and there's a fair few changes I want to make that haven't yet been reflected in the repository (most...

    I've designed and implemented a new configuration language called JACL.

    It's super alpha and there's a fair few changes I want to make that haven't yet been reflected in the repository (most notably: allowing keys for tables as well as objects) but I would still be curious to hear the thoughts of Tildes users.

    This was a serious exercise in yak-shaving for me as this sprung out of an afternoon where I sat down intending to write the new static site generator I mentioned in the homepage thread a couple of days ago. I intend to build that around JACL configs once I am semi-happy with the state of the language.

    4 votes
  4. acdw
    Link
    I've been working on a Gemini server in POSIX Awk. Of course, I've lost the source and I have to find it....

    I've been working on a Gemini server in POSIX Awk. Of course, I've lost the source and I have to find it....

    4 votes
  5. [3]
    thismachine
    Link
    I made a few changes to onhold that makes it faster and more efficient on Unix-like operating systems. onhold is a tool that plays sounds while and after shell jobs complete, and can be used to...

    I made a few changes to onhold that makes it faster and more efficient on Unix-like operating systems.

    onhold is a tool that plays sounds while and after shell jobs complete, and can be used to construct shell pipelines.

    For example, the following will play music while an ISO downloads:

    $ export URL="https://releases.ubuntu.com/20.04.1/ubuntu-20.04.1-desktop-amd64.iso"
    $ http "$URL" | onhold > /dev/null
    

    onhold used to use Python for-loops to iterate over data that was piped into it and pipe it out again. For-loops in Python are slow and I only achieved a max speed of 150MB/s.

    On Unix systems, onhold will open a subshell and use cat to iterate over stdin and then output it. I get speeds of over 3GB/s using this method.

    It's a little convoluted, so I'm hoping I can find a method that's faster and doesn't rely on having a Unix shell available on the system.

    1 vote
    1. [2]
      Liru
      Link Parent
      Probably a silly question, but have you tried using something like os.write(1, os.read(0, 65536)) in a loop?

      Probably a silly question, but have you tried using something like os.write(1, os.read(0, 65536)) in a loop?

      1 vote
      1. thismachine
        Link Parent
        Not silly at all, I ended up using something very much like this.

        Not silly at all, I ended up using something very much like this.

        1 vote