LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-24-2012, 01:34 AM   #1
micflunu
Member
 
Registered: Oct 2012
Posts: 73

Rep: Reputation: Disabled
Question lilo error message


i installed lilo boat-loader run /sbin/lilo -v -v to put it in my MBR of ubuntu 11.04
and made the following changes to my lilo.conf file
lba32
boot = /dev/sda
map =/boot/ System.map-2.6.38-8-generic
prompt
timeout = 50
compact
vga = extended
image = /boot/vmlinuz-2.6.38-16-generic
label = linux
root = /dev/hda5
initrd = initrd.img-2.6.38-16-generic
read-only
and run lilo then when i reload my system this is what happened
Bios data check successful.........
..........
...........
.
.
mount: mounting /dev/block/8:5 on root failed
Begin: Running /scripts/local.bottom ... done
done.
Begin: Running /scripts/init.bottom .......mount:mounting /dev on /root/dev faild :no such file or directory
mount: mounting /proc on /root/proc failed :no such file or directory
Target filesystem doesnot have requested /sbin/init. :no such file or directory


what is this and what is the solution pls help.
tnx!!!!
 
Old 10-24-2012, 02:20 AM   #2
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,669

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
Quote:
boot = /dev/sda
map =/boot/ System.map-]2.6.38-8-generic
prompt
timeout = 50
compact
vga = extended
image = /boot/vmlinuz-2.6.38-16-generic
label = linux
root = /dev/hda5
initrd = initrd.img-2.6.38-16-generic
Is it true (or a mere typo)? Map youir system to the proper kernel.

Last edited by malekmustaq; 10-24-2012 at 02:21 AM.
 
Old 10-24-2012, 03:08 AM   #3
micflunu
Member
 
Registered: Oct 2012
Posts: 73

Original Poster
Rep: Reputation: Disabled
well u know i posted this,by the way it is a typo, coz i didnot understand it.if i new how to map to the kernel i wldn,t have posted this.I want some one who cld help me the mistakes i am commiting and how to correct them.
 
Old 10-24-2012, 03:25 AM   #4
whizje
Member
 
Registered: Sep 2008
Location: The Netherlands
Distribution: Slackware64 current
Posts: 594

Rep: Reputation: 141Reputation: 141
Quote:
root = /dev/hda5
shouldn't this be

Code:
root = /dev/sda5
 
Old 10-25-2012, 12:45 AM   #5
micflunu
Member
 
Registered: Oct 2012
Posts: 73

Original Poster
Rep: Reputation: Disabled
but i my system is SCSI.wld this work.and cld u give me some document to make me understand this things??
 
Old 10-26-2012, 05:58 PM   #6
Fred-1.2.13
Member
 
Registered: Jan 2006
Location: Midwest USA
Distribution: Started with Slackware - 3.0 1995 Kernel 1.2.13 - Now Slackware Current. Also some FreeBSD.
Posts: 124

Rep: Reputation: 59
Quote:
Originally Posted by micflunu View Post
but i my system is SCSI.wld this work.and cld u give me some document to make me understand this things??
I need a document to understand what you wrote. Please write in complete words and sentences with proper caps and punctuation, it really helps us help you when we can understand what you are asking.

Anyway... hda (hdb, hdc etc) was used prior to kernel version 2.6.20 for IDE drives. Linux now uses sda (sdb, sdc etc) for all drives SCSI, SATA USB etc. So sda will work with your SCSI drive.

Last edited by Fred-1.2.13; 10-26-2012 at 06:08 PM.
 
Old 10-29-2012, 08:20 AM   #7
micflunu
Member
 
Registered: Oct 2012
Posts: 73

Original Poster
Rep: Reputation: Disabled
using the fork and excvp

I wrote the follwing code hopping i will build a mini shell executing the simple commands ls,chdir...

#include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include<string.h>
#include<sys/types.h>
#include<stdio.h>
#include<stdarg.h>
int countArgs(int num, ...)
{
va_list ap;
int i, t;
va_start(ap, num);
{
for(i=0; t = va_arg(ap, int); i++)
return t;
}
va_end(ap);
}
int main(int argc, char **argv)
{
//buffer is to hold the commands that the user will type in
char buffer[512];
// /bin/program_name is the arguments to pass to execv
//if we want to run ls, "/bin/ls" is required to be passed to execv()
char* path = "/bin/";

while(1)
{
//print the prompt
printf("myShell&gt;");
//get input
fgets(buffer, 512, stdin);
//fork!
int pid = fork(); //Error checking to see if fork works
//If pid !=0 then it's the parent
if(pid!=0)
{
wait(NULL);
}
else
{
//if pid = 0 then we're at teh child
//Count the number of arguments
int num_of_args = countArgs(buffer);
//create an array of pointers for the arguments to be passed to execcv.
char *arguments[num_of_args+1];
//parse the input and arguments will have all the arguments to be passed to the program
parse(buffer, num_of_args, arguments); //set the last pointer in the array to NULL. Requirement of execv
arguments[num_of_args] = NULL;
//This will be the final path to the program that we will pass to execv
char prog[512];
//First we copy a /bin/ to prog
strcpy(prog, path);
//Then we concancate the program name to /bin/
//If the program name is ls, then it'll be /bin/ls
strcat(prog, arguments[0]);
//pass the prepared arguments to execv and we're done!
int rv = execv(prog, arguments);
}

return 0;
}
but i keep getting the following error message
/myshell.c: In function ‘countArgs’:
./myshell.c:53:17: error: ‘ap’ redeclared as different kind of symbol
./myshell.c:52:21: note: previous definition of ‘ap’ was here
./myshell.c:55:9: error: ‘n_args’ undeclared (first use in this function)
./myshell.c:55:9: note: each undeclared identifier is reported only once for each function it appears in
./myshell.c: In function ‘main’:
./myshell.c:60:2: error: expected declaration or statement at end of input
what is wrong???how cld i correct this
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
lilo error message micflunu Linux - Newbie 1 10-23-2012 05:59 AM
Error loading operating system message with LILO Maverick1182 Linux - Newbie 1 07-29-2005 08:21 PM
lilo error message irvken Linux - Software 2 08-14-2004 10:29 AM
LILO - error message cboua Linux - Laptop and Netbook 1 06-04-2004 05:30 PM
Updating Lilo Error Message Cozz23 Linux - General 1 02-19-2004 01:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration