Page 1 of 1
Isaax OS help :(
Posted: Sat Jun 01, 2013 10:54 am
by thegreatstudio
There are some problems that i cant configure
Code: Select all
#include<stdio.h>
main()
{
char help;
int version;
version = 14;
printf("Welcome to Isaax OS!;");
printf ("Please type help for commands!: \n ] ");
scanf(%s", &help);
if((help == "help")){
printf("Available Commands:\n");
printf("osver -- prints the version of this os");
}
else if((help == "osver")){
printf("your kernel version is: %d", version);
}
}
Re: Isaax OS help :(
Posted: Sat Jun 01, 2013 11:03 am
by Griwes
Re: Isaax OS help :(
Posted: Sat Jun 01, 2013 11:47 am
by feare56
There are many things wrong with this post, for one what's not working on it? Is this an OS or just a program that acts like an OS? How are you booting it? What sector are you setting it to? Lastly, don't post your code and ask us to find the error that is very frowned upon in this forum.
Re: Isaax OS help :(
Posted: Sat Jun 01, 2013 12:37 pm
by CocaCola
thegreatstudio wrote:There are some problems that i cant configure
Perhaps you mean you "can't figure out"?
You posted this on an OS development forum, but in your post you ask for help with a regular program.
An OS is a very special program, it is not an .exe that you can double-click on.
So if an OS is really what you want to code, read more here:
http://wiki.osdev.org/Main_Page
Anyway, here is the corrected version of your C program (not tested):
Code: Select all
#include <stdio.h>
#include <string.h>
int main(void) // return type int, and void for no parameters
{
char help[100]; // array of char, not one single char
int version;
version = 14;
printf("Welcome to Isaax OS!;");
printf ("Please type help for commands!: \n ] ");
scanf("%s", help); // missing quotation mark
if (!strcmp(help, "help")) // this isn't C++
{
printf("Available Commands:\n");
printf("osver -- prints the version of this os");
}
else if (!strcmp(help, "osver"))
{
printf("your kernel version is: %d", version);
}
}
Re: Isaax OS help :(
Posted: Sat Jun 01, 2013 10:07 pm
by thegreatstudio
Hey thanks but i just dont know how to make it loop like a terminal it doesn't stops when y ou type something. I hope you can understand what i am trying to sayh :/
Re: Isaax OS help :(
Posted: Sat Jun 01, 2013 11:01 pm
by thegreatstudio
How do you call a funtion in the function ???
I will demonstrate my sentence
void startup()------------
|
|
|
|
int main(void) |
check() |
load() <-------------------|
void load()
Re: Isaax OS help :(
Posted: Sat Jun 01, 2013 11:49 pm
by CocaCola
thegreatstudio wrote:Hey thanks but i just dont know how to make it loop like a terminal it doesn't stops when y ou type something. I hope you can understand what i am trying to sayh :/
Use a loop.
thegreatstudio wrote:How do you call a funtion in the function ???
You are in the wrong forum to ask such questions. OSDev.org is not where you learn general programming.
http://www.cprogramming.com/tutorial/c-tutorial.html