Reputation: 572
I wish to make a custom kernel, that loads and executes code (my code is similar to lua) so that I can use it to make an OS, I have already made a basic kernel in java, but I really need to know how to make it in Assembly.
Can anyone give me the steps to making an efficient kernel in assembly?
Upvotes: 0
Views: 1015
Reputation: 255
As someone already suggested OS Dev is the place to go. I would also make sure you know how to get the kernel working with some other language that has more structure and is more commonly used, so that you have more resources for such. Getting C/++ working with assembly isn't as hard as it sounds, though it's a huge pain to write standard libraries from scratch. So when you have it working, I might not go as far as writing the standard libraries over, but I'd definitely get it working first, and then add functionality for your own language.
Definitely check out the dragon book though, called "Compilers: Principles, Techniques, and Tools" nicknamed for the dragon on the cover. Pretty much required reading for anyone writing their own compiler. It's the bible of compilers and the like.
As far as writing your kernel in assembly/from scratch, note to yourself:
If you've thought ahead of time or are completely doing this as a learning experience with no ambitions, you're probably ready to get into the code. The website link I posted will be the most valuable information source. Another thing to note, there are lots of dialects or implementations of assembly, my favorite are FASM and NASM. I definitely recommend NASM because it builds under nearly any system worth noting and has by far the most portable code I've come across. DO NOT EVER EVER rely on assembly being portable! It usually, even if intended to be, isn't.
Upvotes: 2
Reputation: 18446
If you just want to fiddle around a bit, look at this guide.
You could also look through the code of this project.
A popular book on this matter is this one.
Upvotes: 1
Reputation: 7353
Would be really interested in how you did this in Java. This website is excellent for all things regarding OS development.
Upvotes: 1