Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Extending asm

Name: Anonymous 2009-03-16 20:52

So, I'm currently writing a kernel in x86_64 assembly, following in the footsteps of Henry Massalin as I once so neatly put it. I'm just about to start on the queue quaject (multithreading, paging, usermode, etc. is done), but it strikes me that the fasm macro-language is too restricted, and doesn't easily allow for certain advanced code-size reducing and code-speed enhancing features. So I'm considering making my own macro-language for it, and I think this would greatly enhance the maintainability, modularity and awesomeness of the OS. Macros would be written in the source-files in a Literate Haskell-ish fashion.

The most obvious to me would be relocating each modules' initialization code to right after the CPU-initialization, allowing that space to be reused as data-area when stuff is up and running. I would also consider having automated register renaming ('1' => 'd' makes r1 map to rdx, r1d edx, r1w dx, etc), but automated register allocation would be pushing it.

Also, as the preprocessor would know a lot more about the procedures and their register consumption, the task of saving and restoring the registers could be automated for syscall routines, as it becomes some kind of reflection. If I'm really good it could even become type-safe.

Does this sound like a good idea? The reason for not just writing it in some other language is that I'm wholeheartedly convinced that I can make a faster and better system than any compiler. Also, which language would be best to implement this in? Right now I'm leaning towards python.

Name: Anonymous 2014-01-22 2:29

Write a small bytecode interpreter that can fit in L1 cache in assembly, then write the rest of your OS in the bytecode.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List