HN user

vkoskiv

886 karma
Posts7
Comments168
View on HN

Nice! My keyboard code is still very bare bones, so I interact with my system using debug commands assigned to individual keys.

Since we're both working on a similar project, I think it could be fun to talk about OS development and share our findings (and weird bugs!) I have this same username just about everywhere, so do reach out if you're interested! Best of luck with your project either way :]

My hobby x86 kernel. I'm targeting my 80486DX2-66 PC with 32MB of RAM. This project has had a few false starts over the years, where I lacked the prerequisite knowledge to be able to properly debug things. So while the initial commit is from 2020, most of the progress is from the ~180 or so commits I've done in the last month since I picked it up again in early February. A month ago it booted from a floppy and printed some debug info to the screen showing it set up GDT, IDT and some static page tables. Now I have basic virtual memory with kmalloc()/kfree(), task switching, user mode and a few syscalls, and just this past weekend I got my floppy driver to a state where it can now (semi-)reliably detect and read data off floppy disks. I already have a userspace prototype of an ext2 parser I wrote for this in 2024, so all I need to do now is to bring that code in to the kernel and I should have filesystem support!

It's been a ton of fun to work on. Every subsystem is still flaky so I run into the wackiest bugs imaginable. I'm really grateful for the resources[1] and incredible tooling[2] that enable me to work out my frequent mistakes. I can hardly fathom how Torvalds did this with just his PC running Minix!

No idea how long I'll keep working on it. I think I'd be pretty happy if I got a real-world, non-trivial program running on top of it, but in the meantime it is serving as a good distraction from life worries at least :]

[1]: Intel 80386 Reference Manual, Linux man pages, wiki.osdev.org, various datasheets and the occasional query to ChatGPT free tier.

[2]: QEMU+gdb, Bochs, GCC 9 & binutils

I just checked this, and it seems like GitHub is a bit weird about tracking these. It didn't show up on my profile at all until I just now forked[0] torvalds/linux on GitHub. Now it shows up on my profile on May 9th (author date), but the link to the commit is broken, because repository authors page it points to filters on the commit date, not the author date.

Broken link points here and shows no commits: https://github.com/torvalds/linux/commits?author=vkoskiv&sin...

If I correct the date range to include the maintainer commit date (May 15th), the commit shows up: https://github.com/torvalds/linux/commits?author=vkoskiv&sin...

Also strange that if I only filter on author[1], nothing shows up. Though I suspect that dataset might only be updated periodically.

[0] https://docs.github.com/en/account-and-profile/reference/pro...

[1] https://github.com/torvalds/linux/commits?author=vkoskiv

I wanted to hold off on that upgrade until I found a source of reliable, high-quality PATA SSDs. Haven't looked into that yet, suggestions welcome!

I did a lot of this for my raytracer, c-ray [1]. Originally it was just a self-contained C program, but I got tired of writing buggy and limited asset import/export code, so eventually I put together a minimal public C API [2] that I then wrapped with CPython bindings [3] and some additional python code [4] to expose a more 'pythonic' API. It's all still a WIP, but it has already allowed me to write a Blender plugin [5], so now I can play around with my renderer directly in Blender, and test with more complex scenes others have made.

Fun project, and it's really cool to see my little renderer in the interactive viewport in Blender, but I have also learned that I don't particularly enjoy working with non-trivial amounts of Python code.

[1] https://github.com/vkoskiv/c-ray [2] https://github.com/vkoskiv/c-ray/blob/51a742b2ee4d0b570975cd... [3] https://github.com/vkoskiv/c-ray/tree/51a742b2ee4d0b570975cd... [4] https://github.com/vkoskiv/c-ray/tree/51a742b2ee4d0b570975cd... [5] https://github.com/vkoskiv/c-ray/tree/51a742b2ee4d0b570975cd...

I recently added dual screen support to the ELKS console-direct driver, so if your system has both MDA and CGA cards, you enable CONFIG_CONSOLE_DUAL in your kernel config and select runlevel 5 in /bootopts, it will allocate 4 ttys, with one of them on the MDA display. You can see this setup running on my hardware in this pic in the README:

https://raw.githubusercontent.com/ghaerr/elks/refs/heads/mas...

I could use some help testing it on EGA and VGA hardware, as I don’t have any 8 bit cards for those in my collection.

Wasn't expecting to stay in the top 100 for this long!

Initial C implementation got me to ~70 for a short time, then very sloppy racy pthreads one kept me at the tail end for a bit longer, but my again very sloppy cuda program running on my GTX1070 has me at 35 at the time of writing.

