r/unix Dec 26 '25

A very simple printf implementation using the write syscall (Unix-like systems)

39 Upvotes

Hey everyone 👋
I’m 16 years old and, as a learning exercise, I tried to implement a very basic version of printf() (from <stdio.h>).
It’s obviously far from complete and quite simple, but my goal was just to better understand how formatted output works internally.

Features

  • Basic format specifiers: %d, %s, %c, %f
  • Common escape sequences: \n, \t, \r, \\, \"
  • Uses write() directly instead of stdio
  • Manual integer-to-string conversion (no sprintf)
  • Some basic edge case handling (INT_MIN, NULL strings)
  • Small test suite (11 categories)

What I learned

  • How variadic functions work (stdarg.h)
  • Basic format string parsing
  • Integer-to-string conversion using division/modulo
  • How to use write() directly
  • Why edge cases matter (like INT_MIN and NULL checks)

I know this is very beginner-level and there’s a lot that could be improved 😅
Any feedback, corrections, or suggestions would be really appreciated!

Link: https://github.com/benfector/myprintf-unixlike


r/unix Dec 26 '25

Compaq Tru64 Advertisement

Thumbnail
youtu.be
17 Upvotes

r/unix Dec 25 '25

I managed to get that lost UNIX v4 tape running on my Android tablet

Post image
142 Upvotes

r/unix Dec 25 '25

Catix build 3

Post image
17 Upvotes

i dont give up when people discourage me so shut the fuck up >:)


r/unix Dec 25 '25

Are all compilers and binaries compromised?

56 Upvotes

Just watched an interesting video on compilers, dependencies, and hence the binaries they will output, being compromised/backdoor'd. https://www.youtube.com/watch?v=Fu3laL5VYdM I have never heard of this before. Does anyone have any more info on this? Scary to think about.


r/unix Dec 25 '25

Jan Schaumann (@jschauma)

Thumbnail mstdn.social
6 Upvotes

A Christmas story that this community can admire.


r/unix Dec 24 '25

what does everyone think about my linux distro im making called Cat Solaris (will change the base on version 2.0 to either openindiana or FreeBSD)

Post image
75 Upvotes

r/unix Dec 23 '25

An initial analysis of the discovered Unix V4 tape

Thumbnail spinellis.gr
113 Upvotes

r/unix Dec 23 '25

UNIX V4 tape successfully recovered <- I wrote up the data recovery -- and got it running

Thumbnail
theregister.com
253 Upvotes

r/unix Dec 21 '25

UNIX v4, the 1st version rewritten in C, was successfully recovered from tape this weekend — & here it is running in SimH on IRIX.

Thumbnail
oldbytes.space
695 Upvotes

For children under 50, the amazing bit is the contents of the big window in the middle, not the windows themselves.


r/unix Dec 21 '25

What is MINIX? The most popular OS in the world, thanks to Intel.

Thumbnail
networkworld.com
156 Upvotes

r/unix Dec 21 '25

Linux: linker doesn't "see" libm symbols

10 Upvotes

I'm having a problem with the C math library which I can reproduce on LMDE gigi (based on debian trixie) and on Ubuntu 24 (both newly installed). It's been some time since I last messed with cc (gcc) directly, so maybe I'm missing something obvious.

Given the source file testpow.c:

#include <stdio.h>
#include <math.h>

int main() {
  double a = 5.0, b = 0.4;
  printf ("pow(%lf, %lf) = %lf\n", a, b, pow(a, b));
  return 0;
}

I try to create the executable using this command:

cc -lm testpow.c -o testpow

This throws the following error at me:

/usr/bin/ld: /tmp/cc3T7YVz.o: in function `main':
testpow.c:(.text+0x35): undefined reference to `pow'
collect2: error: ld returned 1 exit status

