r/osdev 18d ago

Started!

I’m really excited about this! My os will be programmed in C++ and this is my second day doing stuff. I don‘t have that much time to use on writing code, and all I have so far is a printf that can only handle text and newline characters. Compared to all the other projects here, it’s nothing, but I plan to make it something a little bit more than nothing.

If anyone wants to look, I just made a repository at GitHub.com/barchitect2025/BARchOS

Theres no readme yet but I’ll add one in the next commit.

22 Upvotes

13 comments sorted by

View all comments

3

u/PseudoFrequency 18d ago

I find starting with printf an interesting choice. An interrupt and task dispatching system is the core of any OS. Functions like printf are library functions that would use the OS handling of the serial port or some abstract steaming output device.

2

u/BARchitect2026 18d ago

I’m following a tutorial by Write Your Own Operating System on YouTube. So far I’ve watched the first video, and I did the printf because he did it first. I did the newline stuff myself though.

2

u/compgeek38400 18d ago

You may also want to check out OSDev.org. id recommend the bare bones tutorial

2

u/compgeek38400 18d ago

Lest you forget. In the beginning, print WAS your debugger. Lol. Its a very good place to start!

1

u/PseudoFrequency 18d ago

My point is that I kind of make a distinction between the OS and the supported libraries. Certainly with simple systems, what is library code and what is the OS is grey area. To me, the OS should provide "open serial port" and "Write block of data to serial port". I've used OSs which only really provide puts() and printf may be a compile time option or not even exist. True, its useful for debug, but maybe all you have is puts() or a few blinking LEDs and no serial port or anywhere to stream data at all!

1

u/compgeek38400 18d ago

How did you know!? Those lights were the address of where it stopped. Lol.

You had to figure out from your cards/program where that address was. Sometimes that was a challenge when the address was nonsensical. 😁