Example OS written in C++??
Example OS written in C++??
Are there any OS's written in C++ available for study somewhere? Any of the OSDev members written their OS in C++, with available sourcecode?
I've gotten my C++ kernel booting, and can perform simple text-to-screen operations, but am trying to determine which part I should focus on next. Memory management? Write a C++ library, f.instance string functions?
All help appreciated!
I've gotten my C++ kernel booting, and can perform simple text-to-screen operations, but am trying to determine which part I should focus on next. Memory management? Write a C++ library, f.instance string functions?
All help appreciated!
[FrodOS]
There is a a project called UnixLite that is a Unix type operating system with binary compatibility with Linux. It can even run a small web browser, and some unix utilities. (bash, gcc, etc.) Moreover, it's GPL and written in C++.
C8H10N4O2 | #446691 | Trust the nodes.
Re: Example OS written in C++??
I wrote my boot loader, which enters pmode (32 Bit) and does a far jump to the entry point of the kernel.bin. Now I'm gonna set up the compiler and linker to produce pure binary files. And after that I'm focusing right on the memory managment.Scalpel wrote:Are there any OS's written in C++ available for study somewhere? Any of the OSDev members written their OS in C++, with available sourcecode?
I've gotten my C++ kernel booting, and can perform simple text-to-screen operations, but am trying to determine which part I should focus on next. Memory management? Write a C++ library, f.instance string functions?
All help appreciated!
I think you should focus on the memory managment
I think, I have problems with Bochs. The biggest one: Bochs hates me!
Hmm, I'm thinking that perhaps some sort of minimal error handling needs to come first. Now the kernel crashes and burns easily. A simple
causes the computer to reboot.
I also tried a simple memcpy library function (this one), but that crashed the kernel as well.
So exception handling is first priority. But then I probably need to write some basic library routines first anyway. Right now I've got squat. Not even a printf , malloc or strcpy. I guess I need some of those when writing an exception handler?
Any good documentation for writing exception handlers anywhere?
Code: Select all
int i = 5 / 0; //Division by Zero
I also tried a simple memcpy library function (this one), but that crashed the kernel as well.
So exception handling is first priority. But then I probably need to write some basic library routines first anyway. Right now I've got squat. Not even a printf , malloc or strcpy. I guess I need some of those when writing an exception handler?
Any good documentation for writing exception handlers anywhere?
[FrodOS]
I suggest you work on a printf function first; even before memory management. This makes debugging much easier. However, in C++ you don't need to write a printf function. (Which isn't very fun...) Instead, you can just make something like cout, which is much funner to make.
C8H10N4O2 | #446691 | Trust the nodes.
I've got a Video class with a function Video.write(char*), from David Stouts tutorial over at Bona Fide. I am able to write out strings, have enabled escape chars (\n, \b), but can't print out numbers yet. I need to figure out how to do formatting, f.instance:Alboin wrote:I suggest you work on a printf function first; even before memory management. This makes debugging much easier. However, in C++ you don't need to write a printf function. (Which isn't very fun...) Instead, you can just make something like cout, which is much funner to make.
Code: Select all
Video vid;
int numb = 123;
vid.write("Here is a number: %d", numb);
[FrodOS]
vid.write wasn't was I was going for. Hmmm...Uh, I was going for an overloading operator approach... Attached is what I was thinking...It should work if one does something like:
This means that one doesn't have to do any formatting except for '\n', '\t', etc.
I hope it works....
Code: Select all
int i = 12;
Monitor m ;
m << "Hi" << i;
I hope it works....
- Attachments
-
[The extension cc has been deactivated and can no longer be displayed.]
C8H10N4O2 | #446691 | Trust the nodes.