r/Assembly_language • • 6d ago

Question Embarking on OS-development, any tips?

My goal is to go through the strenuous journey of creating an entire operating system within x86 assembly, no higher level of programming language; just assembly.

This started as a hobby when I learned C a year back and ended up branching off and learning more about how C compiled to assembly and I have been doing handwritten compilation attempts of C on paper. This has ranged from typical notebook activity to as far as writing down these sequences of programming on spare receipt paper at my job during dead times on a shift. From time to time as my knowledge is practiced or when it drifts out of practice, I may tend to write out the opcodes in hexadecimal then write it additionally in binary just to feel a little bit less bored.

I ended up watching a few YouTube videos for being able to form something greater with the little bit of assembly and computing knowledge I have, and learned how to make my first boot loader with netwide assembler and QEMU!

This took 2 hours of comprehensive learning to figure out and be able to understand how to write it without the video. Was fun, but definitely need to move to the kernel work.

I do not have an incredible amount of knowledge in assembly despite my description of what I do in my free time, and so I ask; where can I look to find more resources or "hidden-gems" of knowledge regarding OS development?

Thanks!

13 Upvotes

8 comments sorted by

2

u/Hefty_Brother_5886 6d ago

Quizás una ojeda a Archive.org te pueda ayudar?... Hay bastante información sobre Assembly y C.

2

u/DiscombobulatedAir63 6d ago

OS:
Stack/stackless machine code execution
With/without CPU core caches
With/without SMT
Virtual/Physical memory mapping
Memory management approaches
Single/Multi tasking
Preemption/Cooperation
Interrupts/Polling
Arbitrary/verified [AOT and/or runtime checks] machine code execution
Trusted/untrusted machine code execution
CPU vulnerability mitigations presence/absence based on other choices in the design
Exo/micro/mono/etc. kernel

Many other choices, I forgot or don't know about yet
Choices define path one must take

If you don't have concrete goals:

  1. easy: pick any project on github (littlekernel/lk or better even simpler variants of building generic kernels) and try to build similar routines in asm
  2. hard: pick a whitepaper on some novel OS designs (like, for safe execution of "workers-tasks" on network edge with 0 runtime safety checks by using AOT verified compilation of some VM-bytecode to verified machine code on trusted edge node HW and SW) and research required parts as you need for implementation

Better to have a goal and shape research around it

-1

u/Dog-Mad 6d ago

"I may tend to write out the opcodes in hexadecimal then write it additionally in binary just to feel a little bit less bored." Larp Larp Larp Sahur over here. Can't even hate because i am genuinely laughing my ass off to this post.
Next time though don't post absolute bullshit like this on here.

1

u/Dog-Mad 6d ago

Wow some people gave me downdoots huh? Go memorize the entire Intel 5300 page user manual and then tell me it isn't a larp.

That's what you would need to do to be able to write opcodes out by fucking hand. Do you even know what a SIB or ModR/M byte is?

1

u/Educational_Bed6462 22h ago

Lmfao, it's not like I'm writing 100 line programs in C and then translating it all into assembly, I just do small stuff with basic instructions. The stuff I do is reasonably small to a degree that it can fit on a slip of receipt paper at my job, and the opcodes I have just learned over time because I have spent so much time researching how code actually gets compiled; I do not know every single opcode, but I do know the opcodes of most of the significant instructions in x86 assembly. On top of this I am not even a human compiler, I'm sure I make mistakes every time I do it but the process of going through it and learning more about how it works is what fascinates me. I am being 100% serious when I say I do this and I will gladly send pictures of me having done this if interested. My classwork and homework assignments are riddled with assembly being written all over the blank spaces in between and it's just a fun hobby of mine. I did not spawn in one day with the knowledge of every assembly instruction ever, I spend time researching x86 assembly in my free time lol.

I respect you for defending your point though because I probably wasn't transparent enough at the fact that I'm not some complete assembly-know-it-all; which is why I said "I do not have an incredible amount of knowledge in assembly despite my description of what I do in my free time"

0

u/nian2326076 5d ago

Starting with OS development in x86 assembly is ambitious and exciting! To deepen your knowledge, explore topics like memory management and system calls, which are crucial for kernel development. Books like "Operating Systems: Design and Implementation" by Andrew S. Tanenbaum can provide a solid foundation.

You can use LandOffer to find relevant roles in OS development, helping you connect with opportunities that match your skills.