Live data from Hacker News

The little book about OS development

littleosbook.github.io

11–20 of 46 posts

Re: The little book about OS development

#11
post #9
post #5

Other than the educational value of doing so, what would be a reason to write a brand new operating system? Obviously there is a lot to learn about existing operating systems by coding you own, much in the way that writing a new languages teaches you about existing languages, but what are some creative applications of a hand made operating system?

I know Ive wanted to make changes to my own for a while. At very least default ui, menus and shortcuts after installation. These are modtly ux changes though Additionally theres a few features I would prefer from a security user experience standpoint - symlinks are indexed anD the move or deletion of the target would trigger a "would you like to change/delete the symlink as well?" - all applications run in a containe…

> symlinks are indexed anD the move or deletion of the target would trigger a "would you like to change/delete the symlink as well?"

Patch your coreutils. Difficulty: easy.

Most of your other needs can be addressed by making a specialized Linux distro (difficulty: hard), rather than writing a kernel that does all of this (difficulty: max). Build your packages to be containerized by default. I suggest using chroot containers and writing some kind of FUSE filesystem to mount in the container and provide controlled access to user files. You'll also want to write or modify a Wayland compositor to suit your needs. You can have this provide the permission prompts and similar things. Difficulty: hard, but very much doable.

Skills to learn: Linux, thoroughly. You should be comfortable making packages, running things in containers, and writing C before you embark on this.

You should definitely build this. I'm working on something similar but my design appeals to fewer people. Feel free to reach out to me if you have questions with anything, email is in my profile.

Re: The little book about OS development

#12
post #5

Other than the educational value of doing so, what would be a reason to write a brand new operating system? Obviously there is a lot to learn about existing operating systems by coding you own, much in the way that writing a new languages teaches you about existing languages, but what are some creative applications of a hand made operating system?

It's fun.

Re: The little book about OS development

#14
post #9
post #5

Other than the educational value of doing so, what would be a reason to write a brand new operating system? Obviously there is a lot to learn about existing operating systems by coding you own, much in the way that writing a new languages teaches you about existing languages, but what are some creative applications of a hand made operating system?

I know Ive wanted to make changes to my own for a while. At very least default ui, menus and shortcuts after installation. These are modtly ux changes though Additionally theres a few features I would prefer from a security user experience standpoint - symlinks are indexed anD the move or deletion of the target would trigger a "would you like to change/delete the symlink as well?" - all applications run in a containe…

Several of the features you've described are present in mobile operating systems, like Android and iOS. For example, "the application can never touch os filesystem or know about other apps but themself and what the user allows" and "requests for hardware trigger permission dialog". Android and iOS both have this model. Most of what you've described can be implemented in the application layer, and don't require writing a new kernel, and the few others could be implemented with small patches to existing well-established kernels like Linux or FreeBSD. We've already got the infrastructure for the container-related features you've described, so implementing what you want is a matter of creating an system-level policy that allows applications to only run in containers and enforces the other restrictions you've described.

Re: The little book about OS development

#15
post #10

This is probably a good thread to ask: one of my hobby projects is writing an OS, but for x86-64. My next task is user mode, and while I feel pretty solid conceptually, the details around the TSS and such I'm much shakier on. Does anyone have a good, detailed, with-code resource on such things?

I'm part-way through my implementation of an x86_64 experimental OS and had to address all the issues you're facing right now. I didn't really document my process, but the code to get everything booted into x64 mode is there, including setting up the TSS. https://github.com/beevik/MonkOS In particular, the bootloader: https://github.com/beevik/MonkOS/blob/master/boot/loader.asm

Neat thanks! I will check it out. It's really the context switching itself that's the trickiest part, I think. Or all of it. To me, it feels exactly like when I was learning about interrupts: while I was doing it, it was so tough... but as soon as I got something working, it made perfect sense and I wondered why I found it so hard in the first place.

Re: The little book about OS development

#16
post #10

Earlier quoted context omitted.

