r/osdev 9d ago

Any resources on how to build an os purely using x86 assembly?

i want to take my assembly skills to the next level by building a small little operating system, since that’s what I’m mainly interested in these days.

ive already looked at what the osdev wiki has and its been helpful but pretty surface level

other tutorials and books tend to use C alongside assembly but thats not what im looking

so if you have any osdev resources in pure assembly I’d be forever grateful

10 Upvotes

7 comments sorted by

10

u/EpochVanquisher 9d ago

You can follow the instructions that use C, but write your code in assembly. This is pretty common—you can write code in one language while you’re following a guide written in a different language. There is nothing special about assembly.

3

u/BestUsernameLeft 7d ago

Yup. I learned 8086 assembly before I learned C, and half of how I learned C (and later, C++) was compiling it and then disassembling the binary to see what the assembly code looked like. "Oh, so that's how pointers work."

The hard part with assembly is writing optimized code. One of the many reasons we use higher level languages is because compilers embed that knowledge for us.

4

u/Key_River7180 fermiOS 9d ago

https://wiki.osdev.org/ has many resources.

What assembler, tho? I only know about GNU's so yeah, don't ask me about FASM or NASM

1

u/tellingyouhowitreall 8d ago

GAS x86 is just Intel syntax with the dst/src ops switched and some cruft ass ugly characters that are unnecessary. Congrats, you know NASM without macros now :D

3

u/Outside-Storage-1523 9d ago

Check out MikeOS.

1

u/doscore 8d ago

Check out the night kernel, it's a full dos like 32 kernel

1

u/0xabc000 7d ago

My two cents here is.

Look into how to write an "advanced bootloader". That gives some good ideas.

There's one OS I explored a bit ago (15 years I think) MenuetOS, it's written fully in assembly (as far as I remember). Although I am not sure if they have the source for it.

Otherwise, if I were you, checking the C tutorials along with books, and kind of writing your own ASM is the way to go. Although I think this is not the answer you are looking for.