LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   First project advice/help? (https://www.linuxquestions.org/questions/linux-newbie-8/first-project-advice-help-688975/)

Noob01 12-07-2008 04:26 PM

First project advice/help?
 
I have an old IBM Eduquest computer (model #9615-001) that I want to convert to a stand alone oscilloscope running xoscope (http://xoscope.sourceforge.net/) with Linux. It has an AMD family 4 (80486) CPU running at 100Mh with 32M ram and 1.5G of hard drive space. To complicate things the archaic bios of the IBM does not even offer a cdrom boot option although it does have a fully functional cd drive installed. This tiny machine, obviously, does not have the horsepower to maintain a full blown linux application but I believe it will run a linux skeleton to support the xoscope program very nicely. So far I have looked at DSL (damn small linux), minix, basiclinux, LFS (linux from scratch), deli linux as well as the most of the bigger apps like opensuse, ubuntu, fedora, etc and don't need all of the bling that most of these have to offer. All I need is a linux core running xoscope and have the ability to network the scope to a windoze machine. That's it. All the scope needs to do is show me the output and integrity of an alternate energy source pure sine wave inverter that I am designing.

Is there one specific kernel that can be loaded into the IBM that will function as the os for xoscope? Since I am so new to linux, I have become totally confused by all the options and now am not even sure if this is worth the effort. Perhaps I should just shell out the $, scrap the IBM and buy a scope?

If it helps in understanding why I want to use this machine check out www.walshcomptech.com/ps2/eqm50.htm. This is not my web site nor is it the machine I have but it is the only reference to this IBM model found so far on the entire www.

Advice and/or opinions for/about this insane first linux project?

yowi 12-07-2008 09:15 PM

Sounds like a good project.
Heading straight into embedded Linux is an ambitious learning curve, but if you think you have the persistence then it's not quite insane.
You'd be doing yourself a favour to get comfortable with a linux based laptop or desktop first. This will provide you with a wealth of resources relevant to your project. Additionally most material will assume you have such a system available.

Noob01 12-08-2008 05:35 AM

Many thanks for the encouragement yowi. I have been toying around with basiclinux on another old machine off and on for a few days now. Basiclinux was successfully installed to the hard drive but there is some difficulty in getting the dual boot option (dos/linux) to work correctly. The basiclinux documentation indicates that LILO is included with the build but appears to be absent from the distro. Loadlin was installed for the time being but there is not much luck in getting it to work. Either os can be invoked from the command line but it would be be nice to have a first screen menu option to select which one to boot. I plan to work on it some more today.

As for the learning curve? Aye! It's been 20+ years since doing any serious command line work and that being dos. Many things must be learned or relearned but some aspects of command line programming are slowly coming back. Can we build this? In time, yes we can!

yowi 12-08-2008 06:33 AM

This covers most of what you'll be working with:
http://www.faqs.org/docs/Linux-HOWTO...mpt-HOWTO.html

armandh 12-08-2008 06:44 AM

wont work with win
 
I have moved the target Hdd to a computer that will boot from CD and installed then moved the Hdd back. use the frugal install ver. that copy the disk info to the hdd and use it as if it were the CD. you may have to fix the MBR after moving back if the boxes are too far apart as to where & how they write the MBR.

Noob01 12-08-2008 08:42 AM

Thanks for the link yowi. This is more than helpful and is exactly what is needed at this stage of the project. The page is already bookmarked and printed. Now for some light reading.

Armand, your tip is exactly what has to be done. The kernel(?) along with xoscope will be installed on a spare hard drive using another machine then debugged and tested. That drive will then go into the IBM. The two machines share similar capabilities and hardware but the machine I am using to set up the hard drive has a pentium CPU whereas the IBM does not. I don't know what difference that will make, if any, but we're going to find out.

yowi 12-08-2008 04:05 PM

The most likely thing that will change is the HDD devices (eg /dev/hda...), you may need to edit /etc/fstab to compensate.
Otherwise hardware is probed by the kernel on each boot and appropriate drivers loaded. It makes no assumptions as to what hardware it'll find. X and sound often have hiccups on transplant but I don't expect they'll concern you.
If oscope works without an X server that would be well worth trying.

El_Negro 12-08-2008 07:56 PM

Hey guys whuzzup

I'm from Trinidad and I wanna ask u guys if u can aid me a race car project that I have to do, I want to get the data from a text file using the getline function but it only takes in the whole array field, I want to read it line by line take a look at my source code and please tell me where the hell I'm going wrong.

the concept of the project is this:

struct car
{
Driver name
Car Driven
Team Name
Best Race Time
Tournament Placing
}

isFirstPlace(); //determines if person is the final winner
isSecondPlace(); //determines if person is second overall
isThirdPlace(); //determins if person is third overall
isRoundOneAdvancer(); //has car qualified for next round
isRoundTwoAdvancer(); //has car qualified for quarter finals
isRoundThreeAdvancer(); //has car qualified for semi-finals
isRoundFourAdvancer(); //has car qualified for finals
ranRoundOne(); //has car run this round
ranRoundTwo(); //has car run this round
ranRoundThree(); //has car run this round
ranRoundFour(); //has car run this round

What is needed to be done is as follows:

1) create a queue consisting of 32 cars
2) Take four cars off the list
3) execute a function to run a race of four cars
4) update the bestRaceTime of the four cars just run
5) update is RoundTwo(); field
6) Update the ranRoundOne value of the cars just run
7) push all cars back on queue
8) Update the ranRoundOne value of the cars just run
9) Repeat this process eight times //to complete round one

ROUND TWO

1) Take four cars off the list
2) Check if ranRoundOne is True and If is RoundTwoAdvancer is True
3) If not true, put back on the queue, If true select for race
4) Repeat steps 2 and 3 until we have for cars
5) Race four cars
6) Update the ranRoundTwo value of the cars just run
7) Update the best race time
8) Update isRoundThreeAdvancer() field
9) Push all cars back on the queue
6) Repeat this process four time //to complete round two


this is my source code:
//NAME: PAUL ESTRADA
//PROGRAM: RACE CAR GAME

#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>

using namespace std;

struct node
{
int maxQueueSize; //variable to store the maximum queue size
int count; //variable to store the number of elements in the queue
int queueFront; //variable to point to the first element of the queue
int queueRear; //variable to point to the last element of the queue
int index;
node *list; //pointer to the array that holds the queue element
};

class queueType
{
public:
bool isEmptyQueue()const;
//Function to determine whether the queue is empty.
//Postcondition: Returns true if the queue is empty,
// otherwise returns false.

bool isFullQueue()const;
//Function to determine whether the queue is full.
//Postcondition: Returns true if the queue is full,
// otherwise returns false.

void initializeQueue();
//Function to initialize the queue to an empty state.
//Postcondition: The queue is empty.

int front()const;
//Function to return the first element of the queue.
//Precondition: The queue exists and is not empty.
//Postcondition: If the queue is empty, the program
// terminates; otherwise, the first
// element of the queue is returned.

int back()const;
//Function to return the last element of the queue.
//Precondition: The queue exists and is not empty.
//Postcondition: If the queue is empty, the program
// terminates; otherwise, the last
// element of the queue is returned.

void addQueue(int queueElement);
//Function to add queueElement to the queue.
//Precondition: The queue exists and is not full.
//Postcondition: The queue is changed and queueElement
// is added to the queue.

void deleteQueue();
//Function to remove the first element of the queue.
//Precondition: The queue exists and is not empty.
//Postcondition: The queue is changed and the first
// element is removed from the queue.

queueType(int queueSize = 32);
//Constructor


protected:
int maxQueueSize; //variable to store the maximum queue size
int count; //variable to store the number of elements in the queue
int queueFront; //variable to point to the first element of the queue
int queueRear; //variable to point to the last element of the queue
void bubblesort(node *list, int); //sort racers
node *list; //pointer to the array that holds the queue element

};

class race:public queueType
{
public:

void Firstpost(string,string,string); //returns who is first
void Secondpost(string,string,string); //returns who is second
void Thirdpost(string,string,string); //returns who is third
bool region(float); //qualify in regionals
bool quarter(float); //qualify in quarter-finals
bool semifinal(float); //qualify in semi-finals
bool final(float); //winner in finals

protected:
string driver[32];
string racer[32];
string country[32];
float r_time;
int post;
};


int main()
{

ifstream tournament;
string name[0];
string car[0];
string team[0];
float random_num[0];
char choice;


system("color 0b");
cout<<"***WELCOME TO THE CARIBBEAN RACE GRAND PRIX!!!!***"<<endl<<endl;

cout<<"----------------------------------------------------"<<endl
<<" GENERAL RULES "<<endl
<<"----------------------------------------------------"<<endl
<<"The car with the fastest time advances to the next round"<<endl
<<"There are a total of four rounds in this race"<<endl
<<"Round 1 is the Regionals"<<endl
<<"Round 2 is the Quarterfinals"<<endl
<<"Round 3 is the Semi-Finals"<<endl
<<"Round 4 is the Finals"<<endl
<<"The last two cars will determine the winner"<<endl
<<"ENJOY!!!!"<<endl<<endl<<endl;

cout<<"Press 'b' to begin the Racing Game"<<endl
<<"Press 'e' to exit racing game"<<endl;
cin>>choice;
if(choice != 'e')
{
system("cls");
system("color 0b");
cout<<"--------------------------------------------------"<<endl
<<" CAR RACING TOURNAMENT "<<endl
<<"--------------------------------------------------"<<endl
<<"********************COUNTRIES*********************"<<endl<<endl
<<"Trinidad"<<endl
<<"Jamaica"<<endl
<<"Barbados"<<endl
<<"Guyana"<<endl
<<"Windward"<<endl
<<"Leeward"<<endl<<endl;
cout<<"Press 's' to start the Racing game"<<endl;
cout<<"Press 'e' to exit the Racing game"<<endl;
cin>>choice;
while(choice != 'e')
{

/* Reading from tournament text file */
tournament.open ("tournament.txt");
while(tournament)
{
int i=0;
getline (tournament, name[i]);
cout << name[i] <<endl;
i++;
}
tournament.close();
}

}
else
{
cout<<"END OF GAME:-("<<endl;
}


return 0;
}


bool queueType::isEmptyQueue()const
{
return (count == 0);
} //end isEmptyQueue


bool queueType::isFullQueue()const
{
return (count == maxQueueSize);
} //end isFullQueue


void queueType::initializeQueue()
{
queueFront = 0;
queueRear = maxQueueSize - 1;
count = 0;
} //end initializeQueue


int queueType::front()const
{
assert(!isEmptyQueue());
return list->queueFront;
} //end front


int queueType::back()const
{
assert(!isEmptyQueue());
return list->queueRear;
} //end back


void queueType::addQueue(int newElement)
{
if(!isFullQueue())
{
queueRear = (queueRear + 1) % maxQueueSize; //use mod
//operator to advance queueRear
//because the array is circular
count++;
list->queueRear = newElement;
}
else
{
cout << "Cannot add to a full queue." << endl;
}
} //end addQueue


void queueType::deleteQueue()
{
if (!isEmptyQueue())
{
count--;
queueFront = (queueFront + 1) % maxQueueSize; //use the
//mod operator to advance queueFront
//because the array is circular
}
else
{
cout << "Cannot remove from an empty queue" << endl;
}
} //end deleteQueue

//Constructor
queueType::queueType(int queueSize)
{
if(queueSize <= 0)
{
cout << "Size of the array to hold the queue must "
<< "be positive." << endl;
cout << "Creating an array of size 32." << endl;
int maxQueueSize[32];
}
else
{
maxQueueSize = queueSize; //set maxQueueSize to queueSize
queueFront = 0; //initialize queueFront
queueRear = maxQueueSize - 1; //initialize queueRear

count = 0;
list = new node[maxQueueSize]; //create the array to hold the queue elements
}
} //end constructor


HELP ANYONE!!! PLEAZZZZZZZZZEEEEEEEEEE!!!!!!!!!!!

Noob01 12-09-2008 08:03 AM

El_Negro, you have come to the right place for answers, help and advice regarding linux. This thread, however, was started to seek help and advice for a project totally unrelated to your question. Placing an irrelevant post to an existing thread is called hijacking and is, in general, a no-no according to message board protocol. Aside from that, your question will gain more exposure and stand a better chance of being answered if it is posted as a new thread. Unfortunately, I don't know enough about linux to even begin to tell you why the code doesn't do what you want it to do. I sincerely hope that you find the answer that you are looking for and more than likely will as there are some very smart people here. Best of luck with your project!


Running without an x server is what is planned for yowi. I want to be able to turn on the machine and have xoscope boot up all by itself and be ready to run without any user interaction. This should be easy to set up in lilo or would grub be a better choice?

It's good to know that linux is flexible when it comes to recognizing what hardware is available to it. That does simplify things but the nerves begin to rattle a little when thinking about editing files. I had a bad experience with PERL a few years back and definitely do not want to relive that experience. But, we'll address that issue when the time comes. There is bound to be a few hiccups but if everything is set up correctly prior to the transplant these should be minimal?


All times are GMT -5. The time now is 01:58 PM.