I have a (shitty) VFS
That's probably it for day 5, I have other things to do today π
Top-level
Drew DeVault
I have a (shitty) VFS That's probably it for day 5, I have other things to do today π 232 comments
Noodlez :nixos: :neovim: replied to Drew
@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.
Drew DeVault replied to Noodlez :nixos: :neovim:
@noodlez1232 I've done this a few times already, experience makes it easier :) and I still struggle with memory management! In a way it's the hardest part imho
Drew DeVault replied to Drew
Day 7, taking a break to hang out with a friend who's in town, more to come tomorrow
BIG KRIMPIN replied to Drew
@drewdevault but Drew, tomorrow is kingsday, you can't miss out on kingsday!
Drew DeVault replied to Drew
Day 8: let's write a System-V loader and get to userspace also: don't write a USB driver don't write a USB driver don't write a USB driver
Drew DeVault replied to Drew
β Userspace No user I/O yet though so you have to take my word for it
Drew DeVault replied to Drew
Day 8 was all about getting userspace online. We are loading ELF programs, jumping into userspace, and we have working interrupts and syscalls Day 9 will start implementing more useful syscalls and fleshing out I/O
Josef 'Jeff' Sipek replied to Drew
@drewdevault I'm really impressed how quickly you're implementing this.
Drew DeVault replied to Drew
I confess that I rushed into userspace without a plan, so I have a bit of a mess to figure out once I decide how to actually structure the project properly. But that aside, I implemented a handful of syscalls today, notably readv, write, and mmap (MAP_ANON only, for allocations)
_L4NyrlfL1I0 replied to Drew
@drewdevault You're basically at the point where my university's OS exercise starts out. We're given a (IMO pretty horrible) codebase with a basic OS that has a scheduler, page allocator, basic filesystem and block device layer, basic userspace with a few I/O calls, a very non-posix CreateProcess syscall, and a minimal shell to start testcases with. 1/2
Drew DeVault replied to Drew
Okay, reorganized the source tree to make a lot more sense before we move any further into userspace. Took some inspiration from the BSD layouts, since I intend to ship kernel and userspace as one cohesive project.
Drew DeVault replied to Drew
Day 10 is getting fork working (and preemptive multitasking) Getting there.
Carlos O'Donell replied to Drew
@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.
JiΕΓ StrΓ‘nskΓ½ replied to Drew
@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?
Drew DeVault replied to JiΕΓ
@jistr osdev wiki and the manuals/specs for the hardware you want to work with
Drew DeVault replied to Drew
Summary of work up to day 10: * AHCI driver
Drew DeVault replied to Drew
Signals are hard. Might do some refactoring instead, particularly with respect to files
mort replied to Drew
@drewdevault How do you intend on dealing with signals during a blocking syscall? EINTR? Automatic resuming?
Drew DeVault replied to Drew
So today is refactoring, particularly for scheduling and file management.
crypt17 replied to Drew
@drewdevault great to see you having fun hacking. Will enjoy watching the process.
Drew DeVault replied to Drew
Nice, that's the bulk of the scheduler refactoring done. No pretty screenshot since there are no user-visible changes, but the short of it is that we can context switch to and from the kernel rather than only to and from userspace.
Drew DeVault replied to Drew
(no, I have not set up kernel preemption yet, there are no locks in the kernel and interrupts are always disabled when the kernel is running; as a consequence of that I can only cooperatively context switch the kernel right now)
F4GRX SΓΒ©bastien replied to Drew
@drewdevault the joy of the first working context switch <3 congrats!
Drew DeVault replied to Drew
Elaborating a bit: the scheduler can now switch tasks while in the kernel and return to the kernel when the thread wakes up, and accordingly waitqueues have been implemented for this purpose. The problem with console devices is that their file descriptors are fake, namely they do not store an inode reference. This is problematic for a few reasons, such as (1) Bunnix lacks a device file abstraction generally; (2) files without an inode blocks adding fstat; (3) we can't mount them in /dev.
Dima Pasechnik πΊπ¦ π³π± replied to Drew
@drewdevault interesting OS name... Woont u in Bunnik? π
Drew DeVault replied to Dima Pasechnik πΊπ¦ π³π±
@dimpase nee, Bunnix is pas 11 dagen oud! Het heeft geen network, geen shell, geen compiler, etc. |
What's probably next is fleshing out the VFS a bit, then getting to userspace and implementing a few syscalls