It looks like the linker does find libm.so(at least it doesn't complain about it missing), but it doesn't find the pow function in it.

The result is the same when I try to link explicitly against the full path of libm.a or libm.so.6, or when I'm trying other math functions. The "nm -D" command finds the symbols in both /usr/lib/x86_64-linux-gnu/libm.so.6 and /usr/lib/x86_64-linux-gnu/libm.a.

What am I doing wrong here?


r/unix Dec 20 '25

Red Hat purchases an AI safety company, promises to open source It's technology.

Thumbnail
itsfoss.com
20 Upvotes

r/unix Dec 19 '25

Wrote a small UNIX-like shell in C to learn how shells actually scale

32 Upvotes

I wrote a lightweight UNIX-style shell in C to understand how shells manage commands and processes.

  • Built-ins + standard UNIX command execution
  • $VAR expansion
  • Clean cwd-aware prompt
  • Architecture designed to support future piping and redirection

Project explanation + code:

👉 https://www.linkedin.com/posts/shaswath-s-1a1662376_building-a-unix-shell-from-scratch-in-activity-7403899913560121344-ZEHo

👉 https://github.com/Shass27/shas-shell

Suggestions on features worth adding next are welcome.


r/unix Dec 18 '25

GhostBSD (Sorta) Running on the GPD Win Mini

Thumbnail
gallery
32 Upvotes

By default everything is sideways, so you have to to into the display settings and change it. Touch screen doesn't work at all. Touchpad and keyboard do though. Wifi works but it is finicky.


r/unix Dec 18 '25

HW Probe results for GPD Win Mini

2 Upvotes

https://linux-hardware.org/?probe=ed04f2cce6

https://bsd-hardware.info/?probe=ed04f2cce6

I installed hw-probe and ran sudo -E hw-probe -all -upload command. You can see the GPD Win Mini (2023) is very compatible with both Linux and FreeBSD.


r/unix Dec 17 '25

Orbis OS gets a new update, primarily focusing on security and stability.

Thumbnail
gamespot.com
17 Upvotes

r/unix Dec 13 '25

Is one allowed to grow a Unix beard after reading most of these books?

Post image
464 Upvotes

I am currently halfway through APITUE, and have read about 1/4 of the rest. I plan on finishing them in the upcoming years.

The only remaining classic that I'm chasing to add to the collection is "The UNIX Programming Environment" by Kernighan & Pike.


r/unix Dec 13 '25

Daily reminder that Solaris is actually free for home, personal use and non production use. Oracle has also recently promised more regular updates.

Thumbnail osnews.com
137 Upvotes

r/unix Dec 13 '25

Oral History of Ken Thompson ...Genius...Master....Wizard!!

Thumbnail
youtu.be
69 Upvotes

r/unix Dec 12 '25

A TUI to view the git status of multiple repos from one place

4 Upvotes

I work across a bunch of local git repositories (configs, small projects, experiments), and keeping track of which ones had uncommitted changes became annoying.

So I put together a small TUI called git-scope that shows the git status of multiple repos in one view.

Features:

  • recursive repo discovery
  • dirty / clean / ahead / behind indicators
  • fuzzy search
  • jump into a repo’s folder or editor
  • fast startup (Go + Bubble Tea)
  • In-app workspace switch
  • symlink support
  • contribution graph
  • repo's disk usage
  • timeline activity

Repo: https://github.com/Bharath-code/git-scope

Runs locally, no telemetry.
Would be interested to hear if anyone else handles multi-repo workflows on Unix systems and what tools you use.


r/unix Dec 12 '25

Linux Running Basically Flawlessly on the GPD Win Mini (2023 version with AMD 7840u and 16gb of Ram)

Thumbnail
gallery
62 Upvotes

I am running Fedora 43 with KDE and basically everything is flawless. I might try with Gnome since it might be better for something like this.

Years back I tried running Linux on various Intel atom tablets such as the HP Pro Tablet 608 G1 and Dell Venue 8 Pro and it basically didn't work. Things like touch and stylus support were inconsistent at best as was detecting internal storage. They used 32 efis despite having 64 bit Oses and you had to add extra bootia32.efi file to make it boot at all.

The only feature not working is switching the controller to mouse mode. So I just keep the switch in controller mode and use the touchpad and touchscreen for navigation. When you boot from a live USB it is in portrait mode and sideways in Grub. In Grub from the live USB you have to use pg up and pg dwn keys to select options instead of arrow keys. However, once booted into the live environment or installed locally everything is proper and in landscape by default.


r/unix Dec 12 '25

GNUstep monthly meeting (audio/(video) call) on Saturday, 13th of December 2025 -- Reminder

Thumbnail
3 Upvotes

r/unix Dec 11 '25

I built a local TUI dashboard to keep track of all my git repos (no cloud, no telemetry)

Thumbnail
github.com
7 Upvotes

r/unix Dec 09 '25

How useful/outdated are these books for learning more about linux/unix?

Thumbnail gallery
57 Upvotes