Xodein wrote:
As a third-year college student, I embarked on a journey to learn OS development and low-level programming. Initially enticed by a video series titled 'Write Your Own Operating System,' I dove headfirst into this complex field without a solid foundation of knowledge. Now, after seven months of development, I find myself at a crossroads. While I recognize the importance of starting with smaller, more manageable projects, I've invested significant time into this endeavor, hoping to present it as my finishing project in college. However, I feel lost and uncertain about the next steps. I'm open to any advice or suggestions to improve my project and would greatly appreciate any insights. Thank you, and have a nice day.
https://github.com/eraykaradag/CernOSIt will very much depend on your interests in OS development. Personally, my interests are:
- Page based memory management and address space isolation. This is the most portable means of isolating process address spaces, instead of for example hardware segmentation (a-la x86).
- Multi-threading.
- Multi-processing.
So my initial goals were to see how easy it is to implement paged address spaces with copy on write sharing.
So I'm probably a
Lino_Commando aiming for
Stan_Dard (I want a POSIX like system.)
Based on that, I started with the
Meaty_Skeleton, and from there, started with simple threading and task switching, then added page based address spaces, then added multiple address spaces (with a process abstraction), then added user space.
At this point, I needed something to actually load binaries from of course, so I did a simple ustar based filesystem driver to mount as the root filesystem, which used a grub loaded tar file as a ramdisk. Thus began my VFS. It was also at this point that I made my paging demand loading, the page fault handler interacting with the VFS on demand to load pages and handle copy on write.
Once I'd made it to user space, it was then a question of porting a libc (currently using PDCLIB, but looking at newlib) and getting some simple user processes up and running. fork/exec allowed me to port a simple shell and run static binary commands.
Along this way, I developed whatever tools/code I needed. I found that I was doing a lot of map like work (key/value lookups), so my primary data structure is a key/value map, with various implementations to cater for different use cases.
I started my kernel heap allocator as a pretty standard slab allocator, but noticed how trivially easy this made it to go from a pointer to the allocation details, and built on top of that a simple mark/sweep garbage collector.
But, if it's any consolation, getting lost is probably very typical. I got lost several times, especially implementing complex things like a USB core.