Page 1 of 1

help!

Posted: Sat Feb 19, 2005 7:58 am
by thomas
i have a boot loader but i need some help making the kernel i have made a very small version of it in c++ but is a console aplication

//==============================================================================
// tiny os V.1.0
// kernel-main
//==============================================================================

#include <cstdlib>
#include <iostream>
#include <conio.h>
#include <limits>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

using namespace std;

int mycomputer();
int aplications();
int shutdown();

int main()
{
float input;
{
fflush(stdin);
cout<<"\nTiny OS V.1.0\n\n";
cout<<"1. my computer\n";
cout<<"2. aplications\n";
cout<<"3. shutdown\n\n";
cout<<"Selection: ";
cin>> input;
switch ((int)input)
{ case 1:
mycomputer();
getch();
break;
case 2:
aplications();
getch();
break;
case 3:
shutdown();
getch();
break;
default:
cout<<"\nError bad input\n\n";
cin.clear();
cin.ignore(std::numeric_limits < int >::max(), '\n');
main();
break;

}

}
}

int mycomputer()
{
float input;
{
fflush(stdin);
cout<<"my computer";
cout<<"1. about my computer\n";
cout<<"Selection: ";
cin>> input;
switch ((int)input)
{ case 1:
//dont know what to put yet
break;
default:
cout<<"\nError bad input\n\n";
cin.clear();
cin.ignore(std::numeric_limits < int >::max(), '\n');
main();
break;
}

int aplications();
{
float input;
{
fflush(stdin);
cout<<"\naplications\n\n";
cout<<"1.back to main menu \n";
cout<<"2.calculator\n\n";
cout<<"Selection: ";
cin>> input;
switch ((int)input)
{ case 1:
main();
getch();
break;
case 2:
system ("calculator.exe");
default:
cout<<"\nError bad input\n\n";
cin.clear();
cin.ignore(std::numeric_limits < int >::max(), '\n');
main();
break;

}

}
}

int shutdown()
{
//shuts down
}

can you tell me what to add im geussing i have to add hardware interupts ??? ???

Re:help!

Posted: Sat Feb 19, 2005 8:01 am
by Curufir

Code: Select all

#include <cstdlib>
#include <iostream>
#include <conio.h>
#include <limits>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
The functions described in these headers aren't going to be at your disposal until such time as you write the appropriate library yourself. The FAQ (afaik) gives some help on getting a basic C++ environment up and running.

Re:help!

Posted: Sat Feb 19, 2005 8:05 am
by thomas
ok im readiny kernel 101 at the moment so i dont need any help from anyone

Re:help!

Posted: Sat Feb 19, 2005 8:22 am
by distantvoices
A bit more politeness is always of help.

Re:help!

Posted: Sat Feb 19, 2005 1:46 pm
by bubach
I guess that he didn't intend to sound inpolite, but it's always good to read through the post before hitting submit.

Re:help!

Posted: Sun Feb 20, 2005 5:31 am
by IRBMe
Perhaps a more descriptive topic othe than 'help!' might help too.