Making a simple OS
Making a simple OS
Hi. I want to write a very simple OS, preferably in C++. All i want right now is a kernel with a basic input and output function, nothing fancy. How do i do this? Any help would be greatly appreciated.
Re:Making a simple OS
FritzOS ( not suppose to be here i'm busy working on projects... )
anyway, FritzOS has a C++ kernel, compiles easy for Linux, people have used it's code on DGJPP ( on windows ). You can download it's 8th version ( pk0.0 was version 1 ).
here: www.sourceforge.net/projects/fritzos.
It has printf stuff, Print( <int> or <string> or <char> ) stuff and the all the fancy printf stuff you'd need for testing.
All the code is very commented, but not too commented, i.e. it's not 1 meg of just commented code. It is easy to understand though, at least for me and some others...
Bye...
anyway, FritzOS has a C++ kernel, compiles easy for Linux, people have used it's code on DGJPP ( on windows ). You can download it's 8th version ( pk0.0 was version 1 ).
here: www.sourceforge.net/projects/fritzos.
It has printf stuff, Print( <int> or <string> or <char> ) stuff and the all the fancy printf stuff you'd need for testing.
All the code is very commented, but not too commented, i.e. it's not 1 meg of just commented code. It is easy to understand though, at least for me and some others...
Bye...
Re:Making a simple OS
Thanks, this looks great. I looked over it, but will need to read through it in more detail a little later. One question though, is the assembly ABSOLUTELY necessary? I don't know much assembly (actually thats a lie, i know none) and i would like to try not to use other people's code. Is there any way to do the same stuff in C++?
Re:Making a simple OS
Actually, you can just use my bootsector and code that uses the assembly, and just skip assembly alltogether. I like assembly abit, that's why I use it.
Re:Making a simple OS
Check this site out:
http://www.nondot.org/sabre/os/articles/TheBootProcess/
Click on the "Making plain binary files using a C compiler"
http://www.nondot.org/sabre/os/articles/TheBootProcess/
Click on the "Making plain binary files using a C compiler"
Re:Making a simple OS
I have another question. How exactly do i compile and use your kernel (I mainly use Windows ME, but also have RedHat Linux 7.3)? Do i put all the code for my operating system inside kernel32.cpp, or do i compile the kernel and write a seperate program for the actual OS? Sorry if these questions seem stupid, but im pretty new at this.
Re:Making a simple OS
Before I can answer, are you using Linux?
And your questions are not stupid...once I asked those
And your questions are not stupid...once I asked those
Re:Making a simple OS
wow, fast reply. I just edited my message to include my operating system. Using windows ME mainly, but also RedHat 7.3
Re:Making a simple OS
I suggest you compile my kernel in Linux...do you know Linux command lines?
if so,
all the code that you want to run should be in the kernel32.cpp's start() function. This function acts like main() but returns nothing, and you ALWAYS need "Freeze" at the end of start().
after editing that file, change directories to pk0.7.1/linuxinst
after doing that, but a not used floppy ( can be non blank or blank ) in your first floppy drive, and type
sh install.sh
that's it! reboot, and There is FritzOS working for you! just add your copyright right by mine, and you can do whatever you want with FritzOS, just as long as you don't sell it.
if so,
all the code that you want to run should be in the kernel32.cpp's start() function. This function acts like main() but returns nothing, and you ALWAYS need "Freeze" at the end of start().
after editing that file, change directories to pk0.7.1/linuxinst
after doing that, but a not used floppy ( can be non blank or blank ) in your first floppy drive, and type
sh install.sh
that's it! reboot, and There is FritzOS working for you! just add your copyright right by mine, and you can do whatever you want with FritzOS, just as long as you don't sell it.
Re:Making a simple OS
Thanks a lot. I'm doing this for a project at school, so i'm not sure i'll use your code exactly (the assembly should be fine, its a C++ class), but i learned a lot from it. Also, i was wondering whether i can still make objects for my OS. I was reading some other posts, and i read something about needing to write a bunch of stuff to be able to use all the features of C++ or something. Is this correct?
Re:Making a simple OS
I was just about to tell you that.
Unfortunatly, I didn't include classes support in FritzOS. I will include it soon. also, you cannot use new or delete. I'm sorry, but there is this person called "whyme_t" here that knows how to make classes support.
Whyme_t, could you help?
Also, if you really needed it, I could release pk0.7.2 with classes and new and delete support?
Unfortunatly, I didn't include classes support in FritzOS. I will include it soon. also, you cannot use new or delete. I'm sorry, but there is this person called "whyme_t" here that knows how to make classes support.
Whyme_t, could you help?
Also, if you really needed it, I could release pk0.7.2 with classes and new and delete support?
Re:Making a simple OS
Being a school project ( :'( ) i'd rather have someone explain to me how to do this than do it for me. Also, i was wondering about how to go about using files in my OS, what filesystem should i use and how do i use it? Thanks again for all the help, i have learned more here in a few hours than a few weeks trying to find tutorials on the internet.
Re:Making a simple OS
Well, whyme_t has a tutorial that's good and teaches how to make a C++ kernel with run-time support ( classes, new, and delete etc ).
His page uses DGJPP, but you can use the code in linux too...
His page uses DGJPP, but you can use the code in linux too...
Re:Making a simple OS
Oh, forgot about the FS stuff...
to make a FS you need this:
Make a floppy driver After making a IDT.
Use Fat12 code to learn from.
If this sounds like alot, it's time to get books, that's what I'm about to do.
to make a FS you need this:
Make a floppy driver After making a IDT.
Use Fat12 code to learn from.
If this sounds like alot, it's time to get books, that's what I'm about to do.