Rough calculation shows it to be doing 28.6MHashes/sec, and I suspect I could do a lot better than that if I knew anything about cuda programming.

I didn't read enough to know how to pick good values for blocks/threads per block, so I just benchmarked all the combinations of powers of two to arrive at the best result.

Really fun challenge!

Would be fun to see the total amount of valid submissions, and maybe the number of leading zeroes of a hash for those of us that need a moment to figure it out from hex in their head :]

Assembly 2 years ago

Heh, my program that just copies the current instruction to +1 wasn't allowed on the board, fair enough I guess :D

Unsigned Commits 2 years ago

My GPG signatures are stored in the git commits themselves, and have nothing to do with GitHub. Anyone can validate them with git-verify-commit(1). They are there to communicate "if you trust my GPG key, you can be certain I made these commits". There is no argument to be made that the signature makes any claim about past or future commits, either.

What a confusing article.

Modeless Vim 3 years ago

Personal anecdote: I've used Vim for many years, but I never progressed much beyond the basics, because I almost never put much active effort into learning more advanced motions. About a year ago, I discovered the Helix editor, which has a (IMO) genius feature, where pressing a key to start a motion or other action pops up a little pop-up box that shows all the possible options. It just perfectly clicks with my brain, I can easily ignore the pop-up once I've got the muscle memory, or I can even disable the pop-ups altogether. It's brilliant for discoverability.

With this, I've passively memorized far more advanced motions in the last 12 months than I did in the ~8 years before that. And since Helix is a vim style editor, many of these motions also work in vim!

I feel like Helix is the perfect editor for people like me who know just enough vim to be comfortable, but never got very deep into customizing or muscle memory with advanced motions. Helix does some things differently compared to Vim, which I hear puts off some more advanced Vim users.

The built-in LSP & highlighting support with a stack-based "jump to symbol" and keybinds to traverse the stack also perfectly maps to how I want to navigate code, it has made me far more productive than ever before.

I'm not affiliated with the project myself, I'm just super happy I found the perfect editor for me :]

Pretty good explanation of why the app I use for sauna and laundry room bookings in my apartment building is more reliable than Nordea's online banking. Not even a month ago, the Nordea app was showing all my bank accounts as having a balance of 0€. Yikes!

Considering what they are working with, I'm surprised they don't have even more downtime.

I learned about LTO a few years ago, and it gave a significant runtime speed boost to my hobby project, but as far as I can tell, CMake still just has `CMAKE_INTERPROCEDURAL_OPTIMIZATION` as a boolean on/off flag, it doesn't seem to let you specify parallel jobs.

For a short time, I had access to photomultiplier night vision hardware when I was in the army in ~2016. I remember spending at least a few hours just looking up at the night sky, seeing it in a way I never had before. Super cool experience, would recommend. Too bad the hardware is so expensive!

G3 PowerBooks and iBooks were the last to feature rounded, protruding Apple logos on the lid (And on the PowerBook, on the bottom as well!) This was before they glowed, and when they appeared upside down to onlookers with the lid up. All G4 models starting with the Titanium PowerBook G4 and everything since have had flush logos.

I figured out a way to not have to paste in manually to the sequence editor. I wrote a script like this:

-----

#!/bin/bash

if [[ ! -f "$1" ]]; then

exit 1

fi

git rev-list --no-merges --date-order --reverse $(git branch -a | grep -v '*' | grep master) | awk '{print "p " $0}' > $1

exit 0

-----

Then I can just:

-----

pushd monorepo

GIT_SEQUENCE_EDITOR=../inject_reflist.sh git rebase -i --root --force-rebase

popd

-----

And off we go! Apparently there were a few branches + merges, and we have some ongoing feature branches, so I need to find a way to bring in branches other than master as well, preferably while conserving the merges as-is, instead of skipping them like I do above.

I too just discovered these a few days ago! I've been trying to work out a satisfactory way to combine multiple repositories into a monorepo at work. Since I'm building a new repo, I'm free to rewrite history, so I've used `git-filter-branch` to modify the sub-repositories into a form suitable for merging (moved all files to subdirectories, matching the final monorepo structure). Merging them with `--allow-unrelated-histories` is... Okay. No conflicts, the linear git log looks good, and I also prepended the module name to commit messages before merging, so it reads well. But the graph is super ugly (Merges with many years of commits in between, because I just merged the repos in one by one). What I'd really like to do is to "zip" all the histories together into a single, linear history, with all the commits in chronological order. Thus far I haven't found a way to do this with git. I'm probably missing some obvious reason why that couldn't work, but I haven't come up with any.