@drewdevault Okay that sounds really cool (and fun). I'd love to learn more about it at some point :)
@drewdevault so bunnix is a standalone endeavour? No external kernel?
@drewdevault you need a break from work, so you write an operating system to relax 😄


@drewdevault@fosstodon.org this is what happens when you let your kernel developers write in rust
@drewdevault@fosstodon.org me, my hobby whiskers twitching: “how would… how would you even start on this? With what the UEFI/bios exposes? Huuuuuh”
Lemme guess, "just a little hobby project, won't ever be as big as MINIX, only supports AT harddisks right now because that's all you have?" 😂
@drewdevault Wait you implemented ext4? I assumed that for this kind of project you'd make a baby's first file system style thing like we did in OS class in uni...
@drewdevault btw, can you read the hand-written text on the bottom? what does it say? i cannot figure it out... 😂
@drewdevault Of course, just the idea of files having different entries in the FS table, but pointing to the same underlying data on disk is still something I find a little bit like black magic. 😂
@drewdevault How does Bunnix differ from Helios? Unikernel vs microkernel?
@drewdevault Dude you're amazing. I've been stuck on just memory management in my hobby kernel for like 6 months now (although truthfully like 6 hours I barely get to work on it), and here you are just pumping out a kernel like it's nothing.
@drewdevault is this part of Helios, or some exploratory alternative?
@drewdevault For the uninformed what does the BSD layout look like? I haven’t given this one much thought since I’ve never had to ship a kernel and user space piece in one package before. I tend to keep them in separate packages and just combine them in one installer as needed (the rare few times I did this).
@drewdevault "A fork() in the road" https://www.microsoft.com/en-us/research/uploads/prod/2019/04/fork-hotos19.pdf
@drewdevault Are there resources that you use or that you'd recommend to someone wanting to learn about these low-level OS topics? Perhaps some books / websites or something like that?
@drewdevault Sorry, no judgement here, just wanted to point out an interesting paper I'd read recently only for the first time. And that perhaps might influence how deeply one plumbs fork as an abstraction into the OS.
@drewdevault Why are signals particularly hard? Because they disrupt the execution flow? It's just like lower-level interruptions, isn't it?
@drewdevault How do you intend on dealing with signals during a blocking syscall? EINTR? Automatic resuming?
@drewdevault interesting OS name... Woont u in Bunnik? 🙂
@drewdevault How does Bunnix relate to Helios? Is it something entirely separate, or is it a POSIX layer working on top of Helios?
Why write one kernel when you can write two, right? 😁
@drewdevault Ah, because Helios is not for fun, it's Serious Business 😉
@drewdevault I guess a scheduler is, by definition, lots of nonlinear code?
Its been fun watching your experiment from the sidelines. 🙂👍
@drewdevault Will the source be made available for folks to gawk at?
@drewdevault Thank you!
FWIW, I did go look at https://sr.ht/~sircmpwn, but didn't see bunnix in the projects (quite possible that I missed it) or recent commits to it (just os/+bunnix commits to hare).
@drewdevault Signals are okay, as long as you offer epoll with signal_fd to tame them!
@drewdevault O_DIRECTORY even caused lots of discussion in the Filesystem working group of the POSIX standards committee.
Are file descriptiors obtained with O_DIRECTORY useful for sync_fd() in your implementation?
@drewdevault then I am doubly curious, what did you change about O_DIRECTORY?
@drewdevault @bugaevc okay, yeah, that is reasonable.
I ask, since I can't count the times I had to explain to someone, that O_RDONLY and O_DIRECTORY both are ways to create file descriptors to a directory, but both are fundamentally different in nature.
(And given that nobody checks return values of fsync() this mistake is unlikely to ever be discovered)
Also, reading from directory fds is a mess and shouldn't be supported by any posix system....
@drewdevault @mxk guess it can be useful — for atomicity, or for reducing the number of file name lookups in find(1)/ftw(3) if readdir returns DT_UNKNOWN — to be able to open() a node first, then fstat it, and if it's a directory do one thing (look up something relative to it with *at()), and do another thing otherwise.
@drewdevault Curiousity: is this just for fun, or do you have any intentions of actually using this for anything / working on it once it's completed?
@drewdevault Wow, you already have enough system calls and /proc support for that? Nice!
@drewdevault Yeah, I'm of the opinion that GNU make is genuinely useful (because significantly more powerful than POSIX make) and it's okay to depend on it.
Until they introduce some stupid circular dependency, of course, but so far they've been careful.
@drewdevault you make bootstrapping look so easy :)
@drewdevault New project: userspace utilities collection a la GNU's, but written in Hare, primarily targeting Bunnix?
@drewdevault Oh, awesome!
So you have your own kernel on bare metal running your own userspace written in your own programming language, that must be so satisfying. Impressive!
@drewdevault does your OS have a global notion of truth in terms of the Mount/Filesystem view, or is it alright connected to the individual process? (In preparation of chroot)
(Just to make getcwd more complicated)
@drewdevault Can you elaborate on why it is so hard? The notion of cwd is simple to understand and I imagine it as something really basic, so what makes getcwd() so difficult?
@drewdevault I see.
For an initial implementation I wouldn't even try to be subtle. The walk cannot fail and is guaranteed to terminate in finite time? I'll stop the world (take a BKL) while doing it, to avoid having to deal with someone rearranging the dirents under my feet.
Of course that doesn't work if you aim to have real-time guarantees, but 🤷
@drewdevault @ska Why not store the original absolute path alongside or in the file description or directory pointer or whatever?
Btw, that’s roughly how Plan 9 does it: http://9p.io/sys/doc/lexnames.pdf
@humm @drewdevault because then you have to change it every time a directory changes under you, which is worse?
@drewdevault so, you for now are relying on your own libc, since you still would require too many additional syscalls for musl to work?
@drewdevault does hare run on non-x86 systems yet? that would be really cool if so
@drewdevault It doesn't make sense to me how fast you hacked this.
It's not just that you need a lot of focus, you really need to know a enough about all the different subsystems too.
@drewdevault Do you really need EFI variables? You can just put your bootloader in esp://EFI/Boot/bootx64.efi. Which is what Asahi does due to a lack of EFI variables on their platform.
@drewdevault@fosstodon.org (sorry for another ping) are you making your own libc for bunnix or are you porting something like musl, uclibc-ng?
@drewdevault@fosstodon.org what C standard does it target C89, C99, C11? Also if you don't mind answering how did you get GCC compiled on that system? Did you do a compiler bootstrap or are you able to just load the binary. One of my favorite parts of OSDev is watching people bootstrap a compiler, libc to start working on userspace
@drewdevault I’ve been keeping up with this thread a bit, I may have missed it but did you ever say what you were using for binaries? I’m curious now, are you doing https://en.wikipedia.org/wiki/A.out (not for you but for anyone reading) elf, or your own thing? ELF is very interesting https://kevinboone.me/elfdemo.html I love to see people writing programs in ELF. I wanted to ask you earlier about PIE and whether that was something you were planning on implementing. Not any pressure (i know it’s just a side project) I just find operating system design very fascinating as a subject.
@drewdevault Errors work too, but great. Glad you didn't spend the effort making it full featured.
@drewdevault Are you trying for the "fastest complete Unix system from scratch" record? 😅
@drewdevault Extra serial serial ports: no interrupts, no task switching, so everything is always very serial!
@drewdevault
Congratulations! 🎉
Pro tip: don't bring your laptop.
@drewdevault well done!
With the TTY handling you have entered another pretty dark corner of POSIX
@drewdevault Congratulations on the wedding, Drew!
🎉 🎉 🎉
@drewdevault Ah, so *that* is how you have been preparing for your wedding. I see 😁
Congratulations, and I'll be taking bets on how many days of computer withdrawal you can stand!
@drewdevault that's great to hear - congratulations and all the best to you both
@drewdevault I had a dream last night where one person was playing doom with a keyboard and others insisted that it's meant to be played with a mouse.
Somehow this video triggered more vivid memories of this weird dream. But please do try out Doom with a mouse.
This message courtesy of Morpheus I guess.
@drewdevault Congratulations to you [both]. I hope you have some beautiful time offline!
@drewdevault that’s awesome. Are you using some existing libraries to implement? Isn’t VT-100/xterm/etc. emulation a horrid mess to implement?
@drewdevault
Why such an old vim, are the newer ones hard to build?
Since you've got lua you might be able to get Neovim building, too.
@drewdevault Can you try skalibs please? I'm interested in seeing the sysdeps of bunnix 🙂 but maybe you don't have Unix domain sockets and fd-passing yet.
@drewdevault since you mentioned ncurses in another post, if you get glib working, we should be able to get finch, the ncurses front end to libpurple, or @pidgin 's cousin should be pretty easy to get going..
@drewdevault@fosstodon.org Do you have guile running?
@drewdevault@fosstodon.org I don't know how hard it would be to port guile but considering who makes it probably really annoying. Since it seems like you don't have a network stack yet... Hm. Do you have make yet? It may also be helpful to try to get python in some sort of running state even if half of it breaks...
@drewdevault@fosstodon.org Yeah, I would say you should probably go for both python and perl since a lot of packages rely on them as build time dependencies. Have you gotten GCC to a bootstrappable state? I'm curious to how you actually have GCC running
@drewdevault I mainly meant can GCC compile itself on your operating system yet? Afaik whenever I used to emerge gcc on Gentoo systems it would compile itself 3 times to “bootstrap”.
@drewdevault@fosstodon.org that just sounds like perl. What shells do you have available?
@drewdevault i'm mostly joking around, i don't know what that entails. does g++ work? :0