I'm part-way through my implementation of an x86_64 experimental OS and had to address all the issues you're facing right now. I didn't really document my process, but the code to get everything booted into x64 mode is there, including setting up the TSS. https://github.com/beevik/MonkOS In particular, the bootloader: https://github.com/beevik/MonkOS/blob/master/boot/loader.asm

Neat thanks! I will check it out. It's really the context switching itself that's the trickiest part, I think. Or all of it. To me, it feels exactly like when I was learning about interrupts: while I was doing it, it was so tough... but as soon as I got something working, it made perfect sense and I wondered why I found it so hard in the first place.

One resource I found myself consulting over and over again was the Intel Architecture Software Development manuals (https://software.intel.com/en-us/articles/intel-sdm). They're huge and obviously a bit dry, but they had about 90% of what I needed to know about x86 memory architecture and interrupts.

I included some other resources I consulted in the README. The OSDev wiki (http://wiki.osdev.org/Main_Page) is also good, although I found some of it to be dated or incorrect.

Good luck on developing your OS. Even though I'm not finished, it's been an extraordinarily valuable and educational process.

Re: The little book about OS development

#17
post #2

Original link [pdf]: http://littleosbook.github.io/book.pdf HTML version: http://littleosbook.github.io/ Source: https://github.com/littleosbook/littleosbook 2015 Discussion: https://news.ycombinator.com/item?id=8866912 reddit: https://www.reddit.com/r/programming/duplicates/2rx3wq/the_l...

Thanks, we've updated the link from http://feederio.com/book/37/the-little-book-about-os-develop....

Re: The little book about OS development

#18
post #16

Earlier quoted context omitted.

Neat thanks! I will check it out. It's really the context switching itself that's the trickiest part, I think. Or all of it. To me, it feels exactly like when I was learning about interrupts: while I was doing it, it was so tough... but as soon as I got something working, it made perfect sense and I wondered why I found it so hard in the first place.

One resource I found myself consulting over and over again was the Intel Architecture Software Development manuals ( https://software.intel.com/en-us/articles/intel-sdm ). They're huge and obviously a bit dry, but they had about 90% of what I needed to know about x86 memory architecture and interrupts. I included some other resources I consulted in the README. The OSDev wiki ( http://wiki.osdev.org/Main_Page ) is als…

Yeah, I probably need to just take a weekend day and actually read rather than skim and look for secondary sources. The OSDev wiki's pages on this particular topic are all kind of okay, but often aren't talking about long mode, only protected mode, or only have bits and pieces.

Thank you! Good luck with finishing yours, as though these things are ever finished :)

Re: The little book about OS development

#19
post #9

Earlier quoted context omitted.

I know Ive wanted to make changes to my own for a while. At very least default ui, menus and shortcuts after installation. These are modtly ux changes though Additionally theres a few features I would prefer from a security user experience standpoint - symlinks are indexed anD the move or deletion of the target would trigger a "would you like to change/delete the symlink as well?" - all applications run in a containe…

Several of the features you've described are present in mobile operating systems, like Android and iOS. For example, "the application can never touch os filesystem or know about other apps but themself and what the user allows" and "requests for hardware trigger permission dialog" . Android and iOS both have this model. Most of what you've described can be implemented in the application layer, and don't require writi…

Many of the features are certainly inspired by mobile and docker and related technologies certainly it seem possible.

I guess writing a new kernal is more for rasberry pi/odroid/dev boards? In that case having a detailed explaination on it would be nice

Re: The little book about OS development

#20
post #5

Other than the educational value of doing so, what would be a reason to write a brand new operating system? Obviously there is a lot to learn about existing operating systems by coding you own, much in the way that writing a new languages teaches you about existing languages, but what are some creative applications of a hand made operating system?

Well, for one thing, you can explore computing ideas and paradigms that fall outside the realm of UNIX. What if instead of a filesystem, there was a persistant collection of live objects (with attributes and functions and everything), like Smalltalk? How about a system where there's a unified abstraction for both network and local I/O, ala plan9?

How about some new idea that hasn't been tried before? Maybe you'll find a better way of doing things.

Post reply on HN