I needed a break from Real Work, so I'm speedrunning writing a Unix-ish operating system
Day 3
I needed a break from Real Work, so I'm speedrunning writing a Unix-ish operating system
Day 3
@ezpy Hare
@drewdevault Writing in C?
The hacking shall continue until we are self hosting
Further day 3 progress
Day 4
End of day 3
mood
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?" 😂
End of day 4: ext4 works but needs to be integrated into the filesystem abstraction (which also needs to be fleshed out)
Maybe VFS tomorrow?
Starting to get lwext4 rigged into the Bunnix filesystem abstraction
Did anyone else think inodes were black magic when they first got into Unix
It can read files from the Linux install on my laptop :D
Work progresses on integrating ext4 with the Bunnix filesystem API
This screenshot brought to you by fs::* rather than lwext4::*
I have a (shitty) VFS
That's probably it for day 5, I have other things to do today 🙂
What's probably next is fleshing out the VFS a bit, then getting to userspace and implementing a few syscalls
Day 7, taking a break to hang out with a friend who's in town, more to come tomorrow
@bigkrimpin I ain't no fuckin monarchist
@drewdevault but Drew, tomorrow is kingsday, you can't miss out on kingsday!
Hey my waitqueue implementation worked on the first try
(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)
So today is refactoring, particularly for scheduling and file management.
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.
Signals are hard. Might do some refactoring instead, particularly with respect to files
ayy
Summary of work up to day 10:
* AHCI driver
* MBR and GPT partitions
* ext4
* VFS
* Userspace
* Preemptive multitasking
* Syscalls: readv, writev, lseek, close, mmap, munmap, mprotect, fork, execve
Next up is signals and waitpid? Or openat et al. We shall see.
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.
Day 10 is getting fork working (and preemptive multitasking)
Getting there.
There we go!
exec works, but there's still some kind of bug in fork+exec
Okay, now you don't have to take my word for it
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
There we go. That's probably all for today.
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)
✓ ELF loader
✓ Userspace
No user I/O yet though so you have to take my word for it
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
open syscall works, though it's kind of shitty
End of day 11:
New syscalls: getpid, getppid, openat
Scheduler refactored, AHCI driver yields while waiting on I/O and handles errors from the block device properly
Some filesystem refactoring done: inodes moved around in the codebase, fs::walk can terminate at the last entry (e.g. for creat(2) or mkdir, etc)
Next up is probably one of the following:
* Implement console device files
* finish openat (i.e. flags like O_CREAT, enforce RDONLY etc)
* inode lifecycle
* signals/waitpid
GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.
All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.