Live data from Hacker News

Show HN: xOS – a 32-bit OS for the PC

github.com

1–10 of 28 posts

Re: Show HN: xOS – a 32-bit OS for the PC

#6
post #4

Why not 64 bits?

I donno if this is a serious question or not, but x86-64 is very much an extension of regular 32-bit x86, just more complicated. For something like this there's little reason to attempt 64-bit when 32-bit is much easier and will essentially result in learning the same concepts.

Re: Show HN: xOS – a 32-bit OS for the PC

#10
post #4

Why not 64 bits?

I donno if this is a serious question or not, but x86-64 is very much an extension of regular 32-bit x86, just more complicated. For something like this there's little reason to attempt 64-bit when 32-bit is much easier and will essentially result in learning the same concepts.

I messed around with writing OSes when I was around the same age, and I found x86-64 to not have much of an overhead relative to plain x86.

Getting into long mode itself is just a tiny bit of boilerplate at the very beginning. If you didn't plan on using paging then you need to do a bit more work to identity map everything, but if you already did the extra virtual address space means you can just map all physical addresses (that are hooked up to anything) linearly somewhere and not have to play games with mapping/unmapping things just so the kernel can access them briefly. You lose the ability to have the processor save state on context switch for you via the TSS, but that's not very hard to do yourself either. The ins and outs of running something in compatibility mode are quite complicated, but there's no reason to involve yourself in that if you're writing your own toy OS.

Overall I'd say 32-bit dodges a few things, but I wouldn't call it much easier.

Post reply on HN