Live data from Hacker News

BareMetal OS: A 64-bit Operating System in only 16KiB

blog.returninfinity.com

31–40 of 40 posts

Re: BareMetal OS: A 64-bit Operating System in only 16KiB

#31

Wow, from the queue presentation this OS looks even less usable than DOS (MS aka Q). Why would the CLI terminate when it runs a programme? How do you run more than one programme at once? If each core polls the run queue does that mean that it busy cycles when there is no more work to do? Won't this waste energy? (A sin in the HPC world). Does it do the same for IO? IO request completion on a slow and/or busy disk cou…

The MIT guys have already created a port?/reengineering? of 6th edition, check out xv6: http://pdos.csail.mit.edu/6.828/2009/xv6-book/index.html

Re: BareMetal OS: A 64-bit Operating System in only 16KiB

#32

Could be useful if it did something new - support virtual apps, manage restartable/persistent state processes, something. Just another thread/memory/interrupt kernel? Why?

while it might eventually have some value, the effort itself is noteworthy, even if it is just a proof of concept.

Re: BareMetal OS: A 64-bit Operating System in only 16KiB

#33

Keep it up, I love new OSes. My dream is to write a cloud programming language that compiles high level code to a low-level kernel and deploys. I abhor waste, so efforts like this are a great start. I look forward to more!

don't reinvent the wheel - hack a Scheme. ^_^

Re: BareMetal OS: A 64-bit Operating System in only 16KiB

#34

Wow, from the queue presentation this OS looks even less usable than DOS (MS aka Q). Why would the CLI terminate when it runs a programme? How do you run more than one programme at once? If each core polls the run queue does that mean that it busy cycles when there is no more work to do? Won't this waste energy? (A sin in the HPC world). Does it do the same for IO? IO request completion on a slow and/or busy disk cou…

TAOCP and the Lion's commentary? Edition 6 kernel into asm? Why?

You're working hard to sound old-school, but these are just random allusions. TAOCP is not especially relevant to OS programming, and translating _all_ of an OS into asm to make it "fit a lot into a small space" is just... plain... stupid...

You will make the code smaller (as compared to gcc -Os) in a few places; you will likely give yourself a hernia maintaining it, and you are likely to get considerably worse performance than a decent compiler will.

Re: BareMetal OS: A 64-bit Operating System in only 16KiB

#35

Other than the academic nerdiness of minimal OSs, what is this good for? Do modern OSs cause too much overhead for certain operations?

They cause too much overhead for teaching. A minimal OS is a great way to show how one works, what the essentials are, and even what weaknesses it has.

It's amazing, when you look at a simple operating system like TinyOS, just how simple some of the things are. (Once you start actually hacking on the OS code, you realize that they're also very finnicky and easy to mess up if you don't know what you're doing. And hard to debug.)

Re: BareMetal OS: A 64-bit Operating System in only 16KiB

#36

Wow, from the queue presentation this OS looks even less usable than DOS (MS aka Q). Why would the CLI terminate when it runs a programme? How do you run more than one programme at once? If each core polls the run queue does that mean that it busy cycles when there is no more work to do? Won't this waste energy? (A sin in the HPC world). Does it do the same for IO? IO request completion on a slow and/or busy disk cou…

TAOCP and the Lion's commentary? Edition 6 kernel into asm? Why? You're working hard to sound old-school, but these are just random allusions. TAOCP is not especially relevant to OS programming, and translating _all_ of an OS into asm to make it "fit a lot into a small space" is just... plain... stupid... You will make the code smaller (as compared to gcc -Os) in a few places; you will likely give yourself a hernia m…

To expand on that: it's fun to take a look at the assembly code "gcc -O3" produces. It's absolutely wild: even after staring at it for a while, I often have no idea what clever tricks gcc used to turn the C code into that assembly code. It does a better job of making fast, compact code than I suspect I ever could.

There was a time when C compilers generated crappy assembly code, because that was easy for the compiler writers. That time is long past, with exceptions for a very few situations where the compiler misses a trick that a human can do.

Re: BareMetal OS: A 64-bit Operating System in only 16KiB

#37
post #31

Wow, from the queue presentation this OS looks even less usable than DOS (MS aka Q). Why would the CLI terminate when it runs a programme? How do you run more than one programme at once? If each core polls the run queue does that mean that it busy cycles when there is no more work to do? Won't this waste energy? (A sin in the HPC world). Does it do the same for IO? IO request completion on a slow and/or busy disk cou…

The MIT guys have already created a port?/reengineering? of 6th edition, check out xv6: http://pdos.csail.mit.edu/6.828/2009/xv6-book/index.html

That links to an older version - the current version seems to be at http://pdos.csail.mit.edu/6.828/xv6/

Re: BareMetal OS: A 64-bit Operating System in only 16KiB

#38
post #36

Earlier quoted context omitted.

TAOCP and the Lion's commentary? Edition 6 kernel into asm? Why? You're working hard to sound old-school, but these are just random allusions. TAOCP is not especially relevant to OS programming, and translating _all_ of an OS into asm to make it "fit a lot into a small space" is just... plain... stupid... You will make the code smaller (as compared to gcc -Os) in a few places; you will likely give yourself a hernia m…

To expand on that: it's fun to take a look at the assembly code "gcc -O3" produces. It's absolutely wild: even after staring at it for a while, I often have no idea what clever tricks gcc used to turn the C code into that assembly code. It does a better job of making fast, compact code than I suspect I ever could. There was a time when C compilers generated crappy assembly code, because that was easy for the compiler…

Well, sometimes it's fun. Other times it's utterly horrible. gcc doesn't always do a wonderful job and the maintainers sometimes just don't seem to care - induction variable optimizations and gcse were broken in 4.2 and 4.3 and the issue was left unfixed, with clear examples of obvious FAIL on simple and performance-critical inner loops.

However, this doesn't apply so much to OS code, which doesn't have nearly as much opportunity for micro-architectural shenanigans either way. Typically something like -Os does a good job of handling operating system style code.

Hand-coding OS asm remains a fine example of pointless tedium for the most part. There are clear places where you absolutely need asm, of course, but writing stuff in asm that can be perfectly well done in C is like cleaning out the barracks room bathroom with a toothbrush.

This was one of the early innovations of UNIX (high level language use), so there's something wildly anachronistic about this guy's suggestion. It's like suggesting that you rebuild grandpa's Studebaker so that it can be drawn by a team of horses.

Re: BareMetal OS: A 64-bit Operating System in only 16KiB

#39
My reality if fucked-up--only get indirectly mentioned. Whole world media talks to me, though.

It's pointless until reality is not FUBAR.

God says...external heresy sentences defers Bishop confessed people sanctuary however lying beholdeth gladness rolled loads existing urgedst Every ungodlily HAVE followed false changed alloy drinking entireness

Re: BareMetal OS: A 64-bit Operating System in only 16KiB

#40

Wow, from the queue presentation this OS looks even less usable than DOS (MS aka Q). Why would the CLI terminate when it runs a programme? How do you run more than one programme at once? If each core polls the run queue does that mean that it busy cycles when there is no more work to do? Won't this waste energy? (A sin in the HPC world). Does it do the same for IO? IO request completion on a slow and/or busy disk cou…

TAOCP and the Lion's commentary? Edition 6 kernel into asm? Why? You're working hard to sound old-school, but these are just random allusions. TAOCP is not especially relevant to OS programming, and translating _all_ of an OS into asm to make it "fit a lot into a small space" is just... plain... stupid... You will make the code smaller (as compared to gcc -Os) in a few places; you will likely give yourself a hernia m…

I guess I didn't elucidate my ideas properly. My point was _if_ you wanted to write an asm OS and learn from it, following in the steps of the masters might be more productive and enlightening. The PDP11 is sufficiently different from modern architectures, the scheduler as written in Lions relies on undefined CPU behaviour to work, that it wouldn't be a straight re-write; there is plenty to learn here. It would mean however that you would avoid plenty of unnecessary dead ends.
Post reply on HN