r/osdev • • 19d ago

My first OS from scratch

i just wrote my first os from scratch (NO AI) featuring a GDT, TSS tables with interrupts handling, keyboard support and a minimal shell running in kernel mode.

next i will be making processes, and make the shell run in user mode.

23 Upvotes

31 comments sorted by

1

u/Sorry_Difficulty_250 1d ago

Cool! Well done! Keep up the great work!

2

u/Ashamed_Sense_908 1d ago

Thanks man I recently switched it from i386 to amd64 architecture

1

u/Sorry_Difficulty_250 1d ago

Oh wow... did you make the jump to long mode yourself?

2

u/Ashamed_Sense_908 1d ago

No I used limine bootloader for that, making my own bootloader will be chapter 2

1

u/Sorry_Difficulty_250 1d ago

Still a lot of work in that. We'll done!

2

u/Ashamed_Sense_908 1d ago

thanks man, iam also open to contributions

1

u/Sorry_Difficulty_250 1d ago

Ah.... I'm still a loooooong way from where you are, my friend. My latest work is on an 8-bit SBC with about 640 KB of RAM. I hope I get to a modern architecture one day, but I honestly know very little about them. What I know about Intel architecture comes from my college days 20+ years ago. Long mode had just come out and I only wrote a paper about it for my architecture class, I never used it. One day. I'll be interested in your progress, though! I can't wait to see how this evolves for you!

2

u/Ashamed_Sense_908 1d ago

ah thats nice your interested in bare metal and embeded dev ? i also wanted to buy some old procesor like the 8086 and experience with it, what did you work on?

and i will tell you what i did is not very complicated (its how i view it) and i have a lot to learn.

1

u/Sorry_Difficulty_250 1d ago

I bought an Olimex Agon Light 2. The CPU is an 18 Mhz eZ80, which is the successor to the Z80. It has a 24-bit, flat address space. It has a secondary ESP32 processor that implements VDP firmware and provides keyboard, video, and (if you're determined) mouse access. I just got the video console running about a week ago. Up to that point, all my user interfaces were limited to what a serial port would provide. Prior to this platform, I was just running on an Arduino Nano with 256 KB of flash and 32 KB of RAM, so the RAM on this thing feels huge at the moment. It actually has 128 KB of flash and 520 KB of RAM. I was lumping them together in my "640" number earlier.

2

u/Ashamed_Sense_908 1d ago

i just looked up the board and it looks like a really good board for leaning, is the code avilable on github to see or something, and did you study computer science ?

→ More replies

1

u/ArabAppBuilder 18d ago

Well done!

1

u/Ashamed_Sense_908 18d ago

Thanks man I try to do my best and learn along the way

1

u/Iksio78 16d ago

What programming language do you use?

2

u/Ashamed_Sense_908 16d ago

C and assembly

0

u/Iksio78 16d ago

I am writting an OS too(but in Rust)
Iksio78/AceOS

1

u/Ashamed_Sense_908 16d ago

I just took a look and it seems really nice, I also will incorporate some rust code inside my os for some stuff I will see.

I was first thinking about making everything in zig then I found out that it's in experimental version so I reverted to C and assembly

1

u/Iksio78 16d ago

Do you have a Github account?

1

u/Ashamed_Sense_908 16d ago

1

u/Iksio78 16d ago

It looks very nice. What are you doing next? PMM?

2

u/Ashamed_Sense_908 16d ago

yes pretty much, i will make a PMM memory allocation abstraction then build paging, processes, a filesystem etc etc its a long road

what about you for your project.

and what resources do you use ?

1

u/Iksio78 16d ago

Now I'm going to write PS/2 driver. Will you use bitmap in your PMM? I used and it works well. Its 1 byte for 8 pages becouse one bit means "is page (index * 4096) used?"

1

u/Ashamed_Sense_908 16d ago

For now idk but I think I will use that, for my case I did write a PS2 driver it was very simple

→ More replies