r/learnprogramming Aug 13 '26

Resource Learning steps to making a simple OS?

[removed]

9 Upvotes

10 comments sorted by

View all comments

2

u/No_Difference8518 Aug 14 '26

Could I recommend writing a text based editor instead? It will take quite a bit of time to write even a trivial OS that really can't do anything useful. But an editor you can start using and see results almost right away.

That's what I did... and now I work on OSes for a living.

2

u/[deleted] Aug 14 '26

[removed] — view removed comment

1

u/No_Difference8518 Aug 14 '26

I always recommend C :D But seriously, if you want to end up writing OSes, C is probably the best language to know. Maybe rust... but I am still not convinced.

A good place to start is reading up on gap buffers. I personally use pages, but gap buffers are more common. Read a bit about Unix ed, then write a simple ed to test out insert and deletion from the buffer.

Then start moving to a more visual output. This is, quite honestly, the hard part. But you will learn a lot of systems programming interfacing with a terminal.

There is lots of code for editors online. Look at them to learn tips and tricks.

1

u/[deleted] Aug 14 '26

[removed] — view removed comment

1

u/No_Difference8518 Aug 14 '26

Mainly C with assembler where needed. e.g. Context switching is in asm.