Home > OS >  Can you make an OS only using assembly language?
Can you make an OS only using assembly language?

Time:06-22

I am making an OS on Ubuntu, but setting up cross compilers is to difficult (other questions did not help). Is it possible to make an OS only in assembly to avoid C or C cross-compilers?

PS: Is there a good cross-compiling resource for Ubuntu 64 bit to i386:x86_64 please let me know.

CodePudding user response:

The correct but useless answer is - yes, it's possible. Anything C/C does, assembly can do, too. If your next question is - how, the only possible answer would be "read a book". This is a small question with a book length answer. Yes, anything you can code in C/C you can also code in assembly... but it will take you 10 times longer, especially with debugging.

That aside, putting together a working OS in assembly will be an order of magnitude more complicated and time consuming than setting up cross compilation. If that is a challenge for you, maybe you shouldn't tackle a whole OS just yet.

CodePudding user response:

Yes. Indeed, this used to be common before Unix which introduced portability of operating systems across architectures. Operating systems like Digital Equipment's RSX-11 were written in assembler. A somewhat famous academic example is Alexia Massalin's 1992 Synthesis kernel, a small kernel with a Unix compatibility layer. It was written in Motorola 68020 assembly and represented a minor rebellion against high level language OSes. It was very fast for its time.

  